ABAP Loops Do Loop


Example

Without any addition the DO-Loop runs endless or at least until it gets explicitly exited from inside. The system field sy-index will be increased for every loop step.

DO.
* do something... get it?
* call EXIT somewhere
ENDDO.

The TIMES addition offers a very convenient way to repeat code (amount represents a value of type i).

DO amount TIMES.
* do several times
ENDDO.