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 Issue

Former Member
0 Likes
874

Hi Experts,

Can anybody tell me the function module or any other way to determine proper decimal places in amount ,depending upon currency?

Ex. If input is 100 inr it should take it as 100.00 ie 2 digits after decimal place.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
824

Hi,

try this function module..

CONVERT_TO_FOREIGN_CURRENCY

It will convert from local to foriegn currency automatically.

CONVERT_TO_LOCAL_CURRENCY

dis will convert from foriegn to local currency..

Hope it will helpful in future also..

Regards

Kiran

Edited by: Kiran Saka on Feb 9, 2009 7:42 AM

7 REPLIES 7
Read only

Former Member
0 Likes
825

Hi,

try this function module..

CONVERT_TO_FOREIGN_CURRENCY

It will convert from local to foriegn currency automatically.

CONVERT_TO_LOCAL_CURRENCY

dis will convert from foriegn to local currency..

Hope it will helpful in future also..

Regards

Kiran

Edited by: Kiran Saka on Feb 9, 2009 7:42 AM

Read only

Former Member
0 Likes
824

hello,

Try with this FM

CURRENCY_CONVERT

Thank u,

santhosh

Read only

Former Member
0 Likes
824

hi...

prefer to use code in place of function module cause if you use function module in program it will unneccesserily load full function group in same internal session

take a data object w_char of type string like:::

data: w_char type string.

write curr_field to w_char.

write: w_char.

you ll get your work done.

Regards

Edited by: Mohit Kumar on Feb 9, 2009 7:44 AM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
824

Hello Aisha,

If you declare the variable / field as a CURR data type it will have decimal places by default.

What exactly is your requirement, please be more clear ?

BR,

Suhas

Read only

Former Member
0 Likes
824

I got vbrp-inetwr. Now I want to display it . But depending upon the currency decemal places in the field should be adjusted before display.

please help.

Read only

Former Member
0 Likes
824

Hi,

You can check the table TCURX.

Regards,

Omkaram.

Read only

Former Member
0 Likes
824

Hi ,

You can try it out---

data w_val type string.

CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'

EXPORTING

  • CLIENT = SY-MANDT

date = sy-datum

foreign_currency = 'USD'

local_amount = 1

local_currency = 'INR'

  • RATE = 0

  • TYPE_OF_RATE = 'M'

  • READ_TCURR = 'X'

IMPORTING

EXCHANGE_RATE = w_val

  • FOREIGN_AMOUNT =

  • FOREIGN_FACTOR =

  • LOCAL_FACTOR =

  • EXCHANGE_RATEX =

  • DERIVED_RATE_TYPE =

  • FIXED_RATE =

EXCEPTIONS

NO_RATE_FOUND = 1

OVERFLOW = 2

NO_FACTORS_FOUND = 3

NO_SPREAD_FOUND = 4

DERIVED_2_TIMES = 5

OTHERS = 6

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

Pinaki