Part 5: Use SAP Graph with your own data
INFO: This blog is part of a tutorial series for the standalone SAP Graph service on SAP BTP. Recently, SAP released a version of Graph in SAP Integration Suite with better user experience and functional enhancements (see this blog for details: https://blogs.sap.com/2023/02/22/announcing-graph-in-sap-integration-suite).
This is the fifth part of our tutorial series on SAP Graph, the new API for connecting to your business data. Earlier parts of the SAP Graph tutorial focused on and addressed a developer. In this part we address you, a person with an IT administrative role and responsibilities for enterprise data.
Please refer to part 1 for an introduction to SAP Graph, and to the information map for an overview of the entire tutorial series. As we learned in part 3, a developer requires the details of a business data graph to access the enterprise data of interest. But how is this business data graph established?
The answer to this question will be provided here in part 5 and in the next part (construction of an SAP Graph Business Data Graph). In your role as an enterprise administrator, your focus is on the technical configuration related to the establishment of secure access to your landscape data.
As always, you can find all the details for what we are going to discuss here in the SAP Graph documentation, on the SAP Help Portal.
The SAP Business Technology Platform (SAP BTP)
Enterprises and other companies deploy a variety of business software solutions to manage their major business processes. We refer to these software systems as data sources, and to the collection of data sources as the landscape. As we shall see, the business data graph is a connected graph of the business data in your landscape.
Enabling access to a landscape involves a great many concerns, related to connectivity, user management, trust, and other security topics. Establishing these aspects is exactly the role of SAP’s Business Technology Platform (SAP BTP), available on multiple cloud infrastructure providers. As an owner of data sources, you use the SAP BTP cockpit as the central point of entry, where you can access your accounts manage all activities associated with them.
SAP Graph requires capabilities that are currently not offered in SAP BTP trial accounts. To configure SAP Graph and create a business data graph, you will need an SAP BTP global enterprise account with a consumption-based commercial model, for which you must have administrative rights.
If you don’t already have access to such an account, getting started with SAP BTP is fortunately now easier than ever. Simply register for an account online, using the Pay-As-You-Go solution for SAP BTP on the SAP Store, starting here. You can obtain an enterprise account as an individual by identifying with a credit card, or as a company.
We will only use free services to configure SAP Graph, which will not cause a credit charge. Upon completion of this registration process, you will receive an email with your account information and a link to your global account in the SAP BTP Cockpit, typically within one workday.
Configuring SAP Graph
If you are not familiar with the SAP BTP cockpit, there are many blogs, videos and tutorials (like this one) to make you feel at home. Here we will assume some familiarity with the SAP BTP Cockpit to apply the following process:
- Create a subaccount, which represents your landscape
- Set up destinations to the data sources of your landscape
- Create an instance of the SAP Graph service, to use the landscape
- Assign yourself the key-user role, to create a SAP Graph business data graph
Step 1: Create a subaccount
Use the SAP BTP cockpit to login to your “global” account. Create a subaccount:
- Enter the subaccount display name, for instance SAP Graph Sandbox (this will also fill the subdomain field with a unique string)
- Set Region to Europe (Frankfurt) under Amazon Web Services (CF-EU10).
Click Create; wait until the subaccount is created.
Next, enter the subaccount by clicking on its tile, select Entitlements from the left-side menu, click Configure Entitlements and then Add Service Plans, search for SAP Graph, check the free plan, and confirm by clicking the Add 1 Service Plan button. Don’t forget to click Save.
Step 2: Create destinations
In this tutorial, we will use the SAP API Business Hub sandbox systems as data sources. Note that creating destinations to other data sources is often more complex, due to trust establishment. Refer to the SAP Graph documentation for more information.
Within the same subaccount, select Connectivity / Destinations from the left-side menu and click New Destination, as follows:
Fill in the form as follows to create a destination to the SAP CX Sales Cloud sandbox system:
Use cxsalescloud as the name and https://sandbox.api.sap.com/sap/c4c/odata/v1/c4codataapi/ as the URL.
Since the sandbox APIs require an API key in HTTP headers, we will add this header. Click New Property, then enter URL.headers.apiKey as property name and enter your unique API key from the API business Hub (see part 2 of this series for instructions) as the value. Then Save.
You can easily repeat this process to create additional destinations, by cloning this destination, and changing the Name and URL fields. Go ahead, and add another destination named s4product, with the following URL: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_PRODUCT_SRV
Here are additional useful API services to consider:
- SAP SuccessFactors: https://sandbox.api.sap.com/successfactors/odata/v2
- SAP S/4HANA Business Partner: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER
- SAP S/4HANA Sales Order: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_SALES_ORDER_SRV
Step 3: Create an SAP Graph Service Instance
Within the same subaccount, select Services / Instances and Subscriptions from the left-side menu, and then click Create in the top-right corner.
In the wizard:
- Select SAP Graph from the drop-down service menu.
- Select the free service plan.
- Leave Other as runtime environment.
- Enter an instance name, e.g., sapgraph1. Choose Create.
- Click the three dots to the right of the created instance and select Create Service Binding
- Download and save the created credentials as a text file:
Step 4: Become a key user
Within the same subaccount:
- Select Security / Role Collections from the left-side menu, and then click on the + symbol (New Role Collection).
- Enter SAP Graph key user as name and Create.
- Select the role collection you just created and click Edit.
- Click inside the Role Name box and then select sap-graph in the Application Identifier
- Check the SAP_Graph_Key_User role. Click Add.
- Don’t forget to Save your changes.
- Go back to the subaccount view, select Security / Users from the left-side menu, select your username, then click on Assign Role Collection on the right-hand pane, check the SAP Graph key user role collection and confirm by clicking Assign Role Collection.
Done! You have specified the landscape to be used for SAP Graph and promoted yourself as SAP Graph key user.
The four steps above complete the configuration of the landscape and the preparations for creating a business data graph for your developers. The final step is to create the business data graph itself – this will be the topic of part 6 of this tutorial series.
Chaim Bendelac, VP Product, SAP Graph