data: NUM type I, STR(1). while SY-INDEX < 10. STR = SY-INDEX. NUM = NUM + SY-INDEX. if SY-INDEX > 1. write '+'. endif. write STR. endwhile. write: '=', NUM.
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45
data: NUM type I, STR(1). while SY-INDEX < 10. STR = SY-INDEX. NUM = NUM + SY-INDEX. if SY-INDEX > 1. write '+'. endif. write STR. endwhile. write: '=', NUM.
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45