itab = VALUE #( FOR j = 1 WHILE j <= 100 ( j ) ).
* Reduce 后面跟类型
* A constructor expression with the reduction operator
* REDUCE creates a result of a data type specified using type
* from one or more iteration expressions.
* At least one variable or one field symbol must be specified. The variables or field symbols declared after
* INIT can only be used after NEXT.
* At least one iteration expression must then be specified using FOR and it is also possible to specify multiple
* consecutive iteration expressions.
DATA(sum) = REDUCE i( INIT x = 0 FOR wa IN itab NEXT x = x + wa ).
WRITE: / sum.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
来源:CSDN
作者:汪子熙
链接:https://blog.csdn.net/i042416/article/details/104002491