BSP 技术测试01 -- A Small BSP Application (No MVC & Without HTMLB)

本文参考官方的 BSP Tutorials -- A Small BSP Application 进行测试

http://help.sap.com/saphelp_nw04/helpdata/en/1a/c5133a62983c0ae10000000a114084/content.htm

 

测试环境 :

 

 

1.        SE80 创建 BSP Application

 

: 双击 BSP Application Name, 本例为 ZBSP02, 可以为整个程序设定 Navigation 信息

1.       First Page – Default.htm

l         Layout code:

<%@page language="abap" %>
<
html >
  <
body   BGCOLOR = "#B5E1D2"  >
    <
h2 > Welcome to our Online Book Catalog! </ h2 >
    <
p >
    This bookshop offers 
a   small  selection of interesting books.
    <
p >
    To display all the books written by an author,
    enter the 
name  of the author in the field below.
    <
p >
    To display all the authors whose books we offer,
    choose <
i >to list of authors</ i >.
    <
p >
    To display all books we offer, just choose
    <
i >books by this author</ i > without entering  a   name .
    <
p >
    <
img   height = "130"   src = "../PUBLIC/Tutorial/book2.jpg " >
    <
img   height = "130"   src = "../PUBLIC/Tutorial/book2.jpg " >
    <
img   height = "130"   src = "../PUBLIC/Tutorial/book2.jpg " >
    <
p >
    <
form   method = "post" >
      last 
name
      <
input   type = text      name = "authorlname"      value = ""  >
      first 
name
      <
input   type = text      name = "authorfname"      value = ""  >
      <
p >
      <
input   type = submit   name = "onInputProcessing(select)"
        
value = "books by this author" >
      <
p >
      <
input   type = submit   name = "onInputProcessing(authors)"
        
value = "to list of authors" >
    </
form >
  </
body >
</
html >

 

l         Event Handler

 

 

 

 

: 红圈处文档为 navigation, 激活时总是报错 , 按照提示信息修正为 _m_navigation , 激活成功 .

     另, 其实此处应该为大写的 NAVIGATION, 奇怪的是在这个地方ABAP竟然又区分大小写了. SPAN { font-family: "Yahei Mono"; font-size: 10pt; color: #000000; background: #FFFFFF; }


 

 

1.       Second Page – Authors.htm

l         Layout Code:

<%@page language="abap" %>
<
html >
  <
body   BGCOLOR = "#B5E1D2" >
    <
h2 > List of Authors </ h2 >
    <
table   border = 1 >
          <
tr >
        <
td >< b >first  name </ b ></ td >
        <
td >< b >last  name </ b ></ td >
          </
tr >
            
<%
              
data : wa_author  type  bsauthline.
              
loop   at  authors  into  wa_author.
            
%>
        <
tr >
          <
td <%= wa_author-authfnam %>  </ td >
          <
td <%= wa_author-authlnam %>  </ td >
        </
tr >
            
<%
               
endloop .
            
%>
    </
table >
  </
body >
</
html >

l         Event Handler

 

l          Page Attributes

 

l          Type Definitions

 

 

1.        Third Page – Results.htm

l          Layout Code:

<%@page language="abap" %>
<
html >
  <
body   BGCOLOR = "#B5E1D2" >
  <
h2 > Your Book Search Results </ h2 >
<%
  
if  books  is   initial .
%>
<
h3 > Sorry, we found no matches  for   <%= authorlname %> ,
<%= authorfname %> . </ h3 >
<%
  
else .
%>
<
h3 > The matches  for  this search are: </ h3 >
<
table   border = 1 >
      <
tr >
    <
td > ISBN </ td >
    <
td Title  </ td >
    <
td > Author </ td >
  </
tr >
<%
  
data : wa_book  type  BSBOOK.
  
loop   at  books  into  wa_book.
%>
<
tr >
  <
td <%= wa_book-isbn %>  </ td >
  <
td <%= wa_book-title %>  </ td >
  <
td <%= wa_book-authfnam %>  <SPACE>
    
<%= wa_book-authlnam %>  </ td >
</
tr >
<%
  
endloop .
%>
</
table >
<%
  
endif .
%>
  </
body >
</
html >

l          Event Handler

 

 

l          Page Attributes

 

 

: 1. 页面中要传递的参数 , 要勾上 Auto 标记 , 不然值传不过来 .  2. 后面的表类型就是在数据字典中定义的啦

 

5. 整体运行效果

 

 

 

 

 

注:这个 Trial 版本中 , 本例用到的表都是空的 , 本例的数据是我手工添加的.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值