Application Development 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: 

FM required

Former Member
0 Kudos

Hi All,

I need a FM which converts amount(say 12.50) to (1250).urgent..

regards,

kavitha

1 ACCEPTED SOLUTION

rajesh_akarte2
Active Participant
0 Kudos

Hi kavitha,

Rather than using the FM why don't u multiply the amount with 100.Doing this u will get desired result.

Reward if helpful.

Regards,

Rajesh Akarte

4 REPLIES 4

Former Member
0 Kudos

Hi,

Use this code...


DATA : amount TYPE char16.
amount = '12.58'. "your variable goes here

REPLACE ALL OCCURRENCES OF '.'  IN amount WITH ' '.
CONDENSE amount.

WRITE 😕 amount.

rajesh_akarte2
Active Participant
0 Kudos

Hi kavitha,

Rather than using the FM why don't u multiply the amount with 100.Doing this u will get desired result.

Reward if helpful.

Regards,

Rajesh Akarte

Former Member
0 Kudos

Hi..

Your required Currency Format is JPY where there are no cents .or decimals.

No Need for FM..

You can get required format with Write statement .

Please check "

Write l_value TO l_new CURRENCY 'JPY' .

Hope this helps .

Thanks .

mahaboob_pathan
Contributor
0 Kudos

Hi,

check this

DATA : amount TYPE char16.

data: v_amt type string.

PARAMETERS p_amt type string.

REPLACE ALL OCCURRENCES OF '.' IN p_amt WITH ' '.

CONDENSE p_amt.

WRITE 😕 p_amt.