SAP BSP 入门1
Components of a BSP program lists:
- Business Server Pages: Define the Web pages that are displayed to the user. Each BSP contain two parts: static part which can use HTML or XML, dynamic part which can use ABAP or Javascripts.
· Pages with flow logic: Including layout and attributes and also event handler which used to do the control work
· Page fragments: Including layout, you can include this page in every common place for simple implementation, no URL defined.
· Views: Used to display data
· One table: BSPDEFPAG - Application class
Encapsulate the business logic required in the application.
Instance name: application
The Class must be a global class defined in the class builder - MIME(Multipurpose Internet Mail Extension) objects
For example: Audio, Video, Graphics, Stylesheet.
Goto MIME object: SE80 - Topic
- Navigation structure
Define the sequence of BSPs within an application. The navigation path are maintained in a table as a property of BSP application. - Controller
Directives:
· BSP directive tag definition:
Enclose with <% and %>
· Page directives tag definition:
<%@page language=’’ABAP’’%>
· Include directive
<%@ include file = ‘’fragment.htm’’%>
· Inline Code :
<% data ls type string.%>
· Output of a variable values
<%= wa-carrid%>
· Comments
<%– xxxxxx –%>
Layouts of a BSPs.
BSP structure :
Page types:
–F: page with flow logic
–V: View
–P: page fragment
BSP events:
When the request coming, the process follow the below logic:
- OnCreate: This event just execute once for stateful, otherwise once the BSP is called.
- OnRequest: Executed each time when the BSP is called, and restore the internal data structure from the request.
- OnInputProcessing: Used for process the user inputs and subsequent navigation to the next pages.
- OnInitialization: Executed after OnRequest, mainly for data retrieval, such as read data from database, filling internal tables….
- Layout:
- OnManipulation: Used for manipulating the data stream according to the layout.
- OnDestroy: The last to be executed, for deleting the information of the BSP application.
Processing user input:
Statements:
Field Type | HTML Tag | Note |
Input/Output type | <input type=”text”
name=”A” value=”B”> | The field is filled with the
value B. |
Password field | <input type=”password”
name=”A”> | |
Checkbox | <input type=”checkbox”
name=”A” value=”X”> | The name/value pair A=X
is then sent with the HTTP request to the receiver, if the checkbox is ticked. |
Radio button | <input type=”radio”
name=”A” value=”X”> | All of the selection buttons
in a group have the same name (but different values). |
Dropdown list | <select name=”A”>
<option value=”B”> Disp </option> … </select> | The user sees the values
specified between <option> and </option> (in this example, Disp). |
Input area with
more than one line | <textarea name=”A”
rows=”…” cols=”…”> | |
Send button | <input type=”submit”
name=”A” value=”Send”> | The text specified after the
value addition appears on the button as a label. |
Static Navigation:
还没有评论,来说两句吧...