Syntax:
append lines of itab1 [ from n1 ] [ to n2 ] to itab2.
把内表 itab1 的 n1 到 n2 行内容附加到 itab2 内表中去.
前提是 itab1 与 itab2 结构完成相同.
REPORT z_af_036.
DATA: BEGIN OF wa_line,
col1 TYPE i,
col2 TYPE i,
END OF wa_line.
DATA: itab1 LIKE STANDARD TABLE OF wa_line.
DATA: itab2 LIKE STANDARD TABLE OF wa_line.
START-OF-SELECTION.
DO 3 TIMES.
wa_line-col1 = sy-index.
wa_line-col2 = sy-index ** 2.
APPEND wa_line TO itab1.
wa_line-col1 = sy-index.
wa_line-col2 = sy-index ** 3.
APPEND wa_line TO itab1.
ENDDO.
APPEND LINES OF itab1 TO itab2.
LOOP AT itab2 INTO wa_line.
WRITE:/ wa_line-col1,
wa_line-col2.
ENDLOOP.
ULINE.
APPEND LINES OF itab1 FROM 2 TO 3 TO itab2.
LOOP AT itab1 INTO wa_line.
WRITE:/ wa_line-col1,
wa_line-col2.
ENDLOOP.
ULINE.
LOOP AT itab2 INTO wa_line.
WRITE:/ wa_line-col1,
wa_line-col2.
ENDLOOP.
阅读(1425) | 评论(0) | 转发(0) |