Show TOC

User Self Service Enhancement OptionsLocate this document in the navigation structure

BAdIs available for User Self Service.

Context

User Self Service provides the following BAdIs to extend the solution. All these BAdIs are available as IMG activities, the technical names and the corresponding IMG activity names are provided below:

  • /IWBEP/BD_MGW_URM_VERIFICATION - Verify User Request
  • /IWBEP/BD_MGW_URM_NOTIFICATION - Define Notification Process for User Request Management
  • /IWBEP/BD_MGW_UM_USER_MANAGER - Implement User Management
  • /IWBEP/BD_MGW_UM_NOTIFICATION - Define Handler for User Management Notification

To implement the BAdIs, go to transaction SPRO, open the SAP Reference IMG and navigate to: Start of the navigation path SAP NetWeaver  Next navigation step  SAP Gateway Service Enablement Next navigation step  Backend OData Channel Next navigation step  User Self Service Setup End of the navigation pathand choose the relevant IMG activity and click Execute. For more information on the BAdI, click the display icon.

Example - Extending UserRequest Entity: You have the option to extend the UserRequest entity of the USERREQUESTMANAGEMENT OData service with application specific fields like Business partner ID, Meter ID, and so on.

Procedure

  1. Enhance the UserRequest structure: The User Request table is provided with an include structure /IWBEP/S_MGW_URM_USR_REQ_EXT which can be enhanced and you can add your own include structures as per your requirement.
  2. Extend the UserRequest entity in the model:
    1. Create your own metadata provider class and inherit from the super class /IWBEP/CL_MGW_URM_MODEL.
    2. Redefine the method DEFINE( ).
    3. Inside the method DEFINE( ), first call super->define( ) and then define your own fields for the entity UserRequest using the metadata APIs. See an example code snippet below.
      method DEFINE.
      
       DATA: lo_entity TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
             lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
      
       super-> define( ).
      
       lo_entity = model->get_entity_type( 'UserRequest' ). 
       lo_entity-> create_property( iv_property_name ='<property_name> iv_abap_fieldname = '<property_abap_field_name>'
      ).
      "iv_abap_fieldname should be same as present in the field of the structure /IWBEP/S_MGW_URM_USR_REQ_EXT 
      
      endmethod. 
    4. Save and activate.
  3. Maintain the Model: The newly created model provider class has to be maintained using the IMG activity which is available in the system.
    1. Go to transaction SPRO, open the SAP Reference IMG and navigate to: Start of the navigation path SAP NetWeaver  Next navigation step  SAP Gateway Service Enablement Next navigation step  Backend OData Channel Next navigation step  Service Development for Backend OData Channel Next navigation step  Maintain Models End of the navigation pathand click the activity icon.
    2. Enter a technical model name and model version.
    3. Click Create.
    4. Enter the name of the model provider class you created above and a description for the same.
    5. Click Save.
  4. Register the Service: The service has to be registered using the IMG activity which is available in the system.
    1. Go to transaction SPRO, open the SAP Reference IMG and navigate to: Start of the navigation path SAP NetWeaver  Next navigation step  SAP Gateway Service Enablement Next navigation step  Backend OData Channel Next navigation step  Service Development for Backend OData Channel Next navigation step  Maintain Service End of the navigation pathand click the activity icon.
    2. Enter a technical model name and model version.
    3. Click Create.
    4. Enter a description for the service.
    5. Enter /IWBEP/CL_MGW_URM_DATA in the Data Provider Class field.
    6. Click Save.
    7. Click Assign Model to assign the model that was created in the Maintain model step.
  5. Verify the extended fields: All the extended fields can be verified by implementing the BAdI /IWBEP/BD_MGW_URM_VERIFICATION.
    To implement the BAdI, go to transaction SPRO, open the SAP Reference IMG and navigate to: Start of the navigation path SAP NetWeaver  Next navigation step  SAP Gateway Service Enablement Next navigation step  Backend OData Channel Next navigation step  User Self Service Setup Next navigation step  Verify User Request  End of the navigation path. For more information on the BAdI, click the display icon.