There is a way to integrate SAP Analytics Cloud with SAP Sustainability Control Tower for real-time data access and dynamic visualization by establishing a live connection. This currently only supports greenhouse gas (GHG) emissions data. For more information on how to do that, you can have a look at the SAP Help for SAP Sustainability Control Tower Integrations here: SAP Analytics Cloud Integration
In addition to that, SAP Sustainability Control Tower offers APIs as another way to replicate data from your source systems into SAP Sustainability Control Tower, or to replicate data from SAP Sustainability Control Tower to your systems.
The main focus of this blog, is to help anyone out there who is looking to connect SAP Sustainability Control Tower to SAP Analytics Cloud via APIs for data replication.
Let's do this! ...in 3 parts:
Setting up what is needed in your Subaccount in the SAP BTP Cockpit
First, you need to go into your SAP BTP Cockpit and find the Subaccount you have set up for using SAP Sustainability Control Tower.
Check there to see if you have already enabled Cloud Foundry.
If not, you'll see a button to Enable Cloud Foundry:
When you click to Enable Cloud Foundry, a popup will come up, and you'll just have to click on Create:
After that is done, you'll need to create a Space. To do that, click on Create Space:
In the popup that will come up, give it a Space Name and click to Create:
Next, click on Entitlements on the menu in the left side of your screen.
Check in that list for the SAP Sustainability Control Tower service and verify if you already have the service sct-service-api with the standard plan listed there:
If it's there, you can skip this next step.
If it's not there, proceed to add this by clicking on Edit on the top right side of your screen. That will enable a new button to Add Service Plans. Click to Add Service Plans, and you'll get the popup below:
Type in "control" in the search box, which will result in finding the service SAP Sustainability Control Tower.
Click on SAP Sustainability Control Tower, and that will display the Available Plans on the right.
Click to check the checkbox for standard - SAP Sustainability Control Tower service broker (API).
Click on the right bottom corner to Add 1 Service Plan.
When back in the Entitlements list, click on the top right of your screen to Save.
Now, you should be able to find the service in the list:
Next, click on Instances and Subscriptions on the left menu:
On the top right corner, you'll find the button to Create, click on that button.
In the dropdown to Select service, find SAP Sustainability Control Tower sct-service-api:
In the dropdown to select a Plan, select standard under Instances:
Give it an Instance Name, and click on Create:
You should now be seeing 1 Instance and 1 Environment together with your 1 Subscription in the Instances and Subscriptions screen:
Next, click on the Instance, to see its details:
Click on the Create button to create a Service Key.
In the popup, give it a Service Key Name and click to Create:
This is the end of the steps in the SAP BTP Cockpit, but don't close it just yet, as we'll need to come back here to check the JSON code of the Service Key for the Cliend ID and Client Secret.
Testing of the API in the SAP Business Accelerator Hub
Now, let's go to the SAP Business Accelerator Hub (https://api.sap.com/) to check if this is working!
Search for sustainability control tower:
In the search results, click on the ODATA V4 API Get Sustainability Metrics.
Once in the Get Sustainability Metrics API, click on Try Out:
Then, on the left menu, select a metric for which you have data in SAP Sustainability Control Tower.
In this example, I will select Environmental Metrics and then GET /GhgEmissions:
Now, click on Select Environment on the top right corner of your screen and choose to Add New Environment:
In the popup to Configure New Environment.
Give it a Display Name, and then you'll need to fill in Cliend ID and Client Secret:
This is where you need to go back to the SAP BTP Cockpit, and look at the details of the Service Key.
For that, you need to click the name of your Service Key, that is a link that will show you more details:
When you click that name of the Service Key which is a link, a popup will appear with the JSON code and in that code you'll find Client ID and Client Secret in the lines highlighted in green below:
Copy the lines in green, one at a time, to fill in the Client ID and Client Secret in the Configure New Environment popup back in the SAP Business Accelerator Hub to test the API.
Keep the SAP BTP Cockpit open, as we'll need to come back here to get a URL from this same JSON code again when configuring the connection in SAP Analytics Cloud.
Then, fill in the Landscape and Subdomain from your SCT tenant URL:
Last, click the checkbox to Apply and select the Save this environment for future sessions option.
Click to Configure:
When you click on Configure, it may take a while for the screen to react, no need to click on Configure again, just wait a little bit.
To test this, click on the Run button on the top right side of your screen:
You should get something like this:
If you get results like this to show up, this means the connection is working!
Alright, time to go to SAP Analytics Cloud...
Configuring the connection in SAP Analytics Cloud
In SAP Analytics Cloud, go to Connections, you can find it on the left menu, almost at the bottom:
Click on the "+" option on the top right corner:
Type "odata" in the search, to find OData Services:
Click on OData Services and the below popup will appear:
Start by entering a Connection Name.
To fill in the Data Service URL, you'll need to go back to the SAP BTP Cockpit one last time, and in the JSON code of the Service Key, you'll find a URL which ends with "sustainabilityMetrics":
As Authentication Type, select OAuth 2.0 Client Credentials.
By now, you already know where to find the OAuth Client ID and Secret again, in the JSON of your Service Key in the SAP BTP Cockpit.
For the Token URL, you'll have to go back to the SAP Business Accelerator Hub, search for "control tower", find the ODATA V4 API called Get Sustainability Metrics, go into it and then click to Try Out. Or... you can try this direct link: https://api.sap.com/api/SustainabilityMetrics/tryout
Once you are there, you'll have to click on Select Environment, and next to the name of your Environment, there will be a pencil button you can click to check its details. In that popup you'll find the Token URL:
Copy the Token URL and paste it in the New OData Services Connection popup in SAP Analytics Cloud and after that you can click on the Create button.
Now your new Connection should show up in the Connections list in SAP Analytics Cloud.
Next, go to the Modeler, you can find it as a little cube icon on the left menu:
Click on Model, to create a new model, and a popup will appear:
Leave it with Start with Data selected and click Next.
Type in odata, to search for OData Services:
Click on OData Services and then you'll have to select a Connection.
In the dropdown to select a connection, you should find your new connection:
Click Next and then you'll have to set up a New Query for OData Services:
In this example, we're still considering you have data for emissions, so you can search for ghg and select GhgEmissions, for example:
After you click Next, you'll need to select data and filters.
You can drag and drop the GhgEmissions to the Selected Data:
After you click on Next, the below popup will appear with a Batch Size.
You can leave that as is and click to Create:
Your new model will show up, and you'll need to click on the disk in the top menu under General, to Save it.
A popup will appear where you can just click Save:
Now you can use the data in SAP Analytics Cloud!!!
Let's give it a quick try... for example, creating a story.
Go to the left menu and click the icon that looks like a chart for Stories:
Next, click on the big button to create a new Canvas.
A popup will appear where you can just click to Create:
Now you can drag and drop a Chart from the left Widgets menu into the main content section of your New Story. When you do that, a popup will appear to Select Dataset or Model:
Click on the name of your model to select it.
Next, on the right menu, you can select Measures and Dimensions:
In this example, let's select for Measures, the measure QUANTITY and for Dimensions, the dimension BUSINESSLOCATIONID.
Finally, you get a Chart in your New Story in SAP Analytics Cloud with your SAP Sustainability Control Tower data!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.