用ABAP代码实现从1累加到100
生活随笔
收集整理的這篇文章主要介紹了
用ABAP代码实现从1累加到100
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
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的原創(chuàng)文章,請關(guān)注公眾號"汪子熙":
總結(jié)
以上是生活随笔為你收集整理的用ABAP代码实现从1累加到100的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html5之本地数据库
- 下一篇: 如何免费获得Gartner关于field