DATA: BEGIN OF line,
col1(1) TYPE C,
col2 TYPE I,
END OF line.
DATA itab LIKE STANDARD TABLE OF line
WITH NON-UNIQUE KEY col2.
line-col1 = 'A'. line-col2 = 1.
APPEND line TO itab.
line-col1 = 'A'. line-col2 = 1.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 2.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 3.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 4.
APPEND line TO itab.
line-col1 = 'C'. line-col2 = 5.
APPEND line TO itab.
line-col1 = 'C'. line-col2 = 6.
APPEND line TO itab.
PERFORM list USING 'FIRST'.
DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.
PERFORM list USING 'SECOND'.
*
DELETE ADJACENT DUPLICATES FROM itab COMPARING col1.
PERFORM list USING 'THIRD'.
DELETE ADJACENT DUPLICATES FROM itab.
PERFORM list USING 'FORTH'.
FORM list USING P_TEXT TYPE STRING.
LOOP AT itab INTO line.
WRITE: / P_TEXT, line-col1, line-col2.
ENDLOOP.
ENDFORM.
댓글 3
-
컨설턴트킴
2008.06.30 22:02
와우~와우~와우~ -
바람나무
2008.09.16 01:53
*sort의 필요성 느끼기 ;;
REPORT z07_027 .
DATA: BEGIN OF line,
col1(1) TYPE C,
col2 TYPE I,
END OF line.
DATA itab LIKE STANDARD TABLE OF line
WITH NON-UNIQUE KEY col2.
line-col1 = 'C'. line-col2 = 5.
APPEND line TO itab.
line-col1 = 'C'. line-col2 = 6.
APPEND line TO itab.
line-col1 = 'A'. line-col2 = 1.
APPEND line TO itab.
line-col1 = 'A'. line-col2 = 1.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 3.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 2.
APPEND line TO itab.
line-col1 = 'B'. line-col2 = 4.
APPEND line TO itab.
PERFORM list USING 'FIRST'.
DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.
PERFORM list USING 'SECOND'.
DELETE ADJACENT DUPLICATES FROM itab COMPARING col1.
PERFORM list USING 'THIRD'.
DELETE ADJACENT DUPLICATES FROM itab.
PERFORM list USING 'FORTH'.
FORM list USING P_TEXT TYPE STRING.
LOOP AT itab INTO line.
WRITE: / P_TEXT, line-col1, line-col2.
ENDLOOP.
ENDFORM.
-
뺑기
2011.09.23 00:32
유용하게 썼습니다. ^^
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
191 | REPORT Z10_001 | sapjoy | 2008.04.15 | 2341 |
190 | REPORT Z07_033 | sapjoy | 2006.12.09 | 2317 |
189 | REPORT Z07_032 | sapjoy | 2007.09.13 | 2195 |
188 | REPORT Z07_030 [4] | sapjoy | 2006.12.09 | 2440 |
187 | REPORT Z07_028 [2] | sapjoy | 2008.04.15 | 2139 |
» | REPORT Z07_027 [3] | sapjoy | 2006.12.09 | 2376 |
185 | Report Z07_025 | sapjoy | 2007.09.13 | 2176 |
184 | REPORT Z07_023 | sapjoy | 2006.12.09 | 2255 |
183 | REPORT Z07_022 | sapjoy | 2006.12.09 | 2070 |
182 | REPORT Z07_021 [2] | sapjoy | 2006.12.09 | 2455 |
181 | REPORT Z07_020 | sapjoy | 2006.12.09 | 2157 |
180 | REPORT Z07_019 | sapjoy | 2006.12.08 | 2284 |
179 | REPORT Z07_018 | sapjoy | 2006.12.08 | 2341 |
178 | REPORT Z07_015 | sapjoy | 2006.12.08 | 2428 |
177 | REPORT Z07_014 | sapjoy | 2006.12.08 | 2098 |
176 | REPORT Z07_009 | sapjoy | 2006.12.07 | 2258 |
175 | REPORT Z07_003 | sapjoy | 2008.04.15 | 2151 |
174 | Z07_005 | sapjoy | 2006.12.07 | 2353 |
173 | Z07_001 | sapjoy | 2006.12.07 | 2397 |
172 | REPORT Z07_012 | sapjoy | 2006.12.08 | 2328 |