Technology Blogs by Members
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!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris_Tam
Explorer
3,597
Collecting ESG data within SAP Datasphere (DSP) and then calculating their GHG values with global emission factors has been a pretty smooth process. But collating and publishing those measures into SAP Sustainability Control Tower (SCT) has been way more onerous. With the new Datasphere Integration feature in the latest SCT release 2023-09-06, my life just became easier!

Here are some pointers on getting this running.

Datasphere transport tables and views from the Content Network


The first step was to grab the 'SAP Sustainability Control Tower Integration' content package from DSP's Content Network under the Business Content tile.
You will need to create a DSP space with Space Id = 'SAP_SCT' beforehand as this is where the content will import to


Integration Business Content from DSP Content Network


This package gave me the local tables for transporting my ESG calculations into SCT's DPI format, and the associated views for Emissions, People, Water withdrawal, etc., which SCT uses when pulling in the new data.

Datasphere OAuth credentials used by SCT


While still in DSP, create an OAuth client that SCT uses to fetch data from DSP. In DSP, under System | Administration | App Integration, create the following client in the OAuth Clients section:


Create OAuth client from DSP




  • Select Interactive Usage and API Access for the Purpose

  • Under Access, you will need to add Data Export Service

  • For the Redirect URI, it will be the root of your SCT application plus /launchpad#DataCollectionProcess-generateRefreshToken added to the end


Take note of the OAuth Client ID, Secret and Token URL as it is needed by the SCT application later

Configuring SAP BTP Cockpit


Now, head over to SAP BTP Cockpit and create a new destination for SCT using the OAuth connection above. From the Subaccount where your SCT application is running, create a destination:


Create destination from SCT Subaccount




  • Name the destination SAP_SCT_DATASPHERE (do not change this as SCT looks for this destination by name)

  • The Type will by HTTP, Proxy Type is Internet, Authentication is OAuth2RefreshToken, and check on Use default JDK truststore

  • For the URL, it will be the root of your DSP application plus /dwaas-core/odata/v4/consumption/relational/SAP_SCT/ added to the end

  • The Client ID, Client Secret and Token Service URL will be what you copied down from the section above


A word of warning here, if you "Check availability.." on this new destination, you will get a "401: Unauthorized" error. That's okay, the DSP URL is just a fragment and that warning is expected

And with that, you should be all set! SCT should now have the ability to pull data from the "Manage ESG Data" tile where you can find the Import from SAP Datasphere option.


Import from SAP Datasphere in SCT


The rest is simply following the UI to import, validate and publish the DSP data into SCT. So far, this import only supports new records and will warn of duplicate rows that are already in the SCT system. More info on this feature and it's limitations, can be found in the SCT help under the section 'Importing New Data from SAP Datasphere'.

Final thoughts


As I experimented through this new feature, these are some customizations I made for my use cases:

Customizing Business Content's DPI Views


To reduce the amount of data replication, I modified the DPI View's SQL statement to select directly from my existing ESG tables. As long as I maintained the view's dimension names and data types, I removed the need for copying data the provided local tables.

Configuring integration for different DSP spaces


One of the limitations of the Content Network is the hardcoded space that the tables and views get imported to (above, that is SAP_SCT). However, when configuring the destinations in BTP cockpit, you can see where the DSP space is specified. Once I copied the DPI views into my existing ESG spaces, I could change the URL to use those spaces instead. For example:

https://<my DSP system>/dwaas-core/odata/v4/consumption/relational/SAP_SCT/

to:


https://<my DSP system>/dwaas-core/odata/v4/consumption/relational/<my existing ESG space>/

With the flexibility in the DPI views and ability to connect to different DSP spaces, this allows me to manage multiple sets of ESG data and orchestrate the promotion of incremental ESG data from staging to production with ease.

Looking forward to the future integrations!
16 Comments
MelanieBurk
Discoverer
0 Kudos
Hi Chris,

Many thanks for your article! Very helpful.

I set-up the interface between SCT and Datasphere now, but unfortunately I cannot import the business content data from DSP into SCT. The import buttons in SCT Manage ESG Data app are greyed out:


Manage ESG Data App


I suppose, I am missing some roles. The recommended roles for the Manage ESG App are already assigned to my user ( SUS_SCT_Manage_ESG_Data_Administrator,  SUS_SCT_Manage_ESG_Data_Manager, SUS_SCT_Manage_ESG_Data_Viewer). Anything I miss here?

Thanks and BR

Melanie
MelanieBurk
Discoverer
0 Kudos
Update:

After selecting a measure from the list, the buttons are enabled and data can be imported.
m_westingen
Discoverer
0 Kudos
Hello Chris,

thank you for the very well-structured post. I would like to use the chance ask a question as colleagues and ran into a problem: We have established DSP and BTP/SCT according to the steps here. However, when we press the "Import data from Datasphere" button, we end up on a screen solely stating "Error 404" (see screenshots below).

Do you have any idea how we can solve this problem?

Thank you in advance.

 

Best regards,

Markus





 

Chris_Tam
Explorer
Hi m.westingen,

It might be the Token Service URL you have used in your configuration of the SAP_SCT_DESTINATION. The URL should come from the Datasphere system and you can find it under: System | Administration | App Integration


Chris
m_westingen
Discoverer
Hi ctam_collustro,

this, indeed, did do the trick! Thank you very much - also for the quick reply!

Best regards,

Markus
dbr222
Discoverer
0 Kudos
Hi Chris,

Thanks for your article! Very very helpful.

I set-up the connection between SCT and DSP via BTP cockpit configuration. However, after clicking on connect in SCT I am getting the below issue. Do you have any idea how we can solve this?


Also, I am trying to integrate a custom DSP space in my usecase. In the blog you mentioned "Once I copied the DPI views into my existing ESG spaces, I could change the URL to use those spaces instead." - How did you copy the DPI views into the DSP space? is there anything needs to be done at DSP? side Please note the URL in BTP destination has the custom DSP space mentioned at the end.


Chris_Tam
Explorer
0 Kudos
Hi dbr222 ,

 

I would first check to see if your datasphere api is working correctly.

Run something like this in your browser:
https://<your datashere>/dwaas-core/odata/v4/consumption/relational/SAP_SCT/SAP_SCT_DPI_Emission/$metadata

but replace the above with your datasphere, the space where your DPI views are, and the corresponding view that you are trying to import from SCT.

If that all works, then datasphere is fine and it may be something wrong with the clientid and client secret that you set up on datasphere that you copied into that SAP_SCT_DATASPHERE destination.

The only other quirk i have seen is SCT seems to cache some connection information for a period of time even after closing the application down and I have had to sometimes wait for an hour or so between switching the SAP_SCT_DATASPHERE information when switching between my systems... especially when an error occurs.

Regarding how to copy the views between my DSP spaces, I just opened the view in DSP, exported it to JSON:


Then I went to my destination space and imported it there:


Chris
dbr222
Discoverer
0 Kudos
Hi Chris,

Thanks for your reply. DSP looks fine as the metadata URL is working for the view. Also, the BTP destination is configured with correct OAuth details (client/secret/token etc).


 

However, the below error is coming while importing data into SCT.


Please note, I have created a custom space in DSP where standard SCT contents are installed and the view is created on top of remote table. Do we need any specfic authorization/role assigned in DSP or SCT ?
JBrandt
Participant
0 Kudos
Hi,

I'm facing the exact same issues described above and haven't found a solution yet.

The only difference is, that I'm trying to connect the standard Space (SAP_SCT) that is created once the business content is imported in the Datasphere.

Best regards,
Jonathan
Chris_Tam
Explorer
0 Kudos

Hi dbr222, jonathan.brandt ,

Two more things to check (1st for jonathan.brandt as well)

  1. What is the "Token Service URL" that you are using? It needs come from the App Integration page of your DSP system
  2. The DPI names are hardcoded to SCT and need to remain the same in whatever space you use for the connection. For example, to import the "CO2e Emissions" from SCT, the DPI view name "SCT DPI Emission" needs to exist. Do you have this DPI view in your DS_ESG space?

Chris

JBrandt
Participant
Hi Chris,

thanks for the suggestions. I checked both points before and they were set up as expected. Also the error messages looks to me more like an authorization issue against Datasphere.

Actually, when I checked the connection today, it was working again! I didn't change anything though:) So maybe it was just a temporary failure on DSP side?

Happy holidays!
Best regards,
Jonathan
hanish16
Explorer
0 Kudos
Hi Chris,

Many thanks for the detailed blog. It is helping lot of us.

I would like to know whether we have the possibility to have direct integration with SAP Sustainability Control Tower and SAP Analytics cloud (without having SAP Datasphere) or not. If it is possible to have direct integration with SAP Sustainability Control Tower and SAP Analytics cloud (without having SAP Datasphere), kindly give a little elaboration to understand.

 

Kind Regards,

Hanish Shan
Chris_Tam
Explorer
0 Kudos
Hi hanish16

Are you referring to putting data from SAC into SCT, or pulling SCT data into SAC for reporting purposes? If you are wanting the latter, I have used the OData Services connection from SAC to connect to the SCT's Get Sustainability Metrics endpoint on SAP Business Accelerator Hub. Then I acquired stored SCT data to make reports in SAC.

If you are wanting to put SAC data into SCT, however, I haven't seen a way to do it directly. Most likely you will need to create some middleware to pull SAC data, format it to SCT formats, and then send it into the SCT's Push Data endpoints on the hub.

Chris
dbr222
Discoverer
0 Kudos
Hi ctam_collustro

Thanks for your reply. Wish you a Happy New Year 🙂

  1. Yes, I am using the Token Service URL from the App Integration page of your DSP system.

  2. How to see all the hardcoded DPI names for different measures under Manage ESG Data?


Also, I am facing a new version issue on the DSP instance. Please find the below screen.


Do you have an idea which SCT integration content version on the DSP instance needs to update here ? Thank you in advance.


 

Regards,

Debargha
Chris_Tam
Explorer
0 Kudos
Hi dbr222

 

I have been using this help file SAP Datasphere Integration. For example, in SCT's Manage ESG Data, the "Absence" measure says the DPI is "Injury", so the exact view that SCT will look for in DSP is "SAP_SCT_DPI_Injury".

The new error means you will have to download the SAP Sustainability Control Tower Integration content from DSP's Business Content again as they have changed from the version that you have on your DSP.

Chris

 
viseo_team
Explorer
0 Kudos

Hello,

Thank you very much for this usefull documentation. Anyway I faced an issue when running the "ESG Manage Data" tile : Unfortunately, we could not finalize the SAP Datasphere authorization process. Check your connection and try again. If the issue persists, please contact your administrator.

We double checked the connexion definition into BTP for SCT and the configuration is OK and when running the check it returns a green flag with the error 401 as expected.

Any idea to help us to fix this issue ?

Thank you in advance.

Best regards, Hervé

Labels in this area