Entering content frame

Procedure documentation Creating a Controller Locate the document in its SAP Library structure

Prerequisites

You have created an empty BSP application for this tutorial.

Procedure

  1. Create a controller within your BSP application.
  2. To do this, choose Create ® Controller.

    This graphic is explained in the accompanying text

  3. On the following dialog box, give the controller a name and add a short description.
  4. This graphic is explained in the accompanying text

  5. Choose This graphic is explained in the accompanying text.
  6. On the following screen, assign a class name to the controller.
  7. The class does not have to exist yet.

    This graphic is explained in the accompanying text

  8. You navigate to the Class Builder by double-clicking on the controller class.
  9. 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.

  10. Choose the This graphic is explained in the accompanying text symbol to branch to the change mode in your class.
  11. This graphic is explained in the accompanying textSelect method DO_REQUEST and choose symbol This graphic is explained in the accompanying text to overwrite the methods.
  12.  

  13. Generate the required output.
  14. 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.

  15. Activate your class and your BSP application.
  16. 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 Structure linkActivating and Deactivating an ICF Service).
  17. In Transaction SICF, select the entry for your BSP application and choose Service/Virt.Host ® Activate.

    This graphic is explained in the accompanying text

    Confirm the following confirmation prompts.

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

Result

This graphic is explained in the accompanying text

Continue by creating a view.

 

 

Leaving content frame