‎2007 Mar 16 9:26 AM
‎2007 Mar 16 9:30 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.
Kishore.
‎2007 Mar 16 9:30 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.
Kishore.
‎2007 Mar 16 9:32 AM
hi,
Use FM
CONVERT_TO_FOREIGN_CURRENCY
CONVERT_TO_LOCAL_CURRENCY
Regards,
Santosh
‎2007 Mar 16 9:34 AM
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY' " Convert to Manuf
EXPORTING " currency
DATE = ZVBRP-PRSDT
* date = sy-datum
FOREIGN_CURRENCY = T001-WAERS
LOCAL_AMOUNT = Z1KOMV-KWERT
LOCAL_CURRENCY = Z1KOMV-WAERS
* RATE = 0
TYPE_OF_RATE = 'M'
IMPORTING
FOREIGN_AMOUNT = Z1KOMV-KWERT
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
OTHERS = 5.
IF SY-SUBRC IS INITIAL.
IRPT-CINVAMT = IRPT-CINVAMT + Z1KOMV-KWERT.
ENDIF.
You can even use <b>MS_CONVERT_TO_OTHER_CURRENCY</b>
‎2007 Mar 16 9:36 AM
‎2007 Mar 16 9:36 AM
hi,
check this it may help you......
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = 001
DATE = sy-datum
FOREIGN_CURRENCY = wa1-WAERS " here you need to declare your foreign currency i.e EURO
LOCAL_CURRENCY = TCURR-FCURR "give USD
FOREIGN_AMOUNT = wa1-DMBTR " here you need to declare your amount field.
* RATE = tcurr-ukurs
TYPE_OF_RATE = 'M' " check this also the average rate
* READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE = tcurr-UKURS
* FOREIGN_FACTOR =
LOCAL_AMOUNT = wa1-TOTAL " this is the field where the converted amt has to be displayed.
* 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.Translate foreign currency amount to local currency
An amount in local currency is calculated from a specified foreign currency amount.
For this, you may either specify the translation rate manually (Parameter RATE)
or have the system determine it from table TCURR on the basis of the rate type, date and currency key.
Because the ratios for the units of the currencies involved in the translation are significant for this translation,
table TCURF is always read by the program, and there must be a valid entry there for the data specified.
IF exchange rate fixing is defined for the exchange rate type TYPE_OF_RATE or an alternative exchange rate is defined for the currency pair, this information is transferred to the calling program.
When table TCURR is read, the foreign currency key is always taken as the first part of the key and the local currency as the second part.
hope this helps you.
regards,
Anversha.S
‎2007 Mar 16 9:41 AM
CALL FUNCTION 'SD_CONVERT_CURRENCY'
EXPORTING
i_date = sy-datum
i_source_amount = vbap-zwert " Source Amt
i_source_currency = vbak-waerk " Source Currency
i_local_currency = vbak-waers " Local Currency
i_target_currency = w_waers " Target Currency
IMPORTING
e_target_amount = lv_zwert " Target Amount
EXCEPTIONS
no_rate_found = 1.