+++> 11.Currency Conversion in BI


  
         Currency Conversion in SAP BW

         

Need For currency Conversion in SAP BI 7.0

        Currency translation is used to translate the key figures with currency fields that exist in the source system in different currencies into a standard currency in the BI system.

Currency translation can be done at 2 levels:

1. Currency Translation in Business Explorer

       Currency Translation in Business explorer can be done in two ways:
Currency translation in query definition.
Currency translation in the executed query.

2. Currency Translation during Transformation


Below Figure gives an overview about where currency translation comes into picture in BI.





Currency translation is based on currency translation types. A combination of source and target currency, exchange rate type, time reference for conversion is used to determine exchange rate which in turn is used for performing the currency translation.


1. Currency Translation Type

A translation type is a combination of Exchange rate, source and target currency and time reference for conversion which are used for currency translation.
Different parameters that determine the exchange rate for currency conversion are Exchange Rate Type, Source and Target Currencies and Time reference for the translation.
Image below gives different ways in which a value in source currency can be translated to a value in target currency after determining the exchange rate from different parameters


To define currency translation type you have to define the exchange rate type, currency (Source and Target) and time reference.

Source currency: The currency that you wish to convert into a different one.

Target currency: The currency that is available after currency translation.

Time reference: Time reference for the currency translation can be either fixed or variable.
If the time reference is fixed, the time at which the exchange rate is determined is independent of the date.
If the time reference is variable, the time at which the exchange rate is determined is decided by a time characteristic value.

Exchange rate type:
The exchange rate type distinguishes between exchange rates that are valid  next to each other in the same time frame, for example, the bid rate, ask rate or middle rate. The exchange rate types are defined in a central table (TCURR) and can by maintained in customizing with BI Customizing Implementation Guide General Settings Currencies   Enter exchange rates Types.

You have maintained the following exchange rates:
EUR    USD 0.940
USD    EUR 1.070


Steps For Maintain Exchange Rates:


Step 1: Go to Transaction code “SPRO”




Step 2: Click on ‘Sap Reference IMG’





Step 3:  Go to ‘Sap customizing implementation Guide Sap Net weaver
                General Settings  Currencies Enter Exchange rates.




Step 4: Click on” New Entries”





Step 5: Enter the New Entries as shown in the below Screen Shot. And then save the new entries




Following is the step by step procedure to create a currency translation type.


1.1 Creating Currency Translation Type

Transaction Code for Creating Currency Translation Type in BI 7.0 is RSCUR.
Enter the Technical name for the translation type and click on the create button (F5).



Enter the Description for the Currency translation type. Properties, Exchange Rate, Currency and Time Reference are the tabs that are present in the currency translation type screen.




Step-1: Select Exchange Rate.
Exchange Rate for currency translation is determined based on the option selected in Exchange Rate tab of the currency translation type.

Exchange Rate Type: Generally we use M (Standard translation at average rate).



Ex. Rate Type from Var.: This option is used to determine the exchange rate type dynamically at the time of query execution. In order to enable this option you need to specify the name of a variable built on InfoObject 0RTYPE.



Exchange Rate from InfoObject: Specification of the InfoObject (key figure) that contains the exchange rate. This setting can be used in the WHM during data loading. The exchange rate is then taken from the associated key figure and not calculated using the data stored in Customizing at runtime.

Inverse Ex. Rate: In this case, the required translation from one currency to another is performed using the reverse exchange rate. Translation with the inverse rate is useful, for example, when the values have already been translated and you want to display the original values.

Step-2: Select Source and Target Currency.

Source Currency:
Determined using the data record: Source currency is determined from the data record of key figure at runtime of the query.

Fixed Source Currency: Fixed source currency that is to be used for currency translation.

InfoObject for determining the source currency: Specification of an InfoObject (Characteristic) in which a currency attribute is stored in InfoObject maintenance. At runtime, the associated currency attribute is determined using the characteristic value and this is interpreted as source currency.

Target Currency:
Target Currency Selection with Translation: This option can be used to determine the target currency through a selection variable at the time of query execution, in order to use this option a variable should be defined in the conversion tab of the amount key figure in the query designer. A fixed target currency can also be specified in the Query Designer (as a property of a key figure of type Amount)

Fixed Target Currency: Source currency is converted into the fixed target currency defined here.
Target Currency from Variable: This option can be used to determine the target currency through a selection variable at the time of query execution, in order to use this option a variable should be defined in this field and name of this currency translation type should be used in conversion tab of properties for amount key figure in the query designer.






Info Object for determining the target currency: Specification of an InfoObject (Characteristic) in which a currency attribute is stored in InfoObject maintenance. At runtime, the associated currency attribute is determined using the characteristic value and this is interpreted as target currency.
If the indicator 'Only Use in Transformation' is set for the InfoObject to Determine the Target Currency, InfoObjects can also be entered here in which there no currency attribute is defined in the InfoObject maintenance. The InfoObject that is specified here then has to exist in the data source and must also contain a currency in the characteristic attribute

Step-3: Select Time Reference.
Fixed Time Ref:

Current Date: Select this option when you need the target currency based on the current date‟s exchange rate.

Key Date: Select this option when you want the report to calculate target currency based on exchange rate of the date specified in this field.

Time Reference from Variable: Specification of a variable that was created for InfoObject 0DATE. This option is used to calculate the target currency based on the exchange rate for the date specified in the query designer.

Use Query Key Date: Use this when you want the system to use query key date while converting amounts to target currency.

Variable Time Ref.: You can select different time references based on your requirement. Following are the various time references available
Fiscal year closing
Start of fiscal year
End of period
Beginning of period
End of calendar year
Start of calendar year
Start of Calendar Year/ Quarter
End of Calendar Year/ Quarter
End month
Start month
End of week
To the exact day

Standard info object: System tries to assign the time characteristic to the object based on the value selected in Variable time reference field.
The following Info Objects are available:
Start/end fiscal year (0FISCYEAR)
Start/end period (0FISCPER)
Start/end calendar year (0CALYEAR)
Start/end calendar year/quarter (0CALQUARTER)
Start/end month (0CALMONTH)
End of week (0CALWEEK)
Exact days (0CALDAY)


Special Info object: If this option is selected we can specify info object other than standard time characteristics info objects.
The Info Objects available for selection here depend on which entry you made under Variable Time Reference.
If you specified Exact Days there, the following Info Objects can be selected:
Key figures of type Date
Info Objects with reference characteristic 0DATE
Info Objects with basic characteristic 0CALDAY

For all other entries under Variable Time Reference, the following
Info Objects may be selected:
Info Objects with the associated basic characteristic

Infoset: This setting has the same functionality as Standard Info Object or
Special Info Object. If the Info Object, from which the time reference is to be determined, is unique in the Infoset, which means it exists only once in the entire Infoset, it is sufficient to enter the Info Object in Standard Info Object or Special Info Object.
An entry in Variable Time Reference Using Infoset is only necessary when the time reference is to be determined using an InfoObject and this InfoObject occurs multiple times in the Infoset.




Once all exchange rate, currency and time references are selected save currency translation type.
Time Shift: The time shift (regardless of whether it is fixed or variable) always refers to the Info Object specified under Variable Time Reference.
For Example, if the variable time reference is 'To the Day', 0CALDAY, and the time shift is -3. Instead of 07.11.2008, 04.11.2008 would be used for the conversion after the shift.



Following are the different ways in which currency conversion can be performed in BI 7.0:

2. Defining Target Currencies Using Info Objects

2.1 Determine Target Currency for currency conversion from Info Object

Step-1: Create a Master Data Info Object (YCOUNTRY) with a characteristic (0CURRENCY) as its attribute. This Info Object will be used to determine the target currency of currency translation.



Step-2: In the Business Explorer tab of the InfoObject Maintenance, set the currency attribute (0CURRENCY) for the InfoObject which is used to determine the Target Currency.



Step-3: Define the Currency Translation type and choose “Info Object for Determining Target Currency” option in the currency tab.
For this go to Transaction Code RSCUR (Currency Translation Type), enter the desired Currency Translation Type name (YHROBJCUR) and press Create Button.


In “Exchange Rate‟ Tab of currency Translation type specify the exchange rate type which you want to use for Currency Translation (The exchange rate type used here is “Standard Translation at average Rate” M)).



In „Currency‟ Tab Mark the radio button “Info Object for Determining Target Currency”, include the name of Info Object which you have created and save the Currency Translation Type.



Step-4: Use this Currency Translation Type in the Query Definition.
create a query on the cube with a key figure (YAMOUNT01) of type amount and include the previously defined InfoObject which will determine the target currency in the rows section (Refer the following Screenshot).
In the properties for the key figure (YAMOUNT01), go to the conversion tab and select the earlier defined conversion type (YHROBJCUR) and save and execute the query.





Following are the snapshots of the Master data and data before and after currency conversion.
Master Data YCOUNTRY used to determine the target currency of each country:



Data in the Cube:


Output Data after executing the query:



From the above two screenshots you can see that the amount in USD is converted into the target currency depending on the Country.


3. Currency Translation in Business Explorer
For the Currency translation to take place in the Business Explorer you must have already created a currency translation type.
Currency Translation in Business explorer can be done in two ways:
Currency translation in query definition.
Currency translation in the executed query.

3.1 Currency translation in query definition
Currency translation in the query definition is done for individual key figures or structure elements by specifying the currency translation type for each key figure or structure element.
Target currency for currency translation can either be a fixed one or can be determined from a selection variable depending on the definition of target currency setting in currency translation type.

3.1.1 Currency translation in query definition (Fixed Target Currency)
If you want the currency translation to happen always to a single fixed target currency then you can use the following setting in the BEx.

Step-1: Define the currency translation type (you can also use an existing currency translation type). Currency translation type used for this example is “0HRFIXXUR” (Fixed Target Currency, Current Date).

Step-2: Start the query designer and select the keyfigure on which you want to perform the currency conversion, in the properties for that keyfigure select the desired currency conversion type in the „Conversions‟ tab.




In this type, the target currency will always be the same. You can use a variable for selecting the target currency if you want to choose different target currencies every time you execute the query.
Following is the step by step procedure for using a selection variable for target currency


3.1.2 Currency translation in query definition (Target Currency determined through selection variable)
We can use a variable for determining the Target currency in two ways.
1. Variable in the currency translation type.
2. Variable in properties of the key figure in BEx.

3.1.2.1 Variable in the currency translation type
This option is used to determine the target currency through a selection variable at the time of query execution, in order to use this option a variable should be defined in this field and name of this currency translation type should be used in conversion tab of the amount key figure in the query designer.


Step-1: Create a variable for Info Object „0CURRENCY‟ (Currency Key).
Start the variable wizard in order to create a variable for 0CURRENCY.



Create a Characteristic variable with the specifications as mentioned in the following screenshots.
- Processing By: Manual Input/Default Value.
- Reference Characteristic (0CURRENCY) Currency.
- Variable Represents: Single Value.
- Ready for input: checked







Step-2: Create a currency translation type which uses this variable to determine the Target currency.
Go to Transaction Code RSCUR and create a new currency translation type.



In the Exchange Rate tab select the desired exchange rate type.



Mark the radio button “Target Currency from Variable” and enter the technical name of the variable created on 0CURRENCY.


 Save the Currency translation type and exit.
Step-3: Start the Query designer and create a query with the key figure that uses this currency translation type.


Save and execute the query, you will be asked for a target currency in a selection variable pop-up.



3.1.2.2 Variable in properties of the key figure in BEx
The second way to determine the target currency from a variable input is through the variable in the properties of key figure in BEx.

Step-1: Create a currency translation type by marking the radio button “Target Currency selection with Translation” in the Target currency section of currency tab.
Mark the necessary entries on the Exchange rate and Time ref. tab and save the currency conversion type.


Step-2: Start the query designer and create a query with a key figure that uses the newly created currency translation type.


Step-3: under the Target Currency field select variable entry screen and create a new variable with specifications same as in section 3.1.2.1 and save it (You can also use an existing variable).


You will see the newly created variable in the Target currency field.


Execute the query. You will be asked for a target currency in a selection variable pop-up.



3.2 Currency translation in the executed query
Currency Translation can be performed in the BEx Analyzer by selecting the Query Properties in the context menu for the key figure.


In Query properties select the currency conversion tab.

On selecting Display Original Currency all the currency conversions will be disabled.
Convert to Currency: Select this option to translate results into a specific currency. In the dropdown box, select the currency into which the results are to be translated.
Use Currency Translation: after you have selected the target currency for the results, select the type of translation to be used for the conversion from this dropdown box.
First Apply Currency Translation from Query Definition: select this checkbox to first convert into the currency defined in the query, and then into the currency as customized in the above settings.


4. Currency Translation during Transformation
Currency translation during transformation enables to convert data records from source currency into a currency of the target of the transformation.
To perform the currency translation in transformations we must have defined the currency translation type.
Following is the step by step procedure for currency translation during transformations:
Step 1: Create a currency translation type. We can also use the existing translation type.
Step 2: In transformations click on the rule details of the key figure for which the currency is to be translated.



Step 3: In the Currency field select “From Conversion” and enter the previously defined currency translation type under conversion type as shown in the following screenshots. Save and activate the transformation.









**************************************


















Step 4: Load data into the Info Cube. The Data present in the cube will have the target currency mention in the Currency Translation Type.

Following are the snapshots of the data in PSA and in the Info Cube.
Data in PSA:

Data in the Info Cube: