
BSPs with Layout, Initialization and Navigation
Overview
This simple BSP applications contains two BSPs with layout, page attributes and the event handler OnInitialization.
Depending on the user input for the year of publication, the next page displays various lists of books in table form.
These BSPs are as follows in the Web Application Builder:
|
Layout of startpage.htm |
|
< %@page language="abap"%><html> <head> <link rel="stylesheet" href="../../sap/public/bc/bsp/styles/sapbsp.css"> <title> Selection Page </title> </head> <body class="bspBody1"> Year of Publication: <form method="post" action="page2.htm" > <select name="sel_publyear"> <option value="2000"> Year 2000 <option value="2001"> Year 2001 </select> <input type="submit" value="Select"> </form> </body> </html> |
|
Layout of page2.htm |
|
< %@page language="abap"%><html> <body> <h2> Book list </h2> <table border=1> <tr> <th>Title</th> <th>Publisher</th> <th>ISBN</th> </tr> <% data: wbook like line of books. loop at books into wbook. %> <tr> <td> <%= wbook-title %></td><td> <%= wbook-publisher %></td><td> <%= wbook-ISBN %></td></tr> <% endloop. %> </table> </body> </html> |
|
OnInitialization of page2.htm |
|
data: year type int.
year = request->get_form_field( 'sel_publyear' ).
select * from bsbook into table books where publyear = year. |
|
Page Attribute of page2.htm |
||||
|
Attribute Name |
automatic |
Typing Type |
Reference Type |
Description |
|
books |
TYPE |
BOOK_TAB |
Booklist |
|

The internal table
books of type BOOK_TAB is filled in OnInitialization.Processing Process
The individual steps that are followed when processing this BSP are as follows: