4 Different ways to create OData Services

0
1029

Dear SAPLearners, in this blog post i will discuss about different ways to create and model an OData service in SEGW(Gateway Builder) and Eclipse ABAP Development Tools.

SEGW(Gateway Builder) Tool

There are 3 different approaches to create and model an OData service in gateway builder(SEGW). They are

1. ABAP code-based implementation

This is most used approach in creating OData services. In this approach we define the model and write the business data retrieval logic in run-time generated artifact DPC_EXT class.

Also Read: How to create OData Service using code-based implementation.

Before discussing the other approaches i would like to introduce you to the SADL (Service Adaptation Description Language), as the other 2 approaches depend on this framework.

Service Adaptation Description Language(SADL)

SADL is an ABAP technology that enables the consumption of entity relationship-like ABAP data models in various scenarios with a common development experience based on a model-driven approach.  – SAP definition

SADL model is a data model like CDS views, DDIC tables (or) views and BOPF.

In short, SADL framework allows us to create OData service based on a model-driven approach using ABAP CDS Views.

Now, lets continue with other approaches

2. Mapping Editor

In SEGW gateway builder, you can map an ABAP CDS Views as a data source to the entity type properties.

Also Read: How to create OData Service in SEGW Using the Mapping Editor

With this approach, the business logic is available in ABAP CDS View. The SADL framework provides a standard, optimized implementation of the OData service to retrieve data.

You can map as many as ABAP CDS views in a single SEGW OData service.

3. Referenced Data Source

In SEGW gateway builder, you can reference an ABAP CDS Views as a data source. Each entity type in OData service model corresponds to 1 ABAP CDS view.

Also Read: How to create OData Service based on Referenced Data Sources

Along with these 3 approaches we have another approach, that is using annotation in ABAP CDS views.

ABAP Development Tools(Eclipse-based IDE)

4. Using Annotation

In this approach we can create OData service directly on ABAP CDS View in Eclipse ABAP Development Tools using annotation @OData.publish: true

Also Read: How to create OData service on ABAP CDS view using Annotation

Now we know 4 different ways to create OData service and different tools cover different use cases. Below is the table which compares different approaches.

Comparing Different Approaches

Congrats.! you have successfully learned 4 different ways to create OData Service using SEGW and ABAP Development Tool.

Please feel free to comment and let us know your feedback. Subscribe for more updates

If you liked it, please share it! Thanks!

Also Read Other Tutorials

OData Tutorials

ABAP CDS View Tutorials