‎2008 Jul 01 8:51 AM
Hi
I have an internal table with 4 columns and the second column has values like shown below
A
B
C
D
1
2
3
D
1
2
3
4
D
1
2
3
4
5
i want to loop throught this table and take the values starting from first D to next D ( i.e., D, 1,2,3 ) into another internal table and do some processing. Next time i want to take D,1,2,3,4 into the same internal table and next time D,1,2,3,4,5 into that internal table. how do i do this??
thanks
sankar
‎2008 Jul 01 9:00 AM
LOOP AT wt_table1 INTO wa_table1.
IF wa_table1-field = 'D'.
IF wt_table2 IS NOT INITIAL.
PERFORM f_do_something TABLES wt_table2.
REFRESH wt_table2.
ENDIF.
APPEND wa_table1 TO wt_table2.
ELSE.
IF wt_table2 IS NOT INITIAL.
APPEND wa_table1 TO wt_table2.
ENDIF.
ENDIF.
ENDLOOP.
IF wt_table2 IS NOT INITIAL.
PERFORM f_do_something TABLES wt_table2.
ENDIF.
‎2008 Jul 01 9:00 AM
LOOP AT wt_table1 INTO wa_table1.
IF wa_table1-field = 'D'.
IF wt_table2 IS NOT INITIAL.
PERFORM f_do_something TABLES wt_table2.
REFRESH wt_table2.
ENDIF.
APPEND wa_table1 TO wt_table2.
ELSE.
IF wt_table2 IS NOT INITIAL.
APPEND wa_table1 TO wt_table2.
ENDIF.
ENDIF.
ENDLOOP.
IF wt_table2 IS NOT INITIAL.
PERFORM f_do_something TABLES wt_table2.
ENDIF.