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 Redefine -> OPDExtraction from context menu.

    A screenshot of a data processing

AI-generated content may be incorrect.

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

    • RFC destination: None

    • ODP Context: BW/4 HANA

    • ODP Name: Select Info Objects

    A screenshot of a computer

AI-generated content may be incorrect.

  4. Click on Add ODP button & click Next

    A screenshot of a computer

AI-generated content may be incorrect.

    A screenshot of a computer

AI-generated content may be incorrect.

  5. Enter description for Model & Service and click Next

  6. Select all nodes and click Finish

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

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 AddSelected Services button. Screen returns to transaction /IWFND/MAINT_SERVICE

Select the newly added service and click on Add System Alias on bottom right

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

Click on SAP Gateway Client button on bottom left.

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.