SAP内表COLLECT语句的官方解释(keyword documentation) ...

ABAP编程的时候,可能需要对内表的多条数据进行合并:内表中的字段有字符串类型和数字类型;
在名为BC402的PA教材的appendix中,对COLLECT语句的功能进行了描述
SAP内表COLLECT语句的官方解释(keyword documentation)
...
语句的格式
COLLECT wa INTO itab

wa其实表示 work area
itab 估计就是internal table
COLLECT语句允许你,把内表itab的内容进行累计。这个过程会使用table key。工作的过程如下所示:

  1. the runtime system 会check内表itab中是否存在the same key values as the line in wa
  2. 如果没有,系统会向内表itab中用这个key为主键,插入一条新line。这条语句的效果类似于(INSERT wa INTO TABLE itab)
  3. 如果内表itab中之前已经存在了一个拥有和wa同样key值的record,系统会将wa中【数字类型的同时也是non-key字段】的内容,累加到itab中对应的字段中去。
  4. 更多有关于COLLECT语句的细节,请参考COLLECT语句的 the keyword documentation
    SAP内表COLLECT语句的官方解释(keyword documentation)
...

BC400中也有一两个图描述了有关于COLLECT语句的含义
SAP内表COLLECT语句的官方解释(keyword documentation)
...
SAP内表COLLECT语句的官方解释(keyword documentation)
...
什么是keyword documentation?这个问题都问,说明你是个初学者啊
SAP内表COLLECT语句的官方解释(keyword documentation)
...