Show TOC

Implementing Data ProvidersLocate this document in the navigation structure

You must implement data providers for complex scenarios (if you are using multiple entities defined in the SAP Gateway Object Model). EDP and data providers can be implemented in different cases (see the diagram below):

  • Option 1 and option 2 is preferred in case there are multiple entities defined in the SAP Gateway Object Model and each entity corresponds to different backend API (RFC or BAPI or Web service). In this case a data provider instantiates EDPs

  • Option 3 is preferred if the model has a single entity defined. In this case EDPs act as data providers.



The runtime processing for a SAP Gateway Data Model can be handled by one data provider class for each software release. Implement one EDP for each individual entity in the SAP Gateway Data Model. For example, If a SAP Gateway data model is defined for Sales Order with Sales Order Header as one entity and Sales Order Item as another entity (each having different backend APIs), then implement an EDP for each of these entities separately.

Proceed as follows:

  1. Create a data provider class by inheriting /IWFND/CL_MGW_ABS_DATA.

    Note
    • Redefine the CRUD operations of the data provider class.

    • Do not call CRUD operations of the super class.

  2. Instantiate the EDP based on the entity name IV_ENTITY_NAME provided as importing parameter. While creating an EDP pass the system alias and the context.

    CREATE OBJECT <entity_ref> TYPE <ENTITY>
    EXPORTING
    io_context      = mo_context
    iv_system_alias = mv_system_alias. 
     
  3. Execute the CRUD operations of EDP.

Continue with Implementing Entity Data Provider.

Back to Developing Content on SAP Gateway OData Channel.