In the OData Channel, the Application Programming Interface (API) for SAP Gateway is located in the backend system. In the ABAP Workbench, you can use the SE80 design time to create a data model dedicated to the OData Channel without having to provide a model provider class (MPC) on the backend. To consume the data model at runtime, however, you will still need to create a data provider class (DPC) in the backend system. The data model information is then read from the SAP Gateway hub system and published as an OData service. In short, you create a data model in the backend system from data stored in the backend, but you activate the service on the SAP Gateway hub system. For more information, see OData Channel.
The following constraints apply when creating data models:
Reuse of external data models and nodes is not supported.
There can only be one root data object for each data model.
Output data objects of operations must always have a multiplicity of 0..n.
The following SAP annotations are not supported:
To create a data model from scratch on the OData Channel, follow the procedure below.
Start the ABAP Workbench in transaction SE80.
Select SAP GW Data Model from the dropdown list.
Enter a name for the data model you wish to create, adhering to the following naming convention (maximum of 24 characters):
<customer name range> or <reserved customer namespace><name>
For example, ZJWTEST.
A dialog box informs you that this object does not exist and asks if you wish to create it.
Select Yes and the Create Data Model dialog box displays, with the data model name you entered above displaying in the Name field:
Ensure PS (Public Solution) is entered in the Type field.
Version (read-only) displays as 0001 (first version).
The From Scratch button and accompanying OData Channel box are checked by default.
Enter a name for the Root data object.
The Create Key box is not available (greyed out).
Select the green checkmark to continue.
Enter the relevant package name in the next dialog box and choose Save, or Local Object.
A message displays at the bottom of the screen confirming that the data model has been saved. A data model skeleton is created and displays in the repository browser in a tree structure, showing the root data object and an Object Structure folder beneath it, under which data objects and properties will display when created.
The Model Runtime field on the right indicates that the data model will use the OData Channel at runtime (read-only).
You can now add data objects, operations, properties, complex types, and relations to the data model (see More Information below).
You can also rename or delete properties, data objects, and operations (Rename and Delete are available from the context menu). However, you cannot delete the root data object.
When you have created the data model, you can reassign it to another package (for example, if you work on the model on local and then wish to move it to production). Right-click the data model name in the SE80 tree view, select Reassign package, and enter the new package details in the reassignment popup.
You can also copy a data model by right-clicking the data model name and selecting Copy. For more information, see Copying a Data Model in Deriving a Data Model from an Existing Data Model.
To create the data model entities, see:
Properties Editor to define or edit the model's properties.
Annotation Editor for information about adding or modifying user-specific annotations.
After you have created a data model, see:
Deriving a Data Model from an Existing Data Model to create a User Centric (UC) data model, required if you wish to add annotations.
Consumption Model URL to check the service.
Creating a Model on the OData Channel for a cookbook showing a worked example.
As an alternative to creating your own data model and consumption model using SE80 design time, you can import an existing service description file and automatically generate implementations for data and metadata provisioning. For more information, see OData Channel Generation Tool. This tool is only available on the OData Channel.