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

Split one column into two columns ?

Former Member
0 Likes
524

Hi,

I have an internal table with a column filled with data. What I want to do is to get every second line (odd or even lines) and fill another column using that selection.

Can anyone help me do that ?

Thanks

1 ACCEPTED SOLUTION
Read only

former_member187651
Active Participant
0 Likes
382

Hello Sheklqim,

You can use the code below...

data n type i,

       count type i.

n = 2.

Loop at lt_itab into ls_itab  "main internal table

count = count + 1.

if count = n .

n = n + 2.

...get the value from work area 1st column.

...fill the second column of itab..

endif.

endloop.

Hope your problem resolved...

Regards,

Chandan

1 REPLY 1
Read only

former_member187651
Active Participant
0 Likes
383

Hello Sheklqim,

You can use the code below...

data n type i,

       count type i.

n = 2.

Loop at lt_itab into ls_itab  "main internal table

count = count + 1.

if count = n .

n = n + 2.

...get the value from work area 1st column.

...fill the second column of itab..

endif.

endloop.

Hope your problem resolved...

Regards,

Chandan