‎2007 Feb 28 11:06 AM
Hi All,
I wish to convert the amount from US$ to USD.
I am using the FM as follows ::
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
client = sy-mandt
date = sy-datum
foreign_amount = 100
foreign_currency = US$
local_currency = USD
IMPORTING
local_amount = l_curr.
The exchange rate for US$ and USD is 1.00 as maintained in the table TCURR
Thus 1 US$ = 1 USD
But I am getting the result as zero.
There is something wrong somewhere but I am not getting it.
Your suggestion would really be appretiated.
regards
‎2007 Feb 28 11:10 AM
Hi Sachin,
You are most probably giving the date wromg, just check the TCURR entry once again and find the value of GDATU.Pass that date in the date parameter of the FM and it should work fine.
Thanks,
Imran
‎2007 Feb 28 11:14 AM
‎2007 Feb 28 11:12 AM
‎2007 Feb 28 11:12 AM
Hi,
Check this example
DATA: v_amount TYPE p DECIMALS 2.
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date = sy-datum
foreign_currency = 'INR'
local_amount = '1.00'
local_currency = 'USD'
IMPORTING
foreign_amount = v_amount
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
IF sy-subrc = 0.
WRITE: / 'US dollar to Indian rupees - ', v_amount.
ENDIF.
Cheers
Alfred
‎2007 Feb 28 11:13 AM
Hello,
Check this sample:
DATA : L_NETWR TYPE VBAP-NETWR.
CLEAR : L_NETWR.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = SY-DATUM
FOREIGN_AMOUNT = G_T_VBAP-NETWR
FOREIGN_CURRENCY = G_T_VBAP-WAERK
LOCAL_CURRENCY = G_T_VBAK-WAERS
IMPORTING
LOCAL_AMOUNT = L_NETWR
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
Provided the exchange rates should be maintained properly.
Vasanth
‎2007 Feb 28 11:14 AM
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
client = sy-mandt
date = sy-datum
You are giving the value sy-datum , are you sure that as of today the exchange rates are updated