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

COMMA

Former Member
0 Likes
837

Hi

i want to insert comma to number but the data-elemet will be char

for exampe 123456 will be 123,456 but in type char

How can i do it?

Thanks

habe a nice day

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
803

hi Yossi,

Pass it to type P vaiable ..or use offset this way ..


data : var(10) value '100000',
       var1(10),
       var2(10) .

 var1 = var+0(3).
 var2 = var+2(3).

 concatenate var1 var2 in to var separated by ','.

Regards,

Santosh

7 REPLIES 7
Read only

Former Member
0 Likes
803
data: kis1(15) value'123456789'.
data: kis2 type p.

kis2 = kis1.
write: kis2.
Read only

0 Likes
803

Hi

I dont want to change the data type to p its must be char because some time i insert to this field text and sometimes i insert number

thanks

Read only

Former Member
0 Likes
804

hi Yossi,

Pass it to type P vaiable ..or use offset this way ..


data : var(10) value '100000',
       var1(10),
       var2(10) .

 var1 = var+0(3).
 var2 = var+2(3).

 concatenate var1 var2 in to var separated by ','.

Regards,

Santosh

Read only

0 Likes
803

Hi

i cant do it because it table that i print and sometimes i have text and sometimes i have number so if it will be p parameter i will get dump

thanks

Read only

0 Likes
803

u can make the condn on variable like.

data:kis1(15),
       kis2  type p,
       kis3(15)
if kis1 co '0123456789'.
kis2 = kis1.
elseif kis1 co sy-abcd.
kis3 = kis1.
end if.

now print variable according to ur requirment....

null

Read only

0 Likes
803

hi

try this wat

data: kis1(15) value'123456789'.

data: kis2 type p.

kis2 = kis1.

write: / kis2.

write kis2 to kis1.

write: / kis1.

so u donnot change the type

Read only

Former Member
0 Likes
803

Hello,

Just write your numeric field into a character type field.

WRITE NUMFIELD TO CHARFIELD.

The system will automatically put in the commas.

Regards,

Erwin