Skip to Content

Dynamic Currency translation changes in SAP HANA

Objective:- how to change the currency using dynamic filter (while run time)

Users will expect while executing the views currency will change ex- all USD values change to EUR or EUR to USD

Author Bio:-

Kodanda Pani K.V is a SAP HANA consultant currently working with Accenture Pvt Ltd (Bangalore/INDIA). He has over 5 years of experience in various BW/BO/HANA implementation / Support Projects.


Business scenarios: – Retail company has head quarter in Europe countries but there business different countries USA, IN, JAPAN, CHINA

All the sales information will store VABK table and i had work with VABK table for currency translation

Prerequisite:  Before doing currency translation make sure all the below tables has to present in respective schema.

/wp-content/uploads/2016/07/1_993144.png

Step by step procedure

Make sure VABK and TCUR* tables extract from ECC to HANA system using BODS or SLT system.

Created the analytical view using VABK table

Below screen will appear and check the data foundation in VBAK table

/wp-content/uploads/2016/07/2_993145.png

In VABK table has huge data i put filter only EUR currency and applied fitter WAERK (document currency)

/wp-content/uploads/2016/07/3_993146.png

Data foundation view for VBAK table below fields

/wp-content/uploads/2016/07/4_993147.png

Created one calculated columns (Target currency) and two input parameters (currency and date)

Define Date input variable

Name – date

Values – FORMAT (NOW (),’YYYYYMMDD’) – SQL syntax will give current date

Symantec type – date

Data type- DATE

/wp-content/uploads/2016/07/5_993148.png

ZCURRENCY input variable

Name – ZCURRENCY

Label – ZCURRENCY

Parameter type – column

Reference – WAERK

/wp-content/uploads/2016/07/6_993152.png

Created calculated column target currency (Target currency)then passing the two input variable in calculated column field

Target currency field
Source Currency:
  Source currency can be either a fixed currency or it can refer to document currency field of our table/view.

Target Currency: Target currency can be any fixed currency or it can refer to any currency field of your analytic view or you can decide target currency at run time using Input parameter.

Exchange Type:  Exchange Type is one of key in the exchange rate table (TCURR) against which rates for conversion are maintained. You can select a fixed value or can decide its value at run time using Input parameter.

Name – TARGET_CURRENCY

Label – Target currency

Data type – decimal (10, 2)

Column type – Measure

Expression editor – used the measure values ‘NETWR’ – Net value on Sales document

/wp-content/uploads/2016/07/7_993153.png

Click on semantics option then below screen will appear

Semantic type – Amount with currency code

Then click on enable for conversion

Currency – TARGET _CURRENCY _CURRENCY (browse and choose the option)

Target currency – ZCURRENCY (Input variable) (browses and chooses the option)

Exchange type – M

Conversion date – DATE (browse and choose the option) – it will give current date

Schema of currency conversion – browses and chooses the schema ex – ZPHANI1

Generate results currency column – target_currency_currency (browse and choose the option)

Upon conversion failures – Fail

/wp-content/uploads/2016/07/8_993154.png

Save and activate the view and execute the view

select the view -> right click ->  data preview

Below variable prompt will ask for target currency and date.

We can change the dynamically target currency as per the business requirements

/wp-content/uploads/2016/07/9_993155.png

Report output for currency translation with below fields

Now can see all EUR values are converted into USD currency

/wp-content/uploads/2016/07/10_993156.png

Note: – All TCUR* table all dates exchanges rates should available in the system

Thanks and Regards,

Phani.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. kabilarasan R

    hi,

    its very useful for me.. but i have one problem in currency conversion… i done all the steps above  and the view is activated successfully. when i click data preview -> raw data it shows an error.

     

    error message: Client not found for the current user

    (0) 

Leave a Reply