ABAP-program processing logic control (STOP, exit, return, check, reject)

Source: Internet
Author: User

Stop command
Program location using this command
Initialization, at selection-screen, start-of-selection and get events
Handling instructions
1. When this command is executed in the initialization event, the system will directly trigger the sending of screen elements on the application server and client;
2. In other events, the execution of the end-of-selection event will be directly triggered. If you do not want to execute the end-of-selection, use return or exit.
Notes
 
Exit command
Program location using this command
Used in loops and program modules: Do and other processing modules (event block, dialog module, procedure (function module, method, subroutine ))... enddo, while... endwhile, loop... endloop, select... endselect
Handling instructions
1. In loop processing, exit only jumps out of the current loop;
2. In the start-of-selection, get, end-of-selection event, the list output is directly triggered, and the end-of-selection event is not executed. If no list output exists, the system will directly return to the selection screen;
3. For procedure, the system returns the call;
Notes
SAP recommends that exit be used only for loop processing. Use return for the processing module.
 
Return command
Program location using this command
Used in the processing module (event block, dialog module, procedure (function module, method, subroutine ))
Handling instructions
1. For procedure, return will exit the current processing module unconditionally without affecting the subsequent execution of the module;
2. for start-of-selection, get, end-of-selection events, the list output is directly triggered and the end-of-selection event is not executed. If no list output is available, the system will directly return to the selection screen;
Notes
Return will exit the current processing module regardless of the number of loops. This is different from exit.
 
Check command
Program location using this command
Used in loops and program modules: Do and other processing modules (event block, dialog module, procedure (function module, method, subroutine ))... enddo, while... endwhile, loop... endloop, select... endselect
Handling instructions
1. In loop processing, check continues to be adjusted to the next loop instead of subsequent processing of this loop;
2. In the start-of-selection, get, end-of-selection event, only subsequent code execution in this event is interrupted, and the processing of other subsequent modules is not affected, this is different from exit and return;
3. For calls returned by the procedure system without loops;
4. For the get event of the logical database, the system will exit this record and read the sub-node, and the next record will be processed;
Notes
SAP recommended check is only used for loop processing. Use return for the processing module.

!!!
In a condition control statement (if while case), use check not only to exit the condition block, but to exit the entire procedure or event block!

Reject command
Program location using this command
In the get Processing Event of the logical database
Handling instructions
The reject process is similar to check, but unlike check: If reject also exits in the loop, check only exits the loop and does not exit the process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.