分类:
2008-04-12 08:42:05
DATA: BEGIN OF LINE2,
COL1 TYPE I,
COL2 TYPE C,
END OF LINE2.
DATA ITAB2 LIKE LINE2 OCCURS 10.
DATA ITAB3 LIKE LINE2 OCCURS 10.
LINE1-COL1 = 1. APPEND LINE1 TO ITAB1.
LINE1-COL1 = 4. APPEND LINE1 TO ITAB1.
LINE1-COL1 = 5. APPEND LINE1 TO ITAB1.
LINE2-COL1 = 9. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 1. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 2. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 3. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 4. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 5. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.
DATA V_I TYPE I.
V_I = 1.
loop at ITAB1 into LINE1 .
loop at ITAB2 into line2 from v_i where COL1 = LINE1-col1.
if LINE1-col1 = LINE2-col1 .
APPEND line2 TO ITAB3.
V_I = V_I + 1 .
else.
exit.
endif.
endloop.
endloop.
loop at ITAB3 into line2 .
write : / line2-col1.
endloop.