一般命令

要斷開迴圈,可以使用命令 EXIT

DO.
    READ TABLE itab INDEX sy-index INTO DATA(wa).
    IF sy-subrc <> 0.
        EXIT. "Stop this loop if no element was found
    ENDIF.    
    " some code
ENDDO.

要跳到下一個迴圈步驟,可以使用命令 CONTINUE

DO.
    IF sy-index MOD 1 = 0.
        CONTINUE. " continue to next even index
    ENDIF.
    " some code  
ENDDO.

CHECK 語句是有條件的 CONTINUE。如果條件結果為,則將執行 CONTINUE。換句話說: 如果條件為真,迴圈將僅繼續執行步驟

這個例子是 CHECK ……

DO.
    " some code
    CHECK sy-index < 10.        
    " some code
ENDDO.

……相當於……

DO.
    " some code
    IF sy-index >= 10.
        CONTINUE.
    ENDIF.
    " some code
ENDDO.