REPORT Y_CLY_TEST1.
DATA: BEGIN OF LT_DAT,
NAME1(20) VALUE 'XYZ',
KEY TYPE I VALUE 5000,
END OF LT_DAT,
BEGIN OF LT_OUT OCCURS 10,
NAME2(10),
KEY TYPE I,
END OF LT_OUT.
LT_OUT-NAME2 = 'ABC'.
LT_OUT-KEY = 100.
APPEND LT_OUT.
LT_OUT-NAME2 = 'HHH'.
LT_OUT-KEY = 70.
APPEND LT_OUT.
LT_OUT-NAME2 = 'ABC'.
LT_OUT-KEY = 10.
APPEND LT_OUT.
LOOP AT LT_OUT.
SUBTRACT-CORRESPONDING LT_OUT FROM LT_DAT.
ENDLOOP.
初始内表数据:
执行3次循环时的变化:name1 无变化, key 变化顺序 5000 - 100 - 70 - 10