‎2005 May 02 2:11 PM
Hi.
I have to convert currency from for Example CAD to USD
I used
call function 'CONVERT_AMOUNT_TO_CURRENCY'
exporting
DATE = sy-datum
foreign_currency = 'CAD'
foreign_amount = 2000
local_currency = 'USD'
IMPORTING
LOCAL_AMOUNT = amount.
I did not got the expected output. The outputr which i got is
Import parameters Value
DATE 2005/05/02
FOREIGN_CURRENCY CAD
FOREIGN_AMOUNT 2000
LOCAL_CURRENCY USD
Export parameters Value
LOCAL_AMOUNT
Tables Value
T_C_ERRORS 0 Entries
Result: 0 Entries
Please help me solve this
Thanks & regards
sree
‎2005 May 02 2:47 PM
Hello Sree,
In my system, for the same values, this function is returning a error message in T_C_ERROS.
This function reads tables TCURV and TCURF (Factor conversion).
Problably the problem is that you don´t have a conversion rate in table TCURF for this parameters.
If you debug the function, you will find wich table is missed.
I don´t have knowledge on how to maintain this tables and what this maintanace could affect.
I think that an FI functional person could help you on how to maintain it.
Regards,
Mauricio
‎2005 May 02 2:51 PM
‎2005 May 02 2:54 PM
Hi,
Try the below code.
REPORT zc1_currency_conversion .
DATA: loc_umsa1 LIKE kna1-umsa1.
CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY'
EXPORTING
foreign_currency = 'CAD'
foreign_amount = 450
local_currency = 'USD'
IMPORTING
local_amount = loc_umsa1
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc = 0.
WRITE:/ 'Converted amount is:' , loc_umsa1.
ELSE.
WRITE:/ 'Error in conversion'.
ENDIF.
Incase the funtion module is workign properly,
Try these modules,
CONVERT_TO_FOREIGN_CURRENCY or CONVERT_TO_LOCAL_CURRENCY.
Hope this will be helpful.
Cheers
Kathir~
‎2005 May 02 7:21 PM
Hi,
I see that there are lots of FM that converts a currency from one to another.
I need a Method inside a abap class that do the same!
Any clue where to search for this (i don't what to use FM.)?
//Martin