‎2007 Jun 25 8:39 AM
Hi friends,
In uploading file I have a field contains the value 1,600.00 and currency is USD. Suppose if I upload this file in EUR currency then I need to convert above 1,600 dollars automatically to EUR. How to do this?
Please help me.
Thanks .
‎2007 Jun 25 8:45 AM
Hello Bharat,
U can't convert the value directly. First upload the file to an itab. then do like this.
DATA : L_NETWR TYPE VBAP-NETWR.
loop at itab.
if itab-waers ne 'USD'.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = SY-DATUM
FOREIGN_AMOUNT = '10.00' " Amount from itab
FOREIGN_CURRENCY = 'EUR'
LOCAL_CURRENCY = 'USD'
IMPORTING
LOCAL_AMOUNT = itab-NETWR
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
modify itab.
endif.
endloop.
Regards,
VAsanth
‎2007 Jun 25 8:47 AM
Hi thank you,
The problem is due to the Std price format of US. It appears as 1,660.00 in the upload file, whereas the program tries to read this in European format.How to correct this.
Thanks.
‎2007 Jun 25 8:51 AM
Bharat,
First upload the file in original currency ( Here USD ) with the help of
FM 'GUI_UPLOAD' to an internal table .
Now loop this internal table and convert the values to the target currency
using the FM 'CONVERT_TO_FOREIGN_CURRENCY'
You can check other FMs for conversion .
convertcurrency* and do an F4
~ Laxmi
Reward all helpful answers
‎2007 Jun 25 8:51 AM
Hi bharat,
u can use the function module CURRENCY_CONVERT_TO_EURO for ur requirement.
r else u can go the fm convert_to_local_currency.
Regards...
Arun.
Reward points if useful.