You have various development options to create an OData Service:
Regardless of which option you choose, you have to create the OData-Service in the service catalog manually. For creating the OData-Service, use transaction: /IWFND/MAINT_SERVICE.
Service Creation
The Gateway Service Builder supports the following development steps:
- Project Creation
The process starts when you create a project in the Gateway back-end system. To create a project, use the transaction code: SEGW. The Service Builder bundles the artifacts you need to develop in a project.
- Data Model Definition
In this phase, you define the model your service is to be based on. That is, you define the entity types, entity sets, associations, and so on that underlie your service.
- Service Implementation
In this phase, you implement the operations that are supported by the service. Here, the runtime objects (ABAP classes and other repository objects) that make up a Gateway service are generated. The actual implementation of the service can be done either by writing code, or by mapping the methods of an OData service to the methods of a data source. In this phase, you also register the service in the backend.
- Service Maintenance
In this phase, you activate (or publish) the service on the SAP Gateway hub system that has been registered in the SAP backend system.
Data Model Definition
Service Builder Tree Structure
In the figure, Data Model in Service Builder, the example entity data model consists of the five entity types: Product, BusinessPartner, SalesOrder, SalesOrderItem, and Country (not yet modeled in the Service Builder).
Gateway Service Implementation
An OData service is based on two regular ABAP classes: