Creating Top-Level Controllers
Procedure
-
Create a BSP application and declare it as stateful.
You can find the checkbox for stateful on the Properties tab page as the ID Stateful.
-
Save your BSP application.
-
Create a controller within this BSP application.
-
Enter a unique class name for the controller.
-
Set the lifetime in the Status field to Session.
-
-
Save your controller.
-
Double-click on the controller class name.
-
The following dialog box asks if you want to create the class. Answer it with yYes.
You branch to the Class Builder.
-
Save your class.
-
On the Properties tab page, check that your class inherits properties from CL_BSP_CONTROLLER2. If this is not the case, for example if your class inherits properties from CL_BSP_CONTROLLER, then change the data for the class that passes on the properties.
-
Branch to the Methods tab page.
-
In change mode, overwrite method DO_REQUEST using the icon
:method DO_REQUEST . data: main_view type ref to if_bsp_page. * if input is available, dispatch this input to subcomponent. * this call is only necessary for toplevel controllers. * ( if this is not a toplevel controller or no input is present, * this call returns without any action) dispatch_input( ). * if any of the controllers has requested a navigation, * do not try to display, but leave current processing if is_navigation_requested( ) is not initial. return. endif. * output current view main_view = create_view( view_name = 'main.htm' ). call_view( main_view ). endmethod. -
If necessary, overwrite DO_INIT.
-
In order to react to user input, overwrite methods DO_HANDLE_DATA and DO_HANDLE_EVENT.
-
-
Activate your class.
-
Create a view within your BSP application.
-
In the following example, the view is called main.htm.
-
Fill the view layout with HTML coding or HTMLB coding.
-
Save the view.
-
-
Activate and test your finished BSP application.
Continue by Creating Components.