Show TOC

 Creating an ABAP Class for the Custom Extension Web ItemLocate this document in the navigation structure

Use

Web item Custom Extension allows you to display your own HTML. You do this by creating an ABAP class that implements the relevant properties and parameters from ABAP interface IF_BICS_CONS_WEBITEM_CUST_EXIT. More information: ABAP Interface IF_BICS_CONS_WEBITEM_CUST_EXIT

Note

ABAP class CL_BICS_CONS_WEBITEM_CUST_EXIT implements the above-mentioned interface. Complex Example: Displaying the XML of Two Data Providersuses this ABAP class  More information: Complex Example: Displaying the XML of Two Data Providers

Procedure

Creating an ABAP Class

  1. On the SAP Easy Access screen, choose Tools → ABAP Workbench → Development → Class Builder (transaction SE24). More information: Class Builder
    Note

    You can also use the Object Navigator from the ABAP Workbench (transaction SE80) to generate a class. More information: Object Navigator

  2. To create a new class, enter a technical name (such as ZCL_BICS_CONS_WEBITEM_ABAP) under Object Type and choose  (Create). The Create Class YourClassNamedialog box appears.
  3. Save your class. The Create Object Directoryscreen appears.
  4. Depending on the system configuration for changes and object transports, either choose a package or save your class as a local object. For more information, contact your system administrator. The Class Builder: Change Class YOUR CLASS NAME screen appears.
  5. Choose the Interfaces tab page and enter IF_BICS_CONS_WEBITEM_CUST_EXIT as the interface.
  6. To see all of the properties and methods of interface IF_BICS_CONS_WEBITEM_CUST_EXIT  in your ABAP class, choose  (Save).
  7. Choose the Methods tab page and select one of the listed methods (such as IF_BICS_CONS_WEBITEM_CUST_EXIT~EXECUTE) to implement.
  8. To change the implementation of the method, call it by double-clicking the method name.
  9. To return to the original screen, choose  (Back).
  10. Save your changes.
  11. To activate your changes, choose  (Activate).

Debugging the ABAP Class

For test purposes, you can debug the ABAP class. As the ABAP class is called implicitly by the Java-based BEx Web runtime (and not in the SAP GUI or using an http request), the ABAP class can only be debugged if its internal system state is displayed in the form of messages.

To display these messages in a BEx Web application, use function module RRMS_MESSAGE_HANDLING. You can use generic message BRAIN 143 ("Technical Information: &1&2&3&4") here to display up to four parameters. You can also use any other message of your choice:

CALL FUNCTION 'RRMS_MESSAGE_HANDLING'          EXPORTING            I_CLASS  = 'BRAIN'            I_TYPE   = 'S'            I_NUMBER = '143'            I_MSGV1  = sy-msgv1            I_MSGV2  = sy-msgv2            I_MSGV3  = sy-msgv3            I_MSGV4  = sy-msgv4.

Result

You have created (and debugged) an ABAP class in order to integrate your own HTML or JavaScript into a Web template. You can now integrate the ABAP class in the Web template using Web item Custom Extension (Parameter Customer Exit → Exit-Type  → Name of the ABAP Class).More information: Custom Extension