Gateway Services Development Chart
The Service Builder supports the development and generation of OData services.
With Service Generation, you can create OData services without writing a single line of code. We’ll cover Service Generation later in the course but first let’s look at service development.
OData Service Development Phases
The Service Builder supports all phases in the development of OData services:
- Service Creation phase
In this phase you create a project to bundle all the artifacts that are needed to develop a service in one central location.
- Data Model Definition phase
In this phase, you define the model (entity types, entity sets, associations, and so on) that your service will be based on.
- Service Implementation phase
In this phase, you implement the operations that will be supported by the service.
- Service Maintenance/Activation phase
Service Maintenance entails registering the service and activating the service in an SAP Gateway system.
Note: The steps are not necessarily performed sequentially as shown in the figure.

Data Modeling Definition Phase
Once you have created a project in SAP Gateway Service Builder, you can start the data modeling process. Depending on your requirements, you can define a data model in the following ways:
- You can use Declarative Model Definition to manually define a new data model within your project — that is, you create the individual data model elements, such as entity types, entity sets, and associations, from scratch.
- You can reuse an existing data model. The Import Data Model (EDMX) option allows the import of data model files created by external model editors like Visual Studio (edmx) files and metadata (xml) files.
- You can import a view, a table, or a structure from the ABAP Dictionary to create new complex types and entity types with ease. New entity types and complex types can also be created based on the interface parameters of Function Modules and BAPIs. A wizard is provided to guide you through the relevant process.

Data Model Definition through Gateway Services
For greater flexibility, the Service Builder also allows you to generate services from external frameworks such as the Service Provider Interface, Generic Interaction Layer, and SAP Business Information Warehouse. The Service Builder enables you, in this case, to make certain restricted changes in the generated services. For example, these services might not have proper labels or might not need all the artifacts. In these cases, the Service Builder allows you to make cosmetic changes without influencing the underlying implementation of the service.
Service Implementation Phase
This can be done in the following ways:
- Using the Code-Based Implementation approach, you manually implement the respective methods of the data provider class.
- You establish a relationship between the interface parameters of a Function Module, BAPI, Search Help, or the new CDS views and the properties of an entity set using the built-in mapping tool of the Service Builder.
- For a function module or BAPI, the Service Builder enables you to map the create, read, update, delete, and query operations separately for each entity set of your data model.
- For a search help you can map the read and query operation.
- For a CDS view, you map the EntitySet rather than the methods. Here the read and query methods are automatically mapped to the CDS view. Using this approach, the implementation of the corresponding data provider class methods is generated based on your mapping.

Service Development
To start service implementation, create an entity type or entity set based on the import of a DDIC structure. The service implementation is performed using a code-based implementation.

To Develop a Gateway Service
To develop a service using the SAP Gateway Service Builder, perform the following steps:
Steps
-