‎2008 Feb 01 1:38 PM
hi,
I am using FM 'convert_to_foreign_currency'.
Iam giving USD 500 , and I want in GBP.
but the output id 3 GBP.
Is there any function module which solves my issue.
its urgent plz.
regards
Parthu
‎2008 Feb 01 2:02 PM
hi
good
check this
Goto transaction SU3.
goto DEFAULT tab
Change the DECIMAL NOTATION as per your requirement
SAVE
(OR)
lv_text = 12,000.
CALL FUNCTION 'STRING_REPLACE'
EXPORTING
pattern = ','
substitute = space
changing
text = lv_text
EXCEPTIONS
WRONG_STRING_LENGTH = 1
OTHERS = 2.
(OR)
Look at the function module BAPI_CURRENCY_CONV_TO_INTERNAL
thanks
mrutyun^
‎2008 Feb 01 1:46 PM
Hi,
Please look at the sample code below :
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = gv_firstday
foreign_amount = wrbtr
foreign_currency = 'GBP'
local_currency = 'USD'
type_of_rate = 'M'
IMPORTING
exchange_rate = cv_lv_ukurs
local_amount = cv_vallc1
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.
Thanks,
Sriram Ponna.
‎2008 Feb 01 2:02 PM
hi
good
check this
Goto transaction SU3.
goto DEFAULT tab
Change the DECIMAL NOTATION as per your requirement
SAVE
(OR)
lv_text = 12,000.
CALL FUNCTION 'STRING_REPLACE'
EXPORTING
pattern = ','
substitute = space
changing
text = lv_text
EXCEPTIONS
WRONG_STRING_LENGTH = 1
OTHERS = 2.
(OR)
Look at the function module BAPI_CURRENCY_CONV_TO_INTERNAL
thanks
mrutyun^
‎2008 Feb 01 2:41 PM
‎2008 Feb 01 2:09 PM
I've tried like this...I'm getting output as '333'.
DATA : f_amount(16) TYPE p.
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date = sy-datum
foreign_currency = 'GBP'
local_amount = '500'
local_currency = 'USD'
type_of_rate = 'M'
IMPORTING
foreign_amount = f_amount.
WRITE :/ f_amount.