Exposing master data as ODATA service from S/4 HANA on-premise
The ABAP CDS views are present already in the S/4HANA on-premise waiting to be used up. The question is how to expose these CDS views from S/4HANA and consume as APIs in SAP BTP.
In this blog post I will try to explain the steps to identify and expose the ABAP CDS views from SAP S/4HANA on-premise, which can be later consumed as APIs in SAP Integration Suite.
In t-code SDDLAR (CDS Analysis and Repair Tools) in backend S/4HANA on-premise system, you can find other ABAP CDS views consuming the current view based on name.
Select the entity you want to expose.
Preview the Entity Data.
Display Data Structure
Check the DDL source with the name.
SEGW is the transaction to build a service in SAP.
CDS Entity – I_SalesOrganization
Finish CDS-Entity exposure
Create Transport Request for CDS Entity.
Model Provider Class and Data Provider Class are created.
Successful Service registration in SAP Gateway.
ODATA Service created successfully.
Activate the ODATA service in Service Catalog.
Keep this handy
Test service in browser
Now we can use this ServiceName by deploying the SAP Cloud Connector in S/4HANA on-premise and mapping this ServiceName as a source of service in the Cloud Connector.
Later we can consume this ServiceName as API in SAP BTP through the SAP Integration Suite.
Conclusion: There are pre-defined ABAP CDS views in S4/HANA on-premise which can be exposed as ODATA services to the outside world through SAP Cloud Connector, and can be consumed as APIs in SAP BTP for master data.
Please read through my other blog posts on master data.