‎2010 Jan 11 9:49 AM
1) Firstly i need to calculate Exchange rates for currencies SEK EUR & THB.
my question here are
a) do we need FROM currency(XYZ) while calculating exchange rates for SEK, EUR, THB ?
b) Is there any FM we can use to calc exchange rates ..or can we do it programatically ?
2) Also at one point in the prog when i get amount in some XYZ currency(which never matches with either of SEK, EUR & THB). then i need to convert this amount into 3 currencies viz (SEK, EUR & THB)
a) Again are there any FM's to do ?
b) as we get exch rates from above ...how can i use them to convert from XYZ to SEK/EUR/THB ?
‎2010 Jan 11 10:44 AM
Hi,
is your issue resolved... or else try this way.
DATA: l_fcurr TYPE tcurr-fcurr,
l_lcurr TYPE tcurr-tcurr,
l_exchange_rt TYPE tcurr-ukurs.
MOVE: p_local_curr TO l_lcurr,
p_foreign_curr TO l_fcurr.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = p_date
foreign_amount = p_foreign_amt
foreign_currency = l_fcurr
local_currency = l_lcurr
rate = 0
type_of_rate = 'M'
read_tcurr = 'X'
IMPORTING
exchange_rate = l_exchange_rt
local_amount = p_local_amt
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.
CLEAR p_ex_rate.
ELSE.
MOVE l_exchange_rt TO p_ex_rate.
ENDIF.
ENDFORM. " currency_conv
‎2010 Jan 11 9:53 AM
check the FM: CONVERT_TO_FOREIGN_CURRENCY or CONVERT_TO_LOCAL_CURRENCY(whichever suits you)?
‎2010 Jan 11 9:54 AM
You can use fm READ_EXCHANGE_RATE,
Pass type_of_rate = 'M'.
The formula goes like ,
erate = exchange_rate / ( local_factor / foreign_factor ).
Now just multiply your value with the erate.
‎2010 Jan 11 10:02 AM
Hi All,
When i use
DATE 20.10.2009
FOREIGN_AMOUNT 1234
FOREIGN_CURRENCY SEK
LOCAL_CURRENCY EUR
RATE 1
TYPE_OF_RATE M
READ_TCURR X
i get
DERIVED_RATE_TYPE EURX
‎2010 Jan 11 10:12 AM
In TCURR there must be a entry FCURR = SEK and TCURR = EUR for rate type KURST = M.
‎2010 Jan 11 10:55 AM
‎2010 Jan 11 10:01 AM
Hi,
Try using the FM "HR_ECM_CONVERT_CURRENCY" or "CONVERT_CURRENCY_BY_RATE".
Regards,
Aditya
‎2010 Jan 11 10:44 AM
Hi,
is your issue resolved... or else try this way.
DATA: l_fcurr TYPE tcurr-fcurr,
l_lcurr TYPE tcurr-tcurr,
l_exchange_rt TYPE tcurr-ukurs.
MOVE: p_local_curr TO l_lcurr,
p_foreign_curr TO l_fcurr.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = p_date
foreign_amount = p_foreign_amt
foreign_currency = l_fcurr
local_currency = l_lcurr
rate = 0
type_of_rate = 'M'
read_tcurr = 'X'
IMPORTING
exchange_rate = l_exchange_rt
local_amount = p_local_amt
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.
CLEAR p_ex_rate.
ELSE.
MOVE l_exchange_rt TO p_ex_rate.
ENDIF.
ENDFORM. " currency_conv
‎2010 Jan 11 10:58 AM