Skip to Content
Technical Articles

What does DO/ENDDO do?

Dear community, for the little fun in between here’s some ABAP to check:

DATA lv_count TYPE i VALUE 1.

DO lv_count TIMES.
    lv_count = lv_count + 1.
    WRITE / 'What am I doing?'.
ENDDO.

Simple question is: How often the loop is executed?

Possible answers:

  1. Once only.
  2. Over and over and over (never stops).

If you want to try it out quickly, you should use the transpiler by Lars Hvam. The right answer to the question above is available at help.sap.com.

 

Best regards, thanks for reading and stay healty

Michael

 

P. S.: Not tired of reading blogs? Check this one about ADT element info. Really great!

 

6 Comments
You must be Logged on to comment or reply to a post.