Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
PrasannaL_Kona
Product and Topic Expert
Product and Topic Expert
5,074

Objective

Currency Conversion is an important aspect of any data modelling, planning, and reporting. SAP Datasphere software provides a standard functionality for Currency conversion. However, this is a quick step by step process on how currency conversion can be implemented with federation using S/4 HANA as a source. This article is completely based on my learning experience. I hope, this article will be useful for those consultants who are looking to capitalize the virtualization, federation, and tailor the needs based of the custom requirement.

How is it  different from standard approach?

1. This approach does not need all the currency relevant tables for the basic currency conversion but have the minimum four tables that are primarily involved as mentioned in the pre-requisites

2. Tables are federated or remote or virtual physical present in S/4 HANA. Unless there is a need for persistency can be scheduled at the input layer

3. Tables when remotely configured can be named according the naming conventions of the business need purposes

Prerequisites

  • Connection of SAP S/4 HANA on Premise or Cloud systems
  • Below standard tables activated in S/4 HANA systems

Table Name

Table Description

TCURV

 Exchange rate types

TCURX

 Decimal places in currencies

TCURR

 Exchange rates

TCURF

 Conversion factors

Option 1:

 Code snippet for SQL view

SELECT "FISCALYEARPERIOD", "PRODUCT","COMPANYCODE", "TRANSACTIONCURRENCY","AMOUNTINTRANSACTIONCURRENCY"

 

CONVERT_CURRENCY( AMOUNT => "AMOUNTINTRANSACTIONCURRENCY",

SOURCE_UNIT => "TRANSACTIONCURRENCY",

   "CONVERSION_TYPE" => 'M',

    "REFERENCE_DATE" => '2024-09-01', ----can be an input parameter

    "CLIENT" => '400',

    "SCHEMA" => 'DW_DEV_SCHEMA',

    "ERROR_HANDLING" => 'set_to_null',

    "TARGET_UNIT" => 'SAR', -----can be an input parameter

"PRECISIONS_TABLE" => 'S4H_TCURX', --the table used for conversion must be declared here this is federated with remote table call

    "CONFIGURATION_TABLE" => 'S4H_TCURV', --the table used for conversion must be declared here this is federated with remote table call

    "PREFACTORS_TABLE" => 'S4H_TCURF', --the table used for conversion must be declared here this is federated with remote table call

    "RATES_TABLE" => 'S4H_TCURR' --the table used for conversion must be declared here this is federated with remote table call

/***These remote tables when imported have been named with prefix as S4H in this case.

)

AS deb_cre_lc,

 

from "FIGL_LINEITEM" ----ACDOCA standard SAP Transaction Table

Resultset:

When converted from USD to SAR

PrasannaL_Kona_5-1729073479846.png

Option 2:

Case of calculated column in a graphical view

PrasannaL_Kona_6-1729073479847.png

Calculated column dbe_cre_lc definition

PrasannaL_Kona_7-1729073479849.png

Code snippet

CONVERT_CURRENCY( AMOUNT => "AMOUNTINTRANSACTIONCURRENCY",

SOURCE_UNIT => "TRANSACTIONCURRENCY",

   "CONVERSION_TYPE" => 'M',

    "REFERENCE_DATE" => :IP_REFERENCE_DATE,

    "CLIENT" => '400',

    "SCHEMA" => ‘DW_DEV_SCHEMA',

    "ERROR_HANDLING" => 'set_to_null',

    "TARGET_UNIT" => :IP_TARGET_CURRENCY,

"PRECISIONS_TABLE" => 'S4H_TCURX',---federated tables from S/4 HANA

"CONFIGURATION_TABLE" => 'S4H_TCURV', ,---federated tables from S/4 HANA

"PREFACTORS_TABLE" => 'S4H_TCURF', ,---federated tables from S/4 HANA

"RATES_TABLE" => 'S4H_TCURR') ,---federated tables from S/4 HANA

INPUT PARAMETERS

PrasannaL_Kona_8-1729073479851.png

Resultset:

PrasannaL_Kona_9-1729073479852.png

 

4 Comments