Skip to content

SAP Odata Views

URLs

Environment URL
PROD hyg002.groepheylen.be:50000/sap/opu/odata/sap/
DEV hyg007.groepheylen.be:50000/sap/opu/odata/sap/

Authentication

Basic authentication, same user/password as SAP GUI.

SVC_POWERBI

Services

ENTITY Relative Path
BUSINESS ENTITY ZZI_REBUSINESSENTITY_CDS/ZZI_REBUSINESSENTITY
COST CENTER ZZC_CostCenter_CDS/ZZC_CostCenter
PROPERTY ZZI_REPROPERTY_CDS/ZZI_REPROPERTY
RENTALOBJECT ZZI_RERENTALOBJECT_CDS/ZZI_RERENTALOBJECT
CONTRACT ZZI_RECONTRACT_CDS/ZZI_RECONTRACT
CONTRACT VALUATION ZZC_RECONTRACTVALUATION_CDS/ZZC_RECONTRACTVALUATION
BUILDING ZZI_REBUILDING_CDS/ZZI_REBUILDING
MEASUREMENT ZZI_REMEASUREMENT_CDS/ZZI_REMEASUREMENT
MEASUREMENT TYPE ZZI_REMEASUREMENTTYPE_CDS/ZZI_REMEASUREMENTTYPE
MEASUREMENT TYPE TEXT ZZI_REMEASUREMENTTYPETEXT_CDS/ZZI_REMEASUREMENTTYPETEXT
INVOICE ZZI_REINVOICEHEADER_CDS/ZZI_REINVOICEHEADER

Format

The standard format is XML.

To get JSON, add $format=json to the URL.

Note, however, that the JSON format is not typed. Everything is returned as string, with the dates using the old Microsoft format (e.g. /Date(1598918400000)/).

SAP Documentation

https://api.sap.com/

Examples

  1. http://hyg007.groepheylen.be:50000/sap/opu/odata/sap/ZZI_RERENTALOBJECT_CDS/ZZI_RERENTALOBJECT

  2. http://hyg002.groepheylen.be:50001/sap/opu/odata/sap/ZZI_RECONTRACT_CDS/ZZI_RECONTRACT?$format=json

  3. http://hyg007.groepheylen.be:50000/sap/opu/odata/sap/ZZI_REBUILDING_CDS/ZZI_REBUILDING/$count

How to add data to our DWH

The process is as follows:

  1. identify a view that contains your data

  2. ask the SAP Implementation partner to create a view on top of it

  3. access the view

Identify the view

There are multiple ways to identify the view. You can ask GitHub Copilot, or you can query Fiori. But the one that works typically best for us is this:

  1. log into RDP for #hey

  2. open Eclipse and go to the search tab

  3. search for the object (you can use wildcards like * )

  4. double-click the Object

  5. make sure the tree is linked
    sap-odata-views.png

  6. right-click the object

  7. open with data preview

  8. you can now inspect the data and decide if this is the right data
    sap-odata-views-1.png

Ask SAP-Company for help

Typically, the C_ and I_ views by SAP are not published as OData views. So you need to ask an SAP Developer to publish the view.

In SAP, it is common to create simple view on top of existing views.

  1. typically, the view name is prefixed with Z or ZZ

  2. it is stored in a package, whose name is typically also prefixed with Z

  3. it is tagged with the OData tag, which will make sure it is automatically published

sap-odata-views-z.png

Access the view data

Once the SAP developer says he has published the view, you can test it. There are two ways:

  1. in the browser, in RDP

  2. in postman, using ngrok

Test the view in the browser in RDP

  1. in SAP GUI, go to transaction /iwfnd/maint_service

  2. search for the view

  3. double-click

  4. select 'Call Browser'

  5. This will show the service. Copy it to the clipboard
    sap-odata-views-service.png

  6. open Chrome and paste the service. This will show the endpoint

  7. identify the endpoint and add it to the service, this will give you access to the data
    sap-odata-views-endpoint.png

Test the view in Postman

In the previous method, you identified the endpoint. You can now inspect the data in postman. Proceed like this:

  1. in RDP, start ngrok (see 1pw for details) on the right environment (hyg002 for prod, hyg007 for dev)
    sap-odata-views-ngrok.png

  2. on your computer, start postman

  3. change the base URL in postman
    sap-odata-views-postman.png