‎2008 Nov 10 10:07 PM
Hi,
I need to convert any non-USD currency amount to USD. I know that the rates are stored in the table TCURR. I want to know how do i get the today's currency rate from this table. Exchange rate type I'll be using is M.
Thanks,
Prasy
‎2008 Nov 11 2:17 AM
Hi,
For table TCURR, you can change the currency for the nearest date compared to current day.
But for using the FM: CONVERT_TO_LOCAL_CURRENCY,you can change the currency for the current day if you filled in the date below. You can have a try.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
*date = sy_datum*
foreign_amount = '1000'
foreign_currency = 'USD'
local_currency = 'EUR'
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
* IMPORTING
* EXCHANGE_RATE =
* FOREIGN_FACTOR =
* LOCAL_AMOUNT =
* LOCAL_FACTOR =
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
* 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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Hope it is useful.
Regards,
Chris Gu
‎2008 Nov 10 10:10 PM
Hi,
You can use function module 'CONVERT_TO_LOCAL_CURRENCY'.
Jamie
‎2008 Nov 11 2:17 AM
Hi,
For table TCURR, you can change the currency for the nearest date compared to current day.
But for using the FM: CONVERT_TO_LOCAL_CURRENCY,you can change the currency for the current day if you filled in the date below. You can have a try.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
*date = sy_datum*
foreign_amount = '1000'
foreign_currency = 'USD'
local_currency = 'EUR'
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
* IMPORTING
* EXCHANGE_RATE =
* FOREIGN_FACTOR =
* LOCAL_AMOUNT =
* LOCAL_FACTOR =
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
* 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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Hope it is useful.
Regards,
Chris Gu