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

convert numeric string to numeric string with commas

Former Member
0 Likes
1,067

hi,

how can i convert 1222222.22 to 1,222,222.22 programmatically? both outputs should be in string format.

thanks!

5 REPLIES 5
Read only

Former Member
0 Likes
821

hi,

use write statement...

ex.

data: v_value type netpr value '12212332.34'.

DATA: V_STRING(18).

WRITE: V_VALUE TO V_STRING.

WRITE: / V_STRING.

Regards,

naren

Read only

Former Member
0 Likes
821

Hi Winnie,

Not too sure are you doing some conversion of currency, but you can try this FM 'HR_ECM_CONVERT_CURRENCY', like convert from myr to yen

Read only

Former Member
0 Likes
821

hi Chan,

do this way .. it works this way ..

data:ur_var(7) value '1000000'.

data: var(7) type p.

var = ur_var.

write: var.

Regards,

Santosh

Message was edited by: Santosh Kumar P

Read only

Former Member
0 Likes
821

Hi,

U can do like this

DATA: v_waers LIKE essr-waers VALUE 'SGD'.

i_report-netwr = 1222222.22 .

Then
      WRITE i_report-netwr TO v_netwr
          CURRENCY v_waers DECIMALS 2.

This solves ur problem.

Reward points if this answers ur question.

Read only

Former Member
0 Likes
821

hi

good

yes you can do ir

store 1222222.22 in a string

declare one character type with value ,

use a SPLIT statement to split the value 122222.22 and than use CONCATENATE statement to concatenate all the clue with ,(symbol).

thanks

mrutyun^