首页 > SAP > ABAP > Single record read of a ODATA Service
2019
08-26

Single record read of a ODATA Service

In previous SAP Netweaver Gateway tutorials part1, part2, part3 and part4 we retrieved the list of Sales Orders. In this tutorial we are going to retrieve a particular Sales Order. We need to implement the method Get Entity (Read) of an OData service.

1. Go back to SEGW and choose the service name ZSL_EPM_DEMO.

2. Expand the service. Service Implementation → GetEntity(Read) → Right Click → Go to ABAP Workbench.

3. Find the method SALESORDERSET_GET_ENTITY in DPC (Data Provider Class) ZCL_ZSL_EPM_DEMO_EXT and click on Redefine to redefine the method.

4. Let’s have a look at the signature of the method.

IT_KEY_TAB – stores the all key values and its value of the request. In our entity type the key is “SoId” .

ER_ENTITY – this is the exporting structure in which we need to pass the sale-ale settingss order details.

5. Write the below code in the method SALESORDERSET_GET_ENTITY

6. Save and activate the method and then DPC extension class.
7. Go to SAP Netweaver Gateway Client /IWFND/GW_CLIENT to test the service. Enter the service name with sale-ale settingss order number like below and the Execute.

8. The result will look like below.

You have successfully implemented a Single Read in SAP Netweaver Gateway OData service.

Stay tuned to us for more SAP Netweaver Gateway tutorials.Please feel free to comment and let us know your feedback.

Thank you.

最后编辑:
作者:yangsen
有需要可在文章留言或者邮件yan252@163.com给我。