Show TOC

Creating ControllersLocate this document in the navigation structure

Prerequisites

You are in an SAP Web AS 6.20 system.

Context

You create controllers in order to use the Model View Controller design pattern in your BSP application. You can use a controller for the initial access (see also Testing Controllers).

Procedure


  1. Use the Web Application Builder in ABAP Workbench (transaction SE80) to create a controller object as a subobject of your BSP application.

    Define the 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 Class Builder (transaction SE24), create the class that is derived from CL_BSP_CONTROLLER2.

    Note

    If you create your class directly from Web Application Builder by double-clicking on the class name, the inheritance of CL_BSP_CONTROLLER2 is configured for you.

  3. Overwrite some of the methods in your class, especially DO_REQUEST.

    You can find out more about these methods in CL_BSP_CONTROLLER2 and Process Flow.

  4. Save and activate your class and your controller.

Example

You can find examples of controllers in BSP application ITMVC2.