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

Function module CONVERT_TO_FOREIGN_CURRENCY does not work

Former Member
0 Likes
7,525

Hi all,

I am using function module CONVERT_TO_FOREIGN_CURRENCY for converting INR to USD.

My input data is below

CLIENT                          200
DATE                            13.01.2009
FOREIGN_CURRENCY                USD
LOCAL_AMOUNT                    10000
LOCAL_CURRENCY                  INR
RATE                            0
TYPE_OF_RATE                    M
READ_TCURR                      X

I think data needs to be picked from table TCURR where i have 3 entries for this data

MANDT KURST  FCURR   TCURR   GDATU      UKURS        FFACT       TFACT

200   M      INR     USD     79918898      48,00000           0           0
200   M      INR     USD     79919498      50,00000           0           0
200   M      INR     USD     79989898      47,00000           0           0

But the CONVERT_TO_FOREIGN_CURRENCY does not return any value.

BAPI_EXCHANGERATE_GETDETAIL gives the exchange rate details correctly

Any suggestions on how to make this work. Any other settings or table to check ?

Thanks

Edited by: R V on Jan 13, 2009 10:08 AM

9 REPLIES 9
Read only

former_member195698
Active Contributor
0 Likes
3,572

are you testing it through se37 ?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
3,572

Hello RV,

Did you write a code to text this FM? Plz paste the same here.

If you are testing through SE37, plz scroll the screen to the extreme right, you will find the values there. Remember amounts are right justified )

The param READ_TCURR reads exchange rate from table TCURR.

I tried the same with your params & it works for me )

BR,

Suhas

Edited by: Suhas Saha on Jan 13, 2009 10:14 AM

Read only

Former Member
0 Likes
3,572

Hi ...if u r trying using se37...

put the date as

DATE : 01132009

and execute..scroll to rt ..ull get output

Read only

Former Member
0 Likes
3,572

Hi Saha,

Sorry i did not check properly and directly executed from SE37.

One thing is that EXCHANGE_RATE returns 40.50000 but according to my TCURR tablei don't have this entry.

The latest entry is the first record on 01.11.2008 (48,00000). Why does it pick 40.5 ?

Thanks

Read only

0 Likes
3,572

can u check the data in TCURR table with

KURST = M

FCURR = USD

TCURR = INR ?

Read only

Former Member
0 Likes
3,572

Hi Jolly,

Yes for these details it has 40.5.

Now when i change the input as

CLIENT                          200
DATE                            13.01.2009
FOREIGN_CURRENCY                INR
LOCAL_AMOUNT                    10000
LOCAL_CURRENCY                  USD
RATE                            0
TYPE_OF_RATE                    M
READ_TCURR                      X

it correctly picks EXCHANGE_RATE = 48.

Can you please explain why ? FOREIGN_CURRENCY is supposed to be USD ?

Thanks

Read only

0 Likes
3,572

If you read the documentation of the FM, it says.

" 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. If

this entry is not in the table, the key is re-read in reverse sequence."

So when you provide data like


CLIENT                          200
DATE                            13.01.2009
FOREIGN_CURRENCY                INR
LOCAL_AMOUNT                    10000
LOCAL_CURRENCY                  USD
RATE                            0
TYPE_OF_RATE                    M
READ_TCURR                      X

data is read from the table TCURR with FCURR = INR ( Foreign_currency) and TCURR = USD (Local Currency)

Regards,

Aj

Read only

Former Member
0 Likes
3,572

Hi Jolly and Saha,

Thank you

Edited by: R V on Jan 13, 2009 11:25 AM

Read only

Former Member
0 Likes
3,572

hi

you can try these CONVERT_AMOUNT_TO_CURRENCY

CONVERT_TO_FOREIGN_CURRENCY

CONVERT_TO_LOCAL_CURRENCY

hope this helps

regards

Aakash Banga