内表中查找重复数据
2016-09-24 本文已影响132人
SmalltalkVoice
REPORT zhello.
DATA: BEGIN OF item OCCURS 0,
index TYPE i,
END OF item.
DATA: in TYPE i.
item-index = 1.
APPEND item.
item-index = 2.
APPEND item.
item-index = 3.
APPEND item.
item-index = 2.
APPEND item.
SORT item by index. "必须做排序动作
LOOP AT item.
AT NEW index.
in = 0.
ENDAT.
in = in + 1.
AT END OF index.
IF in NE 1.
WRITE: 'double item'.
ENDIF.
ENDAT.
ENDLOOP.