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.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on1.jpg?resize=730%2C329&ssl=1)
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.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on2.png?resize=730%2C451&ssl=1)
Select the entity you want to expose.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on3.png?resize=511%2C248&ssl=1)
Preview the Entity Data.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on4.png?resize=730%2C380&ssl=1)
Display Data Structure
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on5.png?resize=730%2C133&ssl=1)
Check the DDL source with the name.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on6.png?resize=696%2C519&ssl=1)
Tcode: SEGW
SEGW is the transaction to build a service in SAP.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on7.png?resize=612%2C366&ssl=1)
CDS Entity – I_SalesOrganization
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on8.png?resize=730%2C306&ssl=1)
Finish CDS-Entity exposure
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on9.png?resize=730%2C294&ssl=1)
Create Transport Request for CDS Enity.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on10.png?resize=730%2C230&ssl=1)
Model Provider Class and Data Provider Class are created.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on11.png?resize=665%2C457&ssl=1)
Successful Service registration in SAP Gateway.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on12.png?resize=730%2C226&ssl=1)
ODATA Service created successfully.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on13.png?resize=730%2C343&ssl=1)
Activate the ODATA service in Service Catalog.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on14.png?resize=730%2C240&ssl=1)
Keep this handy
/sap/opu/odata/sap/KM_I_SALES_ORGANIZATION_SRV
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on15.png?resize=730%2C330&ssl=1)
Test service in browser
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on16.png?resize=730%2C248&ssl=1)
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on17.png?resize=730%2C298&ssl=1)
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on18.png?resize=730%2C277&ssl=1)
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on19.png?resize=730%2C110&ssl=1)
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.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on20.jpg?resize=730%2C322&ssl=1)
Later we can consume this ServiceName as API in SAP BTP through the SAP Integration Suite.
![](https://i0.wp.com/www.erpqna.com/wp-content/uploads/on21.jpg?resize=730%2C227&ssl=1)