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
412

Hi,

Please tell me how to convert the amounts from TWD to CAD.

Is there any FM i can use for it?

I tried with convert to foreign currecny,,and local currecny one..but no use..

TIA.

3 REPLIES 3
Read only

Former Member
0 Likes
391

Use FM 'CONVERT_TO_FOREIGN_CURRENCY'

REPORT ZEXAMPLE.

DATA: XRATE TYPE F,

FAMT TYPE P,

FFACT TYPE F,

LFACT TYPE F.

PARAMETERS: FCURR LIKE TCURC-WAERS,

LCURR LIKE TCURC-WAERS,

LAMT TYPE P.

CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'

EXPORTING

DATE = SY-DATUM

FOREIGN_CURRENCY = FCURR

LOCAL_AMOUNT = LAMT

LOCAL_CURRENCY = LCURR

IMPORTING

EXCHANGE_RATE = XRATE

FOREIGN_AMOUNT = FAMT

FOREIGN_FACTOR = FFACT

LOCAL_FACTOR = LFACT

EXCEPTIONS

NO_RATE_FOUND = 1

OVERFLOW = 2

NO_FACTORS_FOUND = 3

NO_SPREAD_FOUND = 4

DERIVED_2_TIMES = 5

OTHERS = 6.

IF SY-SUBRC EQ 0.

WRITE:/ LAMT, 'CONVERTED FROM', LCURR, 'TO', FCURR, 'IS:', FAMT.

WRITE:/ 'EXCHANGE RATE:', XRATE,

/ 'FOREIGN FACTOR:', FFACT,

/ 'LOCAL FACTOR:', LFACT.

ELSE.

WRITE:/ LAMT, 'NOT CONVERTED'.

ENDIF.

Regards,

Joy.

Read only

bpawanchand
Active Contributor
0 Likes
391

Hi

USe

CURRENCY_CONVERT

CONVERT_CURRENCY_BY_RATE

Regards

Pavan

Edited by: Pavan Bhamidipati on Jul 7, 2008 3:57 PM

Read only

0 Likes
391

Hi

For second FM i cannot give RATE,,,as TWD to CAD i dont have any rate in TCURR....any advice??