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

Code hint please

Former Member
0 Likes
353

I am getting a field value like this

Lf_string = u2018abcdefghiu2019 . which might vary everytime . It could be different number of characters all the time ( upto 30 ).

I need to split it(for every 3 characters) and append it into the internal table

Then it should be like this ..

Itab[1]-f1 = u2018abcu2019

Itab[2]-f1 = u2018defu2019

Itab[3]-f1 = u2018ghiu2019

its not sticking me ..please help me .

2 REPLIES 2
Read only

Former Member
0 Likes
324

Here is the sample code.

data: l_c(30) type c,

l_first type i,

l_last type i.

data: begin of itab occurs 0,

l_c1(3) type c,

end of itab.

l_c = 'abcdefghijkl'.

clear: l_first.

l_last = 3.

do.

itab-l_c1 = l_c+l_first(l_last).

append itab.

l_first = l_last.

l_last = l_last + 3.

if itab is initial.

exit.

endif.

enddo.

loop at itab.

write:/ itab-l_c1.

endloop.

Read only

Former Member
0 Likes
324

Moderator message - Please do not ask or answer basic questions - thread locked Rob