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

Problem With Conversion....?

aarif_baig
Active Participant
0 Likes
703

Hi Abapers,

I have developed a FM which is used for sending SMS

Now my Problem is that to send sms i have converted the amount field into string

But the requirement is such that where if suppose

5000 how can i insert comma there, as the values are dynamic

it can be 25000 it can be any thing and accordingly the comma has to be adjusted

Because of which i cant even define particular position where the comma has to be inserted

as the values are dynamic,

Is there any way to solve this problem...?

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
660

You will get a idea with this


DATA : value TYPE i ,
       out type char255.
value = '12345'.
write value to out.
condense out.
write out.

in your case move 'out' to your string

Here the separators will be placed as of your user profile settings.

5 REPLIES 5
Read only

Former Member
0 Likes
660

Hi,

You can use the following Function Modules

BAPI_CURRENCY_CONV_TO_EXTERNAL

Just enter the type of currency you want and the amount which is converted into string

Regards,

Harini.S

Read only

0 Likes
660

Thanks for ur reply,

But this is like coming back to where i started from as i have already mentioned that

i have converted the amount field to string

The FM u gave me will again convert the string into currency type

Edited by: Aarif Baig on Sep 10, 2009 12:39 PM

Edited by: Aarif Baig on Sep 10, 2009 12:40 PM

Read only

0 Likes
660

Hi,

You have to mention the string value in the function module,which in turn will return the value with '.' and ','.Otherwise send me your code i will help you.

Regards,

Harini.S

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
661

You will get a idea with this


DATA : value TYPE i ,
       out type char255.
value = '12345'.
write value to out.
condense out.
write out.

in your case move 'out' to your string

Here the separators will be placed as of your user profile settings.

Read only

0 Likes
660

Thanks Keshu ,

Its working and i have given you the points ...