With the rise of cloud architectures and self-analytics, everyone needs the data to be readily available for them to make their own insights. OData (Open Data Protocol) is one of the easiest ways to expose data that allows us to create and consume queryable and interoperable RESTful APIs in a simple and standard way.
In SAP, we can expose a different set of objects using the below approach. Currently, the exposable objects are as follows.
- ABAP CDS Views
- BW Models
- Data Sources
- HANA Views
In this blog, we will see how to expose BW Data sources to OData.
Go to T-Code SEGW, create a project with type “Service with SAP Annotations” and fill the necessary details.
A project is created with the structure shown below. Click on save the project.
Define the data model extraction type. In the context menu choose to Redefine a ODP Extraction.
In the Pop-up wizard, enter the required fields.
- Choose the RFC destination
- Choose the type of object (CDS Views, HANA Views, BW models & Data Sources)
- Add the objects that need to be exposed
- In this Wizard, all the fields are mostly filled based on the project name. You can change the Data model and Service name as per your naming standards.
- The system provides the entities that are available in the data sources. Select the ones that are needed and click on finish.
- Entities, Data model, and services are created and readily available in the project.
- Once the data model is generated, we need to create service runtime objects (ABAP Classes). Select the project in edit mode and click on the “Generate Runtime objects” icon shown below.
- All the objects generated are editable and we can change them.
- Once these objects are generated, the runtime objects are created in the below location.
- Once all the artifacts are created, we need to register the service that enables us to display HTTP responses that occur at runtime. Double click on the service to see the Registration Status.
- To register it, Select ‘Register’ in the context menu of the service and fill up the details.
- Once it’s enabled, the Registration Status is changed to ‘Green’.
- To test the data generated via OData, Go to SAP Gateway client and choose the Entity set that you want to see.
With the exposure of BW Data sources to OData, we can leverage the existing module-centric and generic data sources readily available for reporting or move the data to a lake and use if for Data science analysis. We can also implement OData with delta capabilities. Refer to this blog for more details.
Know more about Visual BI Solutions SAP BW Services offerings here.