Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exchange rate in FM CONVERT_TO_LOCAL_CURRENCY

Former Member
0 Kudos

Hello Expert,

I am facing an issue with the FM CONVERT_TO_LOCAL_CURRENCY.

It is not returning correct exchange rate, however it is converting the amount fine.

The exchange rate returned is in multiples of '1000' of what is used for the conversion.

I am exporting the following values to the FM from my report.

EXPORTING

           CLIENT           = SY-MANDT

           DATE             = SY-DATUM

           FOREIGN_AMOUNT   = '43.16'

           FOREIGN_CURRENCY = 'USD'

           LOCAL_CURRENCY   = 'INR'

*          RATE             = 0

           TYPE_OF_RATE     = 'EXGI'

           READ_TCURR       = 'X'

         IMPORTING

           LOCAL_AMOUNT     = IT_OUTPUT-LOCAMT

           EXCHANGE_RATE    = IT_OUTPUT-EXR

The values returned by the FM are

IT_OUTPUT-LOCAMT     =  2211.95

IT_OUTPUT-EXR            = 51250.00

I checked the table TCURR and the rate maintained is '51.250'. The conversion is correct but the exchange is incorrect.

Kindly help.

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

A conversion exit exists for exchange rate field in TCURR. Use following FM to convert exchange rate:

CONVERSION_EXIT_EXCRT_OUTPUT.

CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT'

   EXPORTING

     input         = IT_OUTPUT-EXR

IMPORTING

   OUTPUT        = exch_rate

           .

Exch_rate will contain the correct exchange rate.

Regards

4 REPLIES 4

vijay_hariharan
Contributor
0 Kudos

Hi Anurag,

There is an OSS Note for this SAP Note 153707 that explains the currency Miscalculation.

Please check and see if this resolves your issue.

Thanks & Regards,

Vijay

arindam_m
Active Contributor
0 Kudos

Hi,

The exchange rate that you get back might be in internal format often these are saved after multiplying with 1000 to save the precision of the decimals. You may have to explicitly convert them to the external format.

Cheers,

Arindam

former_member188827
Active Contributor
0 Kudos

A conversion exit exists for exchange rate field in TCURR. Use following FM to convert exchange rate:

CONVERSION_EXIT_EXCRT_OUTPUT.

CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT'

   EXPORTING

     input         = IT_OUTPUT-EXR

IMPORTING

   OUTPUT        = exch_rate

           .

Exch_rate will contain the correct exchange rate.

Regards

0 Kudos

Thanks, It worked.