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.3, you need to install these two components:
Main transactions separated by Front End and Back End systems:
Ok, let´s start. 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 like 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:
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.
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
SELECT SINGLE * FROM ekko INTO CORRESPONDING FIELDS OF er_entity
WHERE ebeln = lv_ebeln.
it is going to looks like this:
And in the GW client, we can search for one PO:
This is the basics, hope that will be helpful. Thanks