Show TOC

Process documentationCreating genIL Components and Transaction Handler Manually

 

SAP and partners of SAP who develop data models in the SAP namespace have to create related genIL components manually using, for example, transaction GENIL_MODEL_BROWSER. The genIL component name has to use the SAP namespace, too. You also need a custom transaction handler that uses cl_mdg_bs_bol_transaction as super class.

Process

Create Implementation Classes for genIL Components

You need to create specific implementation classes for your MDG data model that inherit from the following classes:

  • CL_USMD_GENERIC_GENIL_ADAPTER for single-object processing

  • CL_USMD_GEN_MC_GENIL_ADAPTER for multi-record processing

The classes have to implement a custom class constructor. The constructor has to define the MDG data model to be used before performing a call to the parent's constructor.

  1. Create a new class for the single-object processing genIL component using transaction SE24 or SE80.

    • Proposed name: ZCL_USMD_GENIL_ADAPTER<ID of MDG data model>

    • Proposed description: MDG genIL Adapter SOP for <data model>

    • Super Class: CL_USMD_GENERIC_GENIL_ADAPTER

  2. Create a class constructor.

    • Add the method CONSTRUCTOR with the parameters IV_MODE and IV_COMPONENT:

      importing

      !IV_MODE type CHAR1

      !IV_COMPONENT_NAME type CRMT_COMPONENT_NAME optional .

    • Use the following code snippet for the method implementation:

      "define the desired model

      IF mv_defined_model IS INITIAL.

      mv_defined_model = <YOUR MDG MODEL NAME>

      ENDIF.

      "call parent

      super->constructor(

      iv_mode = iv_mode

      iv_component_name = iv_component_name ).

  3. Save and activate the implementation class.

  4. Create a new class for the multi-record processing genIL component using transaction SE24 or SE80.

    • Proposed name: ZCL_USMD_MC_GENIL_ADAPTER_<ID of MDG data model>

    • Proposed description: MDG genIL Adapter MOP for <data model>

    • Super Class: CL_USMD_GEN_MC_GENIL_ADAPTER

  5. Create a class constructor.

    • Add the method CONSTRUCTOR with the parameters IV_MODE and IV_COMPONENT:

      importing

      !IV_MODE type CHAR1

      !IV_COMPONENT_NAME type CRMT_COMPONENT_NAME optional .

    • Use the following code snippet for the method implementation:

      "define the desired model

      IF mv_defined_model IS INITIAL.

      mv_defined_model = <YOUR MDG MODEL NAME>.

      ENDIF.

      "call parent

      super->constructor(

      iv_mode = iv_mode

      iv_component_name = iv_component_name ).

  6. Save and activate the implementation class.

Create genIL Components

Use the GenIL Model Editor with transaction GENIL_MODEL_BROWSER to create the components for your MDG data model. You need to create separate components for single-object processing and multi-record processing, using the specific implementation classes that you have created as described in the section Create Implementation Classes for genIL Components. Enter a description, for example, MDG Single Processing for <data model>. If required, enter a prefix, for example, your reserved namespace.

For more information, see SAP Note 2045072Information published on SAP site.

Create a Custom Transaction Handler

You need to create a custom transaction handler only for data models in the SAP namespace, for example implemented from SAP or partners of SAP. If you have used the customer namespace for the creation of your data model, you do not create a custom transaction handler.

A transaction handler is an ABAP-based class that is required for the user interfaces of single object processing. The transaction handler has to define the genIL component to be used. Therefore, a single transaction handler has to be created for each genIL component being responsible for single object processing:

  1. Create a new class using transaction SE24 or SE80.

    • Proposed name: ZCL_MDG_BOL_TRANSACTION_<ID of MDG data model>

    • Proposed description: MDG BOL Transaction Handler for <data model>

    • Super Class: CL_MDG_BS_BOL_TRANSACTION

  2. Redefine the interface method IF_FPM_WIRE_MODEL_TRANSACTION~START.

    • The redefined method has to perform a parent call.

    • The redefined method has to set the class attribute GV_GENIL_COMPONENT to your specific genIL component.

    • The redefined method has to set the genIL component in the class attribute MO_EVENT_HANDLER.

    • Below you can find sample code that you can copy and paste to your system environment:

      METHOD if_fpm_wire_model_transaction~start.

      *! This method is called during the transaction start. It

      * is needed to set the correct genIL component.

      "inherit

      super->if_fpm_wire_model_transaction~start(

      EXPORTING

      io_message_manager = io_message_manager

      io_app_parameter = io_app_parameter

      is_runtime_info = is_runtime_info

      IMPORTING

      ev_allow_fpm_commit = ev_allow_fpm_commit ).

      "define genIL component for the SOM UIs

      me->gv_genil_component = <YOUR COMPONENT>. "e.g. 'ZSP_ZT'

      IF me->mo_event_handler IS BOUND.

      me->mo_event_handler->set_genil_component( gv_genil_component ).

      ENDIF.

      ENDMETHOD.

  3. Save and activate your transaction handler.

You must use this transaction handler in the wiring tab of your configuration of the overview page component.