Академический Документы
Профессиональный Документы
Культура Документы
Like all Repository objects, a BSP application can be created by copying it. Note
that the corresponding MIMEs are not copied to the target object when you copy
BSP applications. For each new BSP application, the system creates an identically
named directory in the MIME Repository, but it is empty.
To create a new BSP application:
1. 1. Open the Object Navigator (SE80).
2. 2. Choose the BSP Application category from the object list selection and enter the
name of the application you want to create.
If you wish to assign the new BSP application to a valid namespace XYZ that differs from
the standard namespace, you must place the namespace as a prefix in front of the actual
name of the BSP application. The complete name must then be written in this form:
/XYZ/BSPApplication.
3. 3. Click or choose ENTER to confirm your entry.
The system checks to see whether or not a BSP application with that name already exists
in the SAP System. If it does not exist already, the Create Object dialog box appears.
4. 4. Choose Yes to create the BSP application.
The dialog box Web Application Builder: Create BSP Application is displayed.
5. 5. Enter a meaningful Short Description.
6. 6. Choose Create.
The system then displays the Create Object Catalog Entry dialog box.
1. 8. Assign a package to the service.
The system displays the BSP application you have created in the object list tree structure.
Result
The BSP application has been created in the Repository as a development object.
With the new BSP application, a service node with the same name is automatically
generated in the HTTP service maintenance (transaction SICF). As a rule, no such
entry exists for BSP applications that were created in earlier releases. In such
cases, you must create this node manually in the service maintenance transaction.
You call up the corresponding display through the menu function Goto → HTTP
Service Maintenance. Execute the steps as they are described in the section
Creating an ICF Service.
Afterwards, you can assign further attributes for the BSP applications at this point:
Property Description
Initial BSP Here you enter the name of a page that is to be used to start the BSP
application. This entry is important whenever you test the BSP application
from within the workbench.
Application class If you enter the name of an ABAP class as the application class in this
field, then this class can be directly referenced in the BSP application using
the predefined object application. You do not need to create an instance of
the application class and you can directly access its components (methods,
attributes, and events) from any BSP page.
An application class is used to transfer the business logic to a global class
that, in turn, is used to access business data using BAPI calls, for example.
You can assign application classes to more than one BSP application. (All
these applications use the same business logic.)
Note that the application class must exist in the same system and cannot be
addressed through RFC.
Stateful Activate this checkbox whenever the BSP application should be
implemented as stateful. For an explanation of this, refer to the section
Stateful BSP Applications.
See also:
Creating Pages
Creating a Controller
Creating Pages
Use
You can implement the layout for each page (often called BSP) using the script languages
ABAP and JavaScript.
BSPs can have different attributes: Therefore, when you create a page, we distinguish
formally between 3 page types:
Page with flow logic A page defined this way can implement the entire flow logic
itself (event handler-based model). The page can have event
handler and page parameters (including automatic attributes)
in addition to the layout.
Such a page is executable and can be addressed through a
URL or through navigation from other pages.
View Views are used solely for displaying application data. They
have page parameters in addition to the layout section. In
contrast to the page with flow logic, views have neither event
handlers nor automatic page attributes.
A controller class is generally assigned to a view. This class
controls the view calls and is responsible for communication
with the model.
Views are based on the MVC Programming Model and allow
you to clearly separate the application logic from the
presentation logic in BSP applications.
Page fragment Page fragments are special parts. You cannot use them as
stand-alone pages in an application. They are not executable
directly. Instead, you include them into other pages using the
include directive.
Prerequisites
You have already created the BSP application.
Procedure
To create a page for your BSP application from within the object list (SE80):
1. 1. Right-click the BSP application.
2. 2. From the context menu, choose Create → Page.
The system displays the Create Page dialog box.
3. 3. Provide further specifications on the page by enter the name of the page and a
short page description. Afterwards, select the required option for the page type (view
/ page with flow logic / page fragment).
4. 4. Choose Enter to confirm your entries.
The system displays the layout editor for the new page in the tool area.
1. 5. Choose Saveto save your page.
Result
The created page is assigned as subobject to the BSP application and stored in the
Repository. Besides the basic HTML structure, the page directive is pre-generated:
<%@ page language="abap" %> bzw. <%@ page
language="javascript" %>
The page directive determines the script language. The script languages supported are
currently ABAP and JavaScript.
If you have chosen the page type View, both tab pages Event handler and Type
definitions are suppressed – in contrast to a page with flow logic.
If you have chosen Page fragment as the page type, the tab pages Event handler,
Page attributes, and Type definitions are suppressed.
See also
Determining the Page Flow
Creating the Controller
BSP Directives
Creating a Controller
Use
You create a controller to use a Model View Controller design pattern in your BSP application.
You can use a controller for the initial access (see also Testing Controllers).
Prerequisites
You are in a system from SAP Web AS 6.20.
Procedure
1. Use the Web Application Builder in the ABAP Workbench (Transaction SE80) to create a
controller object as a sub-object of your BSP application.
In doing so, you determine the controller name and the class name of the controller. The
URL is automatically inserted from the name of the BSP application and the controller
name.
2. In the Class Builder (Transaction SE24), create the class that is derived from
CL_BSP_CONTROLLER2.
If you create your class directly from the Web Application Builder by double-clicking on
the class names, then the inheritance of CL_BSP_CONTROLLER2 has already been
configured.
Example
You can find examples of controllers in BSP application ITMVC2.