Show TOC

Generating an OData Service Using the Mapping EditorLocate this document in the navigation structure

SADL offers a mapping editor in the SAP NetWeaver Gateway Service Builder to bind one or several SADL models to OData entity sets. This enables you to use SADL models as an additional data source besides RFC and others. Once the OData properties are mapped, the system provides a standard, optimized implementation of the OData service to retrieve the data.

Prerequisites

  • You are familiar with working with SAP NetWeaver Gateway Service Builder. For information about the Gateway Service Builder, see SAP Help Portal at help.sap.com at Start of the navigation path Technology Next navigation step SAP NetWeaver Platform Next navigation step <Release> Next navigation step Application Help Next navigation step Function-Oriented View Next navigation step SAP NetWeaver Gateway Foundation (SAP_GWFND) Next navigation step SAP NetWeaver Gateway Foundation Developer Guide Next navigation step SAP NetWeaver Gateway Service Builder End of the navigation path.
  • You have access to the back-end system and are authorized to log on to this system and to generate and register OData Services. For information about required authorizations, see SAP Help Portal at help.sap.com at Start of the navigation path Technology Next navigation step SAP NetWeaver Platform Next navigation step <Release> Next navigation step Application Help Next navigation step Function-Oriented View Next navigation step SAP NetWeaver Gateway Foundation (SAP_GWFND) Next navigation step SAP NetWeaver Gateway Configuration Guide Next navigation step OData Channel Configuration Next navigation step User, Developer, and Administrator Authorizations End of the navigation path.

Procedure

  1. In SAP NetWeaver Gateway Service Builder, create a project and define the OData model.
  2. Open the Service Implementation node, right-click on an entity set and choose Map to Data Source.
    When you implement a SADL-based OData service, you map the complete entity set. This differs from the usual procedure, where you map each operation (Create, Read, and so on) separately.
  3. Choose the data source type and open the value help for the Name field.
  4. Choose the SADL model by selecting a SADL Model Source and SADL Model Name.
    The options you see here, depend on what is available in the system. Usually you should see DDIC and CDS.
  5. To map the entities, associations and actions, you have the following options:
    • You can switch between the Property Editor, Association Editor, and the Action Editor. From the editor you are currently working in, you can switch to the other two possible editors.
    • Generate a mapping proposal by choosing Generate Mapping. This compares the ABAP field names of the properties with the names in the SADL entity tree. Upper and lower case as well as underscores are ignored. Only the highest level of the entity tree is compared. If both values are the same, you will see that the SADL entity name has been entered in the Element column of the mapping table. You have to generate the mapping for entities and associations separately.
    • Create the mapping by dragging the elements from the SADL tree and dropping them on the corresponding cell in the Elements column of the mapping table.
  6. Generate the runtime artifacts and register the service.