cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Accessing SAP Graph OData V4 through SAP Cloud Integration (CPI)

Aishwarya_Pola
Discoverer
462

Introduction

This blog explains how to access an SAP Graph OData V4 URL using SAP Cloud Integration (CPI). We will configure the connection, use OAuth 2.0 Client Credentials, and query data using OData parameters.

What is SAP Graph?

SAP Graph is a unified API that provides a simplified, single interface to access data across various SAP systems (like SAP S/4HANA, SAP SuccessFactors, SAP Sales Cloud, etc.). It helps developers interact with complex SAP systems using a consistent API structure, making integration and data access easier.

Prerequisites

  • Access to SAP BTP with an SAP Graph instance.

  • OAuth 2.0 Client Credentials for SAP Graph.

  • SAP CPI with design privileges.

Step 1: Create OAuth 2.0 Credentials

  1. In SAP BTP Cockpit, navigate to your SAP Graph instance.

  2. Go to Security and create OAuth 2.0 client credentials.

  3. Note the Client ID and Client Secret.

  4. Save the credentials in Security Material of CPI as a new OAuth2 Client Credentials artifact (e.g., Credential Name: GraphOAuthCredentials).

Step 2: Get the SAP Graph URL

  1. In SAP Integration Suite, navigate to the Design section.

  2. Inside Business Data Graph, you can find the OData V4 URL for your SAP Graph instance.

  3. Copy the OData V4 URL (e.g., https://<your-graph-url>/graph/api/graphdemo).

Step 3: Configure OData Connection in CPI

  1. Log in to SAP CPI, go to Design, and create an Integration Flow.

  2. Add a Start Timer and a Request Reply step.

Aishwarya_Pola_0-1746610838349.png

    3. Set connection details:

  • Address: https://<your-graph-url>/graph/api/graphdemo/sap.s4

  • Authentication: OAuth2 Client Credentials

  • Credential Name: GraphOAuthCredentials

 

Step 4: Set the Resource Path

Aishwarya_Pola_1-1746611173389.png

 

  • Resource Path: A_SalesOrder

  • Query: $select=SalesOrder,SoldToParty&$filter=SalesOrder eq '1'&$expand=_SoldToParty

Step 5: Deploy and Test

  1. Deploy the integration flow.

  2. Monitor message processing to verify the response.

Conclusion

You have successfully configured SAP CPI to access SAP Graph OData V4 using OAuth 2.0 authentication.

Accepted Solutions (0)

Answers (0)