SAP DataSphere - Setup Currency Conversion
Wagner Sabino .’.
BI Specialist (SAP Analytics, Datasphere, BW, HanaDB, S/4 Embbeded Analytics, SAC, BO)
Content packages also come with in-built currency conversion. The currency conversion objects and the sourcing of these objects need to be setup in the SAP_CONTENT space before the content is imported.
Currently the following content uses currency conversion.
Please follow the SAP Datasphere documentation Enabling Currency Conversion with TCUR* Tables and Views accordingly. You may load the currency from any source or system. All content packages mentioned above are built based on local tables as first inbound layer object, which can be loaded from SAP S/4HANA or SAP S/4HANA Cloud.
While the source system for the currency information does not matter, the upcoming description and information assumes, that you have used the SAP S/4HANA system (connection SAP_CONTENT_SAPS4H) as the source system.
As the client in any customer SAP S/4HANA system differs, but the content should work universally, the client ‘000’ is used when using currency conversion in the content.
During the setup of the currency conversion tables and views, the client is taken from the selected connection. Adjust the client to ‘000’ if the client of the selected connection is not ‘000’ for the content to work,
The following two options exist:
For option 1.) proceed as follows:
In the projection node of each generated dataflow, change the field CLIENT to the expression '000' and deploy the dataflow again. Run the Data Flow to load the data from your source system.
These are Data Flows that need to be changed:
For option 2.) proceed as follows:
Change the client in each currency conversion measure in the respective views of each content package. In the documentation you find the information which view contains currency conversion measures per package.
Additional consideration, if more than one source system exists
If you have more than one source system connected to your SAP Datasphere system and want to load the currency rates from different systems or clients, please consider the following:
If the currency rates (and the other currency tables), which are common in all systems, are the same, but one system has e.g. more currencies rates, then you should load using the generated data flows from the different source systems into the same destination client ‘000’ in SAP Datasphere (as described in option 1). The records will be appended using the Data Flows.
If the currency rates are different and this should be reflected in your SAP Datasphere e.g. because you have special currency rates for planning in your different source systems, then you can load the currency rates using the generated data flows with the original destination client (which was derived from the connection for the source system). This results in currency rates separated through the client information in the currency tables. As a result, depending on which currency rates you want to use, you have to specify the respective client in the currency calculation columns used in the views of each package (as described in option 2).
Currencies with other than 2 decimal places
While most currencies use 2 decimal places, some currencies that do not use decimals at all, such as the Japanese Yen (JPY), the Korean Won (KRW), and the Indonesian Rupiah (IDR) or have less or more than 2 decimal places.
SAP transactional systems (R/3, ERP, SAP S/4HANA) store currency amounts in the system with two decimal places by default (internal format). When such data is extracted, the data is transferred in the external format when using Replication Flows to load data into the local tables (Case 1 and used in the S/4HANA Content) and in the internal format when Remote Table are used (Case 2).
The following example explains how amounts are stored in SAP tables in the transactional system and subsequently in SAP Datasphere:
JPY -> zero-decimal currency; USDN -> 5 decimals.
Check the table TCURX in your SAP system to find all currencies that follow the above behavior.
You may also check the replicated data from the SAP source system in SAP Datasphere in view SAP.CURRENCY.VIEW.TCURX.
领英推荐
The affected currencies contain the value <> “2” in the column “CURRDEC” (Number of decimal places).
For additional info see SAP Note : https://me.sap.com/notes/137626 and https://me.sap.com/notes/153707.
What are the consequences for the content modelling? The above-mentioned SAP Content packages which were designed for the use of replication flow, are modelled as described in Case 1.
Find more details per use case as follows:
Case 1 – Local tables using a CDS View using Replication Flow -> amounts come in external format:
Columns with amounts (e.g. Net Value in document currency) are displayed correctly in data previews in the HL or RL layer.
The currency conversion columns in the HL layer views, only use the CONVERT and not SHIFT. As the default for a new currency conversion column is SHIFT and CONVERT, remember to delete the SHIFT expression when adding a new currency conversion column.
Note: Currently the SHIFT step cannot be deleted in the currency conversion available in an Analytical Model. Thus all currency conversions need to be modelled the HL layer fact views.
Case 2 – Remote Table using a CDS View -> amounts come in internal format.
Columns with amounts (e.g. Net Value in document currency) are transferred to remote table in the internal format and stored in SAP Datasphere in the internal format. That results in incorrect data in data previews in SAP Datasphere and consequently also in SAP Analytic Cloud, as they will be displayed in the internal format.
If you want to use such a measure in a story, an “in place” currency conversion is required to show the correct values. This means setting source currency = target currency, which does the SHIFT to the external format.
If a conversion from e.g. transaction currency into company code currency is done, the conversions must include the SHIFT and the CONVERT to guarantee correct result also for currencies with <> 2 decimal places.
Case 3 – data is loaded using other connectors or ways into SAP Datasphere
Case 1 and 2 focus on SAP S/4HANA and SAP S/4HANA Cloud. If you are loading data from a different system/data source please validate for amounts with currencies <> 2 decimal places how the amounts are stored for your system/data source in SAP Datasphere, to decide if you need to use the SHIFT and CONVERT or only the CONVERT to guarantee correct results.