Show TOC

Creating ControllersLocate this document in the navigation structure

Prerequisites

You have created an empty BSP application for this tutorial.

Procedure

  1. Create a controller within your BSP application.

    To do this, choose Start of the navigation path Create Next navigation step Controller End of the navigation path.

  2. On the following dialog box, give the controller a name and add a short description.
  3. Choose .
  4. On the following screen, assign a class name to the controller.

    The class does not have to exist yet.

  5. You navigate to the Class Builder by double-clicking on the controller class.

    If the class does not already exist, the system asks you if you want to create it. Choose Yes so that you create a class with the specified name that is derived from CL_BSP_CONTROLLER2.

    Note

    Each controller class must be derived directly or indirectly from CL_BSP_CONTROLLER2.

  6. Choose the symbol to branch to the change mode in your class.
  7. Select method DO_REQUEST and choose symbol to overwrite the methods.
  8. Generate the required output.

    In this example, it is simple HTML:

    method DO_REQUEST .
      write( '<html><body><H1>' ).
      write( 'This is my very first controller' ).
      write( '</H1></body></html>' ).
    endmethod.
                   
  9. Activate your class and your BSP application.
  10. Before you can test the controller, in transaction SICF you must also activate the new entry that was automatically created for your BSP application (see also Activating and Deactivating an ICF Service).

    In transaction SICF, select the entry for your BSP application and choose Start of the navigation path Service/Virt.Host Next navigation step Activate End of the navigation path.

    Confirm the following confirmation prompts.

  11. You can now test the new controller page that you have created.

Results

Continue by Creating Views.