2013 Oct 11 11:15 AM
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
2013 Oct 11 11:27 AM
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
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
2013 Oct 11 11:27 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |