Graph is a capability of API Management within SAP Integration Suite. With Graph, developers access business data as a single semantically connected data graph, spanning the suite of SAP products and beyond. Graph is a solution to unify your business APIs in the form of a semantically connected data graph, accessed via a single powerful API.
As part of SAP Integration Suite, Graph is compatible with SAP's Cloud Application Programming model (CAP) and with the range of SAP Build development solutions.
To use Graph in SAP BTP, a subscription for SAP Integration Suite
needs to be created in the SAP BTP Subaccount. It requires administrator authorization of SAP BTP.
-
In your SAP BTP subaccount, navigate to Services → Instances and Subscriptions in the left-hand pane. A new Instance or Subscription wizard opens.
-
Enter the basic information for your instance.
-
In the Service dropdown menu, select SAP Integration Suite.
-
In the Plan dropdown menu, select enterprise_agreement.
-
Choose Create.
Make sure to assign the Integration_Provisioner
role collection to the user.
- Select Go to Application for the Integration Suite application. The Integration Suite launchpad opens in new tab.
-
In the capabilities section, look for
Manage Capabilities/Add Capabilities
-
Ensure the Manage APIs capability is enabled.
- Enable
Graph
in the capabilities.
wait to have the Active
status.
-
Then log out of the Integration Suite application and switch back to the SAP BTP subaccount.
-
Assign the role collection to the user
-
Go to Users > Select user > Assign Role collection > select
- APIManagement.SelfService.Administrator
- AuthGroup.SelfService.Admin
- Graph.KeyUser
- GraphNavigation.Viewer > Assign Role collection.
- Log in back to Integration Suite Application, you should be able to see the
Graph
designer option in the menu.
A business data graph reflects the data entities within underlying business systems in a landscape.
- Select Graph under Design Artifacts in the left-side menu of the SAP Integration Suite interface.
- Choose Model Extensions tab and click on create from file.
- Give the name Logistics Partner and upload the file Logistics.custom.json from the config folder.
- Click on Create.
Logistics Partner model extension was created successfully and can now be used in a business data graph.
- Select Graph under Design Artifacts in the left-side menu of the SAP Integration Suite interface.
- Select Create from file in the panel
-
Select the configuration file and click Next.
-
The Business Data Configuration should look like this
{
"businessDataGraphIdentifier": "v1",
"description": "This business data graph includes APIs of SAP S/4HANA Cloud and SAP Sales Cloud",
"graphModelVersion": "^v3",
"schemaVersion": "1.2.0",
"extensions": [
"Logistics Partner"
],
"dataSources": [
{
"name": "s4",
"services": [
{
"destinationName": "xf_api_bupa",
"path": "sap/opu/odata/sap/API_BUSINESS_PARTNER"
}
]
},
{
"name": "c4c",
"services": [
{
"destinationName": "graph-c4c-dest"
}
]
},
{
"name": "my.custom",
"services": [
{
"destinationName": "logistics-partner"
}
],
"namespace": "my.custom"
}
],
"locatingPolicy": {
"cues": [],
"keyMapping": [
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.CorporateAccountCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
},
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.IndividualCustomerCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
}
],
"rules": [
{
"name": "sap.s4.*",
"leading": "s4",
"local": []
},
{
"name": "sap.c4c.*",
"leading": "c4c",
"local": []
},
{
"name": "sap.graph.*",
"leading": "s4",
"local": [
]
},
{
"name": "sap.graph.AppointmentActivity",
"leading": "c4c"
},
{
"name": "sap.graph.BusinessUser",
"leading": "c4c"
},
{
"name": "sap.graph.ClassificationCharacteristic",
"leading": "c4c"
},
{
"name": "sap.graph.ClassificationClass",
"leading": "c4c"
},
{
"name": "sap.graph.Company",
"leading": "c4c"
},
{
"name": "sap.graph.ContactPerson",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.CorporateAccount",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.Country",
"leading": "c4c"
},
{
"name": "sap.graph.Currency",
"leading": "c4c"
},
{
"name": "sap.graph.Customer",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.CustomerGroup",
"leading": "c4c"
},
{
"name": "sap.graph.DistributionChannel",
"leading": "c4c"
},
{
"name": "sap.graph.Division",
"leading": "c4c"
},
{
"name": "sap.graph.Equipment",
"leading": "c4c"
},
{
"name": "sap.graph.FunctionalLocation",
"leading": "c4c"
},
{
"name": "sap.graph.IncotermsClassification",
"leading": "c4c"
},
{
"name": "sap.graph.IndividualCustomer",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.IndustrySector",
"leading": "c4c"
},
{
"name": "sap.graph.Job",
"leading": "c4c"
},
{
"name": "sap.graph.Language",
"leading": "c4c"
},
{
"name": "sap.graph.MeasurementDocument",
"leading": "c4c"
},
{
"name": "sap.graph.MeasurementPoint",
"leading": "c4c"
},
{
"name": "sap.graph.PersonMaritalStatus",
"leading": "c4c"
},
{
"name": "sap.graph.PersonTitle",
"leading": "c4c"
},
{
"name": "sap.graph.PhoneCallActivity",
"leading": "c4c"
},
{
"name": "sap.graph.Product",
"leading": "c4c"
},
{
"name": "sap.graph.ProductCategory",
"leading": "c4c"
},
{
"name": "sap.graph.ProductCategoryHierarchy",
"leading": "c4c"
},
{
"name": "sap.graph.ProductType",
"leading": "c4c"
},
{
"name": "sap.graph.SalesContract",
"leading": "c4c"
},
{
"name": "sap.graph.SalesDocumentCancellationReason",
"leading": "c4c"
},
{
"name": "sap.graph.SalesDocumentReason",
"leading": "c4c"
},
{
"name": "sap.graph.SalesLead",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOpportunity",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOrder",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOrganization",
"leading": "c4c"
},
{
"name": "sap.graph.SalesPricingConditionType",
"leading": "c4c"
},
{
"name": "sap.graph.SalesQuote",
"leading": "c4c"
},
{
"name": "sap.graph.SalesRoute",
"leading": "c4c"
},
{
"name": "sap.graph.SalesVisit",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceDocumentPriority",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceRequest",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceRequestType",
"leading": "c4c"
},
{
"name": "sap.graph.TaskActivity",
"leading": "c4c"
},
{
"name": "sap.graph.TimeSheet",
"leading": "c4c"
},
{
"name": "sap.graph.TimeZone",
"leading": "c4c"
},
{
"name": "sap.graph.WorkAssignment",
"leading": "c4c"
},
{
"name": "my.custom.*",
"leading": "my.custom"
},
{
"name": "custom.ns.Logistics",
"leading": "my.custom",
"local": []
},
{
"name": "custom.ns.Logistics",
"leading": "s4",
"local": [],
"sourceEntity": "sap.s4.A_BusinessPartner"
}
]
}
}
Click on Create.
See Configuration File in the SAP Graph documentation.
- Wait for status to update to Available.
The status goes from Processing > Offline > Available.
You just created your business data graph. Wouldn't it be cool to explore semantic connections between the data entitites and even try out a few oData queries on the real data in the business system ? You can do exactly that using Graph Navigator within API Business Hub Enterprise !
This section takes you through exploring the business data graph created in previous section using the Graph Navigator tool.
- Open the Graph Navigator tool in API Business Hub Enterprise by selecting the menu icon Graph Navigator in the top panel.
- The Graph Navigator tool automatically lists all the business data graphs in your SAP BTP subaccount. Select the business data graph v1 you previously created.
- On the left, in the Entities index, you see a search window and collection of available entities, grouped per namespace.
- Explore the entities to check Schema and use the Try Out feature to make oData requests.
Play around with the navigator.
In order for the client application to be able to consume newly created business data graph, they require Graph service credentials. In this section you will create the Graph service instance and service bindings.
-
In your SAP BTP subaccount, navigate to Services → Instances and Subscriptions in the left-hand pane. A new Instance or Subscription wizard opens.
-
Enter the basic information for your instance.
-
In the Service dropdown menu, select SAP Graph.
-
In the Plan dropdown menu, select api.
-
In the Instance Name field, enter a name for your instance.
-
Choose Create.
- Create a new service key for your SAP Graph instance.
- Download the service key file.
Maintain the Graph API in the URL (for example, https://xxxx.graph.sap/api/v1
). This is the URL that you received after activation of graph configuration in the previous step. Refer to Graph's service key to fill in the values for Client ID and Client Secret. The Token Service URL value is derived by suffixing the URL mentioned in service key with /oauth/token
.
Use the Graph API to configure the destinations with:
- OAuth2JWTBearer Authentication:
1.1. In the SAP BTP cockpit, go to your global account and navigate to your subaccount.
1.2. Choose Connectivity in the menu on the left, and then choose Destinations > New Destination.
1.3. Create the Destination Configuration using the details from Service key of the SAP Graph instance:
- OAuth2ClientCredential Authentication:
Hint:
Check Connection
button for the created destination gives the response401:Unauthorised
. This is expected. It will be resolved when the application forwards the JWT token.