Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

upload

Former Member
0 Likes
547

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 .

4 REPLIES 4
Read only

Former Member
0 Likes
524

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

Read only

0 Likes
524

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.

Read only

Former Member
0 Likes
524

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

Read only

Former Member
0 Likes
524

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.