Writing Data from CPE-UM to SAP Sustainability Control Tower
Write data from CPE-UM to SAP Sustainability Control Tower using CPE-UM environments.
SAP Sustainability Control Tower provides an inbound API to push data into DPIs, validate the data, and then, based on the outcome of the validation, to discard or publish the data. To facilitate the use of these APIs in CPE-UM, SAP Sustainability Control Tower provides a protected CPE-UM environment for each DPI to write data to SAP Sustainability Control Tower.
|
Environment ID |
Description |
|---|---|
|
SCTWACCT |
Write AccountData to SAP Sustainability Control Tower. |
|
SCTWBCM |
Write BasicCustomMetricData to SAP Sustainability Control Tower. |
|
SCTWCORRUP |
Write CorruptionIncidentData to SAP Sustainability Control Tower. |
|
SCTWEMISS |
Write EmissionData to SAP Sustainability Control Tower. |
|
SCTWENERGY |
Write EnergyData to SAP Sustainability Control Tower. |
|
SCTWGEN |
Write GeneralMeasureData to SAP Sustainability Control Tower. |
|
SCTWGENERI |
Write Generic Measures to SAP Sustainability Control Tower. |
|
SCTWINJURY |
Write InjuryData to SAP Sustainability Control Tower. |
|
SCTWLAND |
Write LandSiteData to SAP Sustainability Control Tower. |
|
SCTWPEOPLE |
Write PeopleData to SAP Sustainability Control Tower. |
|
SCTWRESOUR |
Write ResourceUsageData to SAP Sustainability Control Tower. |
|
SCTWWASTE |
Write WasteData to SAP Sustainability Control Tower. |
|
SCTWWATER |
Write WaterWithdrawalData to SAP Sustainability Control Tower. |
Prerequisites
-
Before proceeding, ensure you have a basic knowledge of CPE-UM configuration.
-
A destination SCT_ODATA to use the API. For more information, see Setting up the Destination.
Writing Data to a CPE-UM Environment
The example used below is based on the sample environment "SCT Sample Custom Metrics" (ID SCTSMETRIC) provided by SAP Sustainability Control Tower. In this environment a custom metric is calculated, and the results are written to SAP Sustainability Control Tower with the environment SCTWBCM to write basic custom metric data.
Aside from the default source ID CPE, you can provide a different source ID for the input model entity of the DPI. If the field remains empty, the default value is used.
Writing Data into a Model Entity
-
Create a connection of the type Environment in your source environment that is connected to the target environment.
As an example, the source environment is SCTSMETRIC and the target environment is SCTWBCM in this example.
-
In this connection, configure the fields of the model (here: SCTBasicCustomMetricsData).
The model to select is the Model Entity that is exposed by the environment (here: SCTWBCM which is used to write the data to SAP Sustainability Control Tower). This model is called the Input Model Entity. For the list of Input Model Entities for each DPI, see the table "Input Model Entity for Each DPI" below.
-
Save the connection, then synchronize it with Sync Models.
Once you have done so, a function of the type Model Reference is created in your source environment.
Creating a Writer Function to Write Data
-
Create a Writer function in your source environment to write data that will then be pushed to SAP Sustainability Control Tower.
-
Create an Input function of the writer function which will then contain the data to be written to SAP Sustainability Control Tower.
-
Use the Result Model function of the writer function (that is, is the Model Reference function created in step 2 of the subsection 'Writing Data into a Model Entity' above).
-
You can write multiple objects to the Model Reference function, for example, basic custom metric data or measure data for any of the available DPIs. For each metric or measure, if the data set contains more than 10,000 rows, the data is split into batches of 10,000 rows, and each batch is pushed one by one.
|
Environment ID |
Function |
|---|---|
|
SCTWACCT |
AccountsData |
|
SCTWBCM |
BasicCustomMetricsData |
|
SCTWCORRUP |
CorruptionIncidentsData |
|
SCTWEMISS |
EmissionsData |
|
SCTWENERGY |
EnergyData |
|
SCTWGEN |
GeneralData |
|
SCTWINJURY |
InjuryData |
|
SCTWLAND |
LandData |
|
SCTWPEOPLE |
PeopleData |
|
SCTWRESOUR |
ResourceUseData |
|
SCTWWASTE |
WasteData |
|
SCTWWATER |
WaterData |
The Input Model Entity of each measure DPI contains fields to import custom dimensions. When a custom dimension contains data, two fields must be filled in the Input Model Entity. For example, for custom dimension 01, this would look as follows:
-
CustomDimension01Id: the identifier of the dimension.
-
CustomDimension01Name: the name of the custom dimension.
-
CustomDimension01Id: VAL1 or VAL2.
-
CustomDimension01Name: Z_EMISS_01.
|
Measure Id |
Measure Value |
Custom Dimension 01 Id |
Custom Dimension 01 Name |
Custom Dimension 02 Id |
Custom Dimension 02 Name |
|---|---|---|---|---|---|
|
Z_PEOPLE_MEASURE |
1.00000000000000 |
VAL1 |
Z_EMISS_01 |
1 |
Z_CUSTOM_02 |
|
Z_PEOPLE_MEASURE |
1.00000000000000 |
VAL2 |
Z_EMISS_01 |
0 |
Z_CUSTOM_02 |
|
Z_PEOPLE_MEASURE |
1.00000000000000 |
VAL1 |
Z_EMISS_01 |
0 |
Z_CUSTOM_02 |
Each environment includes an input process named after the DPI it corresponds to, for example, Input Basic Custom Metrics Data. The purpose of this process is to input data into SAP Sustainability Control Tower manually or imported through a file in the activity of the same name as the process.
Pushing and Validating, Discarding, or Publishing Data
Once the data for pushing into SAP Sustainability Control Tower is available in the input model entity (the one exposed by the SCTWBCM environment in this example), the next step is to run the activities to push data into the DPI in SAP Sustainability Control Tower. You can then validate the data, and, based on the outcome, discard it or publish it to SAP Sustainability Control Tower.
When multiple objects are pushed into SAP Sustainability Control Tower, CPE-UM processes them one by one. When an error is detected by the validation rules for a measure or metric, this particular object will then be discarded. This means that, in case of multiple objects, some may be discarded while others can be published.
The environment in this example, SCTWBCM for writing basic custom metric data, is delivered with the write process Write Basic Custom Metrics Data. If you want to customize this process, you need to copy it, and then customize the copy.
You can't trigger the processes of the writer environments (or other protected environments) directly. Instead, you need to copy the processes to an unprotected environment and trigger them from there.
|
Activity |
Description |
|---|---|
|
001 - Confirm to launch the writing process |
Confirming this activity triggers the writing of data to SAP Sustainability Control Tower. It does not run any function. You can customize this activity, for example, to run the Writer function as described in the section Writing Data to a CPE-UM Environment. |
|
301 - Push and validate basic custom metrics |
For each metric or measure written as described in the section Writing Data to a CPE-UM Environment above, this activity runs the tasks below:
|
|
302 - Error validation logs for basic custom metrics to discard |
For each metric or measure: If at least one error is detected, all the data of that metric or measure is rejected. This activity displays the rejected objects and provides the descriptions of the detected errors. Check these errors and fix any issues in the written data. Once the errors are resolved, trigger the process again. If this activity contains no data, no error has been detected. If this activity contains data, the state of the activity is set to Rejected and the activity 303 - Discard basic custom metrics with issues is triggered to discard the listed objects. |
|
302 - Warning validation logs for discarding basic custom metrics |
For each metric or measure: If at least one warning is detected, all the data of that metric or measure is rejected. This activity displays the rejected objects and provides the descriptions of the detected warnings. The warnings displayed in this activity are described in more detail in the section Error Handling below. If this activity contains no data, no warning has been detected. If this activity contains data, the activity is set to Rejected and the activity 303 - Discard basic custom metrics with issues is triggered to discard the listed objects. |
|
303 - Discard basic custom metrics with issues |
If at least one of the two activities 302 above (errors and warnings) contains data, the activity 303 is run. It discards the data of the objects listed in the activities 302. The objects are discarded one by one. Once all objects have been discarded, the next activity becomes active: 304 - Validation logs for publishing basic custom metrics. |
|
304 - Validation logs for publishing basic custom metrics |
This activity displays the data of the objects that do not have any errors or warnings. All the data listed in this activity will be published to SAP Sustainability Control Tower. If this activity contains data, the state of this activity is changed to Confirmed and the next activity 305 - Publish basic custom metrics without issues is triggered. If this activity contains no data, the state of the activity is changed to Rejected and the activity 001 - Confirm to launch the writing process becomes active. |
|
305 - Publish basic custom metrics without issues |
If activity 304 contains data, its objects are published to SAP Sustainability Control Tower. The objects are published one by one. Once all objects have been published, the activity 001 - Confirm to launch the writing process becomes active again. |

You must copy and customize this process or integrate it into your own processes. You can't use it on its own. For example, you can modify the activity 001 - Confirm to launch the writing process and its activity links to connect it to the function to write the data from your source environment to the target environment. Make sure that you don't modify the activity links of the other activities.
Error Handling
Errors considered as Warnings
-
Message ID 151: "Duplicate record. A record with the same primary key already exists."
-
Message ID 207: "A record with the same primary key and the same value already exists. The record will not be updated."
-
If all the data is rejected with only the above issues, then this data is discarded. It doesn't mean that the submitted data contains issues, however. These issues are therefore considered as warnings. The data is discarded.
-
If some of the data is rejected with one of the above issues and some of the other data results in different types of errors, the data is discarded.
-
If some of the data is rejected with one of the above issues but the other data did not result in any errors, the data can be published.
Checking the issues when writing data
To write data from CPE-UM into SAP Sustainability Control Tower, run the corresponding write process (in the example above: Write Basic Custom Metrics Data). Below, the input model entity refers to the model entity exposed by the write environments. The common issues when running this process are the following:
-
The activity 001 - Confirm to launch the writing process is active.
-
The activity 302 for errors, for example, 302 - Error validation logs for discarding basic custom metrics is rejected.
-
The activity 001 - Confirm to launch the writing process is active.
-
The activity 304, that is, 304 - Validation logs for publishing basic custom metrics, is rejected.
-
No data has been written to the input model entity exposed by the corresponding write environment.
-
All the objects for the input model entity have been considered as errors or warnings (see the 2 activities prefixed with 302). Therefore, the activity 304, that is, 304 - Validation logs for publishing basic custom metrics, contains no data for publishing.
-
The activity 001 - Confirm to launch the writing process is not active.
-
No data has been written to the input model entity exposed by the corresponding write environment.
-
The measure ID or metric ID does not exist.