cancel
Showing results for 
Search instead for 
Did you mean: 

i want to display output by using shift with a single variable?

Former Member
0 Kudos

hi,

i am shabeer ahmed abap fresher i want

ex:-

data: st1 value 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'.

do 27 times.

split st1 at ',' into sy-index.

write:/ sy-index.

enddo.

i want output like: a

b

c

.

.

z.

then the above code will not becoz sy-index in int type. but i want output like as displayed as above. what can i do plz suggest.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

shabeer ahmed

Try this code, it will work and gives u solution

data : Begin of itab occurs 0,

char(10) type c.

data : string type string.

data : st1 type strng.

st1 = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'.

move st1 to string.

split string at ',' into table itab.

loop at itab.

write 😕 itab-char.

endloop.

with regards

Kiran.G

Former Member
0 Kudos

hi kiran,

ya code really very helped me thanks for that is there any other way.

means we can not display output by using variable instead of using internal table.

if plz send it to me any how once again thanks for ur help.

bye.

shaik.shabeer ahmed

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

1,Declare a variable Like g_var Type c.

use this:

split st1 at ',' into g_var.

write:/ g_var.

Regards,

Kumar(Reward if helpful).

Former Member
0 Kudos

hi kumar,

i tried as u said but it does not working the split statement does not accepting single variable. if we give two variables means it working

so any other way of it. if u find plz forward me.

bye.

shaik.shabeer ahmed