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.
Procedure
- In SAP NetWeaver Gateway Service Builder, create a project and define the OData
model.
- 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.
- Choose the data source type and open the value help for the
Name field.
- 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.
- 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.
- Generate the runtime artifacts and register the service.