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

Currency conversion

Former Member
0 Likes
994

Hi.

I have to convert currency from for Example CAD to USD

I used

call function 'CONVERT_AMOUNT_TO_CURRENCY'

exporting

DATE = sy-datum

foreign_currency = 'CAD'

foreign_amount = 2000

local_currency = 'USD'

IMPORTING

LOCAL_AMOUNT = amount.

I did not got the expected output. The outputr which i got is

Import parameters Value

DATE 2005/05/02

FOREIGN_CURRENCY CAD

FOREIGN_AMOUNT 2000

LOCAL_CURRENCY USD

Export parameters Value

LOCAL_AMOUNT

Tables Value

T_C_ERRORS 0 Entries

Result: 0 Entries

Please help me solve this

Thanks & regards

sree

4 REPLIES 4
Read only

MauricioMiao
Contributor
0 Likes
750

Hello Sree,

In my system, for the same values, this function is returning a error message in T_C_ERROS.

This function reads tables TCURV and TCURF (Factor conversion).

Problably the problem is that you don´t have a conversion rate in table TCURF for this parameters.

If you debug the function, you will find wich table is missed.

I don´t have knowledge on how to maintain this tables and what this maintanace could affect.

I think that an FI functional person could help you on how to maintain it.

Regards,

Mauricio

Read only

andreas_mann3
Active Contributor
0 Likes
750

Hi,

have a look here:

Andreas

Read only

Former Member
0 Likes
750

Hi,

Try the below code.

REPORT zc1_currency_conversion .

DATA: loc_umsa1 LIKE kna1-umsa1.

CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY'

EXPORTING

foreign_currency = 'CAD'

foreign_amount = 450

local_currency = 'USD'

IMPORTING

local_amount = loc_umsa1

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc = 0.

WRITE:/ 'Converted amount is:' , loc_umsa1.

ELSE.

WRITE:/ 'Error in conversion'.

ENDIF.

Incase the funtion module is workign properly,

Try these modules,

CONVERT_TO_FOREIGN_CURRENCY or CONVERT_TO_LOCAL_CURRENCY.

Hope this will be helpful.

Cheers

Kathir~

Read only

0 Likes
750

Hi,

I see that there are lots of FM that converts a currency from one to another.

I need a Method inside a abap class that do the same!

Any clue where to search for this (i don't what to use FM.)?

//Martin