CHECK,EXIT,STOP etc...

CHECK
If the check statement appears in a LOOP process block, the unfufilled condition check will stop processing rest codes and do next loop.
If the check statement appears in a EVENT block, the unfufilled condition check will stop current event process and jump to next evetn.

EXIT
If you use the EXIT statement within an event block but not in a loop, the system stops processing the block immediately.If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block.

STOP
If you use the STOP statement within an event block, the system stops processing the block immediately.Before and during selection screen processing, the next event in the prescribed sequence is always called. From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement. Once the corresponding event block has been processed, the system displays the list.

RETURN
If the return occurs in a subroutine, the system will jump out the subroutine processing. If the return occurs in event block processing, system will stop the program directly.
e.g.
START-OF-SELECTION.
  PERFORM frm_test.
  return.
  WRITE / 'start of selection'.

END-OF-SELECTION.
  WRITE / 'end of selection'.
*&---------------------------------------------------------------------*
*&      Form  frm_test
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM frm_test.
  DO 5 TIMES.
    IF sy-index = 2.
      RETURN.
      WRITE 'IF STATEMENT'.
    ENDIF.
    WRITE: 'DO', sy-index.
  ENDDO.
  WRITE / 'END'.
ENDFORM.                    "frm_test

你可能感兴趣的:(REST)