Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Overcoming Data Integration Challenges: Introducing SAP Graph as a Unified Solution for Multiple Business Systems
Business Problem -- You got multiple business systems for example SAP S/4 HANA Cloud / SAP SuccessFactors / SAP S/4 HANA System on Premise but bringing data from these systems using one Unified service is a challenge but that Change got a beautiful solution and that is SAP Graph
SAP Graph -- "Streamlining functionality, we provide developers with a single connected and unified view of all their business data through a single endpoint for all purposes."
Resources for learning:
Thank you SAP HANA Academy for such a great Youtube Series on SAP Graph please follow it for building your solutions end-2-end.
SAP graph Free tier Services ( Check SAP Discovery Center for more detail )
Create Graph instance and Key Service Key ( Download and Save it )
Graph Instance parameters - ( Download and save it ) More details on HANA Academy GitHub - > SAP Graph
Go to PowerShell or VS Code and install graphctl tool for graph connect
Setup Graph Environment:
Get your free tier service from SAP Discovery center and add the entitlement in your BTP Subaccount
Download your graph key and store it somewhere in your system ( I will not go into detail as there are already few blogs and series on how to set it up but this is needed for start hence adding it for connect)
Sandbox API Destination Configuration:
Get your API Key and API url from SAP' API Sandbox system.
"The graph is now operational and ready to serve. Please generate your service keys on the graph instance and proceed to test the graph API".
We are pleased to inform you that sap.graph is successfully serving the Cloud for Customer entities. You have the flexibility to select any entity and seamlessly integrate or link it directly to your application. This exemplifies the power of SAP Graph - an incredible technology that yields remarkable results.
"Graph Environment Setup: Integration with SAP Graph and SAP CX Sales Cloud APIs, Business Data Graph Generation, and Successful Testing of Graph APIs in POSTMAN Client"
Congratulations on your successful setup of the graph environment! It's great to hear that you have successfully integrated SAP Graph with SAP CX Sales Cloud APIs. Additionally, generating a business Data Graph for consumption and conducting successful tests of the Graph APIs in the POSTMAN client demonstrate significant progress. Well done!
Part 2: CAP Wrapper for Graph API:
Architecture
"The architecture diagram illustrates the connection of two business systems to SAP Graph. SAP Graph is exposed as an endpoint (referred to as a destination in the Business Technology Platform), and a CAP App consumes that destination to access and expose the business data."
What all we need ?
Node in your VS Code / BAS
Destination for Graph endpoint in BTP Cockpit
Authentication , Destination and connectivity services in CAP
Create Destination in BTP Cockpit
Obtain the Client ID and secret from the Graph Service Key file.
Log in to the BTP Cockpit.
Navigate to the "Destinations".
Click on "New Destination" .
Provide a name for the destination (e.g., "SAP Graph API").
Fill in the required details, such as the URL endpoint of the SAP Graph API.
In the "Authentication" section, select the appropriate authentication method (e.g., OAuth2 Client Credentials).
Enter the Client ID and secret obtained from the Graph Service Key file in the respective fields.
Add sales.cds file in srv folder and add the below snippet , I have created on function import which will be returning the dynamically generated results from SAP Graph API.
@protocol: 'rest'
service root {
@open
type object {};
function graph(name:String) returns array of object;
}
Add sale.js file in srv folder
const get = require("./handlers/GET/getSales");
module.exports = cds.service.impl(async function () {
this.on("graph", get.graph);
});