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.

CDS%20Views%20for%20Sales

CDS Views for Sales

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.

Tcode: SDDLAR

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.

CDS%20Analysis%20and%20Repair%20Tools

CDS Analysis and Repair Tools

Select the entity you want to expose.

Display%20Entities

Display Entities

Preview the Entity Data.

Entity%20data%20preview

Entity data preview

Display Data Structure

Structure%20I_Customer_VH

Structure I_Customer_VH

Check the DDL source with the name.

DDL%20sources%20with%20name

DDL sources with name

Tcode: SEGW

SEGW is the transaction to build a service in SAP.

SAP%20Gateway%20Service%20Builder

SAP Gateway Service Builder

CDS Entity – I_SalesOrganization

CDS%20Entity

CDS Entity

Finish CDS-Entity exposure

CDS-Entity%20exposure

CDS-Entity exposure

Create Transport Request for CDS Enity.

Transport%20Request

Transport Request

Model Provider Class and Data Provider Class are created.

MPC%20and%20DPC

MPC and DPC

Successful Service registration in SAP Gateway.

Service%20Registration

Service Registration

ODATA Service created successfully.

Sevice%20created

Service created

Activate the ODATA service in Service Catalog.

Activate%20and%20Maintain%20Service

Activate and Maintain Service

Keep this handy

/sap/opu/odata/sap/KM_I_SALES_ORGANIZATION_SRV

Defined%20Services

Defined ServiceName

Test service in browser

Execute%20as%20XML

Execute as XML

Execute%20as%20JSON

Execute as JSON

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.

SAP%20Cloud%20Connector

SAP Cloud Connector

Later we can consume this ServiceName as API in SAP BTP through the SAP Integration Suite.

SAP%20Integration%20Suite

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.

Mapping different domains in SAP Master Data Governance to SAP S/4HANA processes

https://blogs.sap.com/2021/06/29/mapping-different-domains-in-sap-master-data-governance-to-sap-s-4hana-processes/

Understanding SAP MDG in a Traditional way

https://blogs.sap.com/2021/07/12/understanding-sap-mdg-in-a-traditional-way/

Using SAP BTP for Master Data Governance with Fiori Tiles

https://blogs.sap.com/2021/09/12/using-sap-btp-for-master-data-governance-with-fiori-tiles/

Simple steps to start RISE with SAP S/4HANA Cloud

https://blogs.sap.com/2021/09/22/simple-steps-to-start-rise-with-sap-s-4hana-cloud/

Demystifying One Domain Model w.r.t Master Data Objects

https://blogs.sap.com/2021/11/21/demystifying-one-domain-model-w.r.t-master-data-objects/

Data Journey from SAP MDM to SAP MDG

https://blogs.sap.com/2022/06/05/data-journey-from-sap-mdm-to-sap-mdg/