REPORT z_barry_test NO STANDARD PAGE HEADING .
DATA: BEGIN OF it1 OCCURS 0 ,
str(200) ,
END OF it1.
DATA: it2 LIKE it1[] WITH HEADER LINE ,
ita LIKE it1[] WITH HEADER LINE ,
itb LIKE it1[] WITH HEADER LINE ,
itc LIKE it1[] WITH HEADER LINE .
EDITOR-CALL FOR: it1 TITLE 'A列' ,
it2 TITLE 'B列' .
SORT: it1,it2.
DELETE it1 WHERE str = '' .
DELETE it2 WHERE str = '' .
LOOP AT it1 .
READ TABLE it2 WITH KEY str = it1-str BINARY SEARCH.
IF sy-subrc <> 0 .
ita-str = it1-str.
APPEND ita.
ELSE.
itc-str = it1-str.
APPEND itc.
ENDIF.
ENDLOOP.
LOOP AT it2.
READ TABLE it1 WITH KEY str = it2-str BINARY SEARCH.
IF sy-subrc <> 0.
itb-str = it2-str.
APPEND itb.
ENDIF.
ENDLOOP.
EDITOR-CALL FOR: ita DISPLAY-MODE TITLE 'A存在,B不存在(A - B)' ,
itb DISPLAY-MODE TITLE 'B存在,A不存在(B - A)' ,
itc DISPLAY-MODE TITLE 'AB同时存在' .
阅读(2805) | 评论(0) | 转发(0) |