abap append 用法

【转自http://blog.chinaunix.net/uid-7982817-id-91999.html】
Append用法总结
 2008-11-14 11:42:19

分类:

Syntax

APPEND { wa 
       | {INITIAL LINE} 
       | {LINES OF jtab [FROM idx1] [TO idx2]} } 
   TO itab [SORTED BY comp] 
   [ {ASSIGNING <fs> [CASTING]} | {REFERENCE INTO dref} ].
 
Effect

Appends rows to an internal table itab.
 
Additions
wa 
Appends a workarea wa.

INITIAL LINE 
Appends an initial row. 
附加初始化行
 
LINES OF jtab [FROM idx1] [TO idx2] 
Appends the rows from idx1 to idx2 of the internal table jtab.
this statement alike:
附加内表行
要将部分或 全部内表附 加到另一个 内表中,请 使用 APPEND 语句,用法 如下:
语法
APPEND LINES OF <itab1> [FROM <n1>] [TO <n2>] TO <itab2>.
如果没有 FROM 和 TO 选项,该语 句将整个表 格 ITAB1 附加到 ITAB2 中。如果使 用这些选项 ,则可通过 索引 <n1> 
或 <n2> 指定 ITAB1 中要附加的 第一或最后 一行。
notice:
用该方式将 表格行附加 到另一个表 格中的速度 比在循环中 逐行进行附 加快3到4倍 。
在 APPEND 语句之后, 系统字段 SY-TABIX 包含附加的 最后一行的 索引。
 
SORTED BY comp 
Creates a ranking, which is sorted by the row component comp in descending order. 
创建一个队列,按降序排列
 
ASSIGNING <fs> [CASTING] 
Assigns an appended row to a field symbol <fs> and a casting can thus be carried out.

REFERENCE INTO dref 
Sets a data reference dref to an appended row.
原文地址:https://www.cnblogs.com/rainysblog/p/4502673.html