语法:append lines of itab1 [ from n1 ] [ to n2 ] to itab2.
前提应该是要两个结构是一样的内表吧。
DATA:BEGIN OF gt_00 OCCURS 0,
l_01 TYPE i,
l_02 TYPE i,
l_03 TYPE i,
END OF gt_00.
DATA:gw_00 LIKE LINE OF gt_00.
DATA:BEGIN OF gt_01 OCCURS 0,
l_01 TYPE i,
l_02 TYPE i,
l_03 TYPE i,
END OF gt_01.
DATA:gw_01 LIKE LINE OF gt_01.
gw_00–l_01 = 1.
gw_00–l_02 = 1.
gw_00–l_03 = 1.
APPEND gw_00 TO gt_00.
gw_00–l_01 = 2.
gw_00–l_02 = 2.
gw_00–l_03 = 2.
APPEND gw_00 TO gt_00.
gw_00–l_01 = 3.
gw_00–l_02 = 3.
gw_00–l_03 = 3.
APPEND gw_00 TO gt_00.
gw_01–l_01 = 4.
gw_01–l_02 = 4.
gw_01–l_03 = 4.
APPEND gw_01 TO gt_01.
gw_01–l_01 = 5.
gw_01–l_02 = 5.
gw_01–l_03 = 5.
APPEND gw_01 TO gt_01.
gw_01–l_01 = 6.
gw_01–l_02 = 6.
gw_01–l_03 = 6.
APPEND gw_01 TO gt_01.
APPEND LINES OF gt_01 FROM 2 TO 3 TO gt_00.
LOOP AT gt_00 INTO gw_00.
write:/ gw_00–l_01,
gw_00–l_02,
gw_00–l_03.
ENDLOOP.
选择屏幕的完整实例
1 1 1
2 2 2
3 3 3
5 5 5
6 6 6
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/20135.html