SAP Gateway – OData implementation

Posted on Posted in ABAP, ABAP OO, Gateway

A little roadmap to create an OData service in SAP.

ODATA Examples for understanding:

If the version of the Netwearver is greater than 7.3, the component is already installed:

When the version is less than 7.4, you need to install these two components:


Transactions separated by Front End and Back End systems:

Go to SEGW (in the Back End System), and create a new project:



Entity Type: Is the Structure, define the types, etc.
Entity Set: Is the “Internal Table”.

Creating the data Model, based on SAP Table.

Choose the fields:

Needed to define a key:

Proprieties: are like the FIELDS.

Every Service Implementation Entity Set will have its own Operations (Create, GetEntity, Update, Delete etc).


Technical Service Name: Name which the external system needs to call.

Add Service to Service Catalog (Register the Service to Gateway Hub)

Go to your Gateway Hub (Front-end system) and execute t-code /n/IWFND/MAINT_SERVICE.

System Alias is the Back End System. Search for your External Service Name.

Click on it, and specify a package:

Go back:

Search your service in the list, and check if it is activate (green.), if not, activate it.

Ok. We can test it, still in the front end, click in “SAP Gateway Client” or enter in the transaction /IWFND/GW_CLIENT.


Return OK.

Implementing the method POHEADERSET_GET_ENTITYSET to get return of Values.

Go to change mode in the DPC Extension class. Always edit the extension class, because we are enhancing the class.

Change like below, save and activate:

Now, we can test with the method:

Implementing the method to return a determine PO

same thing before, but now, redefine POHEADERSET_GET_ENTITY method, and change to code below.



DATA : ls_key_tab LIKE LINE OF it_key_tab,
lv_ebeln TYPE ekko-ebeln.

*     IT_KEY_TAB has key name and value
READ TABLE it_key_tab INTO ls_key_tab
WITH KEY name = ‘Ebeln’. ” Case sensitive

IF sy-subrc EQ 0.
lv_ebeln = ls_key_tab-value.

*   Select one PO entry
WHERE ebeln = lv_ebeln.


it is going to looks like this:

And in the GW client, we can search for one PO:

Total Views: 878 ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.