1. 程式人生 > >ABAP--關於ABAP流程處理的一些命令的說明 stop exit return check reject

ABAP--關於ABAP流程處理的一些命令的說明 stop exit return check reject

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

                  Stop 命令 使用該命令的程式位置 INITIALIZATION, AT SELECTION-SCREEN, START-OF-SELECTION和GET 事件中 處理說明
1、 當在INITIALIZATION事件執行該命令,系統將直接觸發應用伺服器和客戶端螢幕元素的傳送; 2、 在其他事件中將直接觸發END-OF-SELECTION事件的執行,如果不想執行END-OF-SELECTION,請使用 RETURN或者 EXIT. 注意事項   EXIT 命令 使用該命令的程式位置 用於迴圈和程式模組中: DO和其他處理模組中(event block, dialog module, procedure (function module, method, subroutine))
...ENDDO, WHILE...ENDWHILE, LOOP...ENDLOOP, SELECT...ENDSELECT 處理說明 1、 迴圈處理中,EXIT只跳出當前的迴圈; 2、 在START-OF-SELECTION, GET, END-OF-SELECTION事件中,將直接觸發List輸出,將不執行 END-OF-SELECTION 事件 ; 如果沒有 List 輸出,系統將直接返回選擇螢幕; 3、  對於procedure系統返回呼叫處; 注意事項
Sap推薦EXIT只是用於迴圈處理,對於處理模組請使用Return。   RETURN 命令 使用該命令的程式位置 用於處理模組中(event block, dialog module, procedure (function module, method, subroutine)) 處理說明 1、 對於procedure ,RETURN將無條件退出當前的處理模組,不影響後續模組的執行; 2、 對於START-OF-SELECTION, GET, END-OF-SELECTION事件中,將直接觸發List輸出,將不執行 END-OF-SELECTION 事件 ; 如果沒有 List 輸出,系統將直接返回選擇螢幕; 注意事項 RETURN不管存在多少層次的迴圈,將直接退出當前處理模組,這一點和EXIT不同   CHECK 命令 使用該命令的程式位置 用於迴圈和程式模組中: DO和其他處理模組中(event block, dialog module, procedure (function module, method, subroutine))...ENDDO, WHILE...ENDWHILE, LOOP...ENDLOOP, SELECT...ENDSELECT 處理說明 1、 迴圈處理中, CHECK只是不執行本次迴圈的後續處理,繼續調到下一次迴圈; 2、 在START-OF-SELECTION, GET, END-OF-SELECTION事件中,只是中斷本事件內的後續程式碼的執行 ,不影響其他後續模組的處理,這和EXIT,RETURN是不同的; 3、  對於沒有迴圈procedure系統返回呼叫處; 4、 對邏輯資料庫的GET事件,系統退出本次紀錄和子節點的讀取處理,將繼續下一條紀錄的處理; 注意事項 Sap推薦CHECK只是用於迴圈處理,對於處理模組請使用Return。   REJECT 命令 使用該命令的程式位置 用於邏輯資料庫的GET處理事件中 處理說明 REJECT的處理類似CHECK,但和CHECK不同的是:REJECT如果在迴圈內也同樣退出本次的處理,而CHECK只是退出迴圈,不退出處理 注意事項     MESSAGE 命令 使用該命令的程式位置   處理說明 MESSAGE在不同程式位置對應處理列表                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                      A                         E                         I                         S                         W                         X            
            PAI Module                         1                         2                         3                         4                         5                         6            
            PAI Module for POH                         1                         7                         3                         4                         7                         6            
            PAI Module for POV                         1                         7                         3                         4                         7                         6            
                                                                                                                                                                                     
            AT SELECTION-SCREEN ...                         1                         8                         3                         4                         9                         6            
            AT SELECTION-SCREEN for POH                         1                         7                         3                         4                         7                         6            
            AT SELECTION-SCREEN for POV                         1                         7                         3                         4                         7                         6            
            AT SELECTION-SCREEN ON EXIT                         1                         7                         3                         4                         7                         6            
                                                                                                                                                                                     
            AT LINE-SELECTION                          1                         10                         3                         4                         10                         6            
            AT PFn                         1                         10                         3                         4                         10                         6            
            AT USER-COMMAND                         1                         10                         3                         4                         10                         6            
                                                                                                                                                                                     
            INITIALIZATION                         1                         11                         3                         4                         11                         6            
            START-OF-SELECTION                         1                         11                         3                         4                         11                         6            
            GET                         1                         11                         3                         4                         11                         6            
            END-OF-SELECTION                         1                         11                         3                         4                         11                         6            
                                                                                                                                                                                     
            TOP-OF-PAGE                         1                         11                         3                         4                         11                         6            
            END-OF-PAGE                         1                         11                         3                         4                         11                         6            
            TOP-OF-PAGE DURING ...                         1                         10                         3                         4                         10                         6            
                                                                                                                                                                                     
            LOAD-OF-PROGRAM                         1                         1                         4                         4                         4                         6            
                                                                                                                                                                                     
            PBO Module                          1                         1                         4                         4                         4                         6            
            AT SELECTION-SCREEN OUTPUT                         1                         1                         4                         4                         4                         6            
  1. The message appears in a dialog box and the program terminates. When the user has confirmed the message, control returns to the next- highest area. All the internal sessions are deleted from the stack.
  2.    
  3. The message appears in the status line. Then PAI terminates and the system returns to the current screen. All the screen fields combined using FIELD or CHAIN are now ready for input. The user must enter new values. The system triggers the PAI event again, with the new values.
  4.    
  5. The message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
  6.    
  7. The message appears in the status line of the next screen. The program continues immediately after the message statement.
  8.    
  9. The message appears in the status line. Then the system continues as in 2, except that the user can quit the message using ENTER without having to enter new values. The system continues handling the PAI event from immediately after the message statement.
  10.    
  11. No message is displayed and a runtime error, MESSAGE_TYPE_X, is triggered. The short dump text contains the message identification.
  12.    
  13. The program terminates with a runtime error DYNPRO_MSG_IN_HELP. While F1 and F4 are processed, the system cannot send error messages or warnings.
  14.    
  15. The message appears in the status line. Then the system stops selection screen processing and returns to the selection screen itself. The screen fields specified in the additions to the AT SELECTION-SCREEN statement are now ready for input. The user must enter new values. The system then starts processing the selection screen again with the new values.
  16.    
  17. The message appears in the status line. Then the system continues as in 8, except the the user can quit the message using ENTER, without having to enter new values. The system continues handling the PAI event from immediately after the message statement.
  18.    
  19. The message appears in the status line and the processing block terminates. The