Skip to main content

Building an ODATA Service

Throughout this documentation, you will model an OData service, deploy and test it and finally consume it by an appli- cation running on JustPerform Cloud.

Note: All objects are saved in the local package $TMP in this example.

Create OData Services Using ODP (Extract Data Sources)

Creating RFC Destination

Tcode : SM59 , Create RFC Destination  with connection type :3

Create ODATA Service for BW/4 HANA

Create Project & Service

  1. Go to transaction SEGW, and create a new project by clicking on the New button.

  2. Enter the project Name and description

  3. Expand Project and select Redene->OPDExtraction from context menu.

    A three-step wizard opens, input the following in step-1:

      • RFC destination: None

      • ODP Context: BW/4 HANA

      • ODP Name: Select Info Object 

  4. Click on Add ODP button & click Next

    A screenshot of a computer

AI-generated content may be incorrect.

  5. Enter description for Model & Service and click Next

    BUILDING AN ODATA SERVICE_6.png

  6. Select all nodes and clickFinish.

    Model (prefix _MDL) & service (prefix _SRV) names are pre populated.

    BUILDING AN ODATA SERVICE_7.png

Service Maintenance & Activating Odata Services

Go to transaction /IWFND/MAINT_SERVICE and click Add Service

Enter System Alias as LOCAL and click on Get Services button

Search the generated service (in this case ZBW_ODP_ODATA_SRV) and click on AddSelectedServices button. Screen returns to transaction /IWFND/MAINT_SERVICE

Selectthenewlyaddedserviceandclick onAdd System Aliasonbottom right

A pop-up appears with prelled alias details, click Save to save the system alias.

ClickonSAP Gateway Client buttononbottomleft.

A new screen of gateway client opens. With relative path of service URL prepopulated.

Click on Execute button, to run the service and the response appears with status code 200 if there are no errors. Also click on EntitySets button on top to view list of entities within the service.

To view the complete metadata of the service, use the url http://<server>:<port>/sap/opu/odata/sap/<service name>/$metadata

Activating OData Services

To activate OData services, proceed as follows.

  1. Call transaction SICF.

  2. Skip filter selection screen by clicking Execute(or press F8).

  3. Navigate to tree node default_host sap opu OData to activate all OData (V2) services. Alternatively, to activate an individual service, navigate to the corresponding node deeper in the tree.

Right-click on the OData service node and select Activate Service from the context menu to activate all OData services.

 

 

Was this article helpful?

We're sorry to hear that.