SUBMIT 的用法
SUBMIT
SUBMIT {rep|(name)} [selscreen_options]
#程式名 [ list_options ]
[ job_options]
[AND RETURN].
Addition:
Effect 作用
The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Calling Executable Reports.
The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in block capitals. If the program specified in name is not found, an irretrievable exception is generated.
SUBMIT語句呼叫一個可執行程式rep。這個可執行程式是在呼叫可執行報表的情況下被執行的。
程式各rep可以被直接指定也可以作為一個欄位內容-像資料物件name。資料物件name必須包含大寫字母的程式名稱。如果指定在name中的程式沒有找到,將會產生一個無法挽救的異常。
- The selscreen_options additions can be used to determine the selection screen for the program accessed and to supply it with values.
selscreen_options條件可以用來決定呼叫程式的選擇螢幕並且為程式提供資料。
- The list_options additions allow you to influence the output medium and the page size in the basic list for the program accessed.
list_options 條件充許你改變呼叫程式的基礎列表中的輸出值和頁面大小。
- You can schedule the program for background processing by specifying job_options.
你可以把程式安排成後臺執行通過指定 job_options。
... AND RETURN
Effect 作用
The AND RETURN addition determines the object accessed by the runtime environment after program access is completed:
AND RETURN選項決定被呼叫物件在程式呼叫後的執行環境已經完成。
- Without the AND RETURN addition, the internal session of the program accessed replaces the internal session of the calling program in the same position in the call sequence. Once program access is completed, the system returns to before the position from which the calling program was started.
As of Release 6.10, the content of the system field sy-calld at SUBMIT is copied by the calling program without AND RETURN. Before 6.10, the system entered the value "X", which was incorrect when the program was accessed from the first program in a call sequence.
沒有and return選項,被訪問程式的內部會話在呼叫序列的相同位置代替呼叫程式的內部會話。一旦訪問程式完成,系統返回到呼叫程式開始的位置。對於版本6.10,當程式從呼叫序列中的第一個程式被呼叫時,系統輸入值'X'是錯誤的。
- The addition AND RETURN starts the executable program in a new internal session. The session for the calling program is retained. Once program access is completed, program execution for the calling program continues after the SUBMIT statement.
and return選項在一個新的內部會話中執行可執行程式。呼叫程式的會話將被保留。一旦訪問程式完成,呼叫程式將在submit語句後繼續執行
。
Note 注
When the SUBMIT statement is executed, the system runs an authorization check for the authorization group specified in the program attributes.
當submit語句執行時,系統為在程式屬性中指定的許可權組執行許可權檢查。
Non-Catchable Exceptions 不可捕捉的異常
- Cause: The specified program was not found. 指定程式未找到
Runtime Error: LOAD_PROGRAM_NOT_FOUND 執行錯誤 - Cause: You tried to transfer an invalid value to a selection using the addition SIGN. 你試圖為SIGN賦一個無效的值
Runtime Error: SUBMIT_WRONG_SIGN - Cause: The specified program is not a report. 指定的程式不是報表程式。
Runtime Error: SUBMIT_WRONG_TYPE - Cause: You tried to transfer more than one value to a report parameter. 你試圖傳輸多值到一個報表引數
Runtime Error: SUBMIT_IMPORT_ONLY_PARAMETER - Cause: You tried to use WITH sel IN itab to transfer a table that does not have the appropriate structure to a selection. 你試圖用with sel in itab 傳輸一個沒有表匹配結構的表到一個選擇條件。
Runtime Error: SUBMIT_IN_ITAB_ILL_STRUCTURE - Cause: You tried to transfer a parameter that cannot be converted to the target field to the selection screen.
Runtime Error: SUBMIT_PARAM_NOT_CONVERTIBLE 你試圖傳輸一個不能轉換成目標欄位的引數到選擇螢幕
以上為SAP幫助檔案中對SUBMIT的解釋。以下為SUBMIT的呼叫示例
IF SY-BATCH IS INITIAL.
SUBMIT RVKRED07 WITH KKBER IN KKBER
WITH KNKLI IN KNKLI
WITH PROTB EQ PROTB
WITH TRACS EQ TRACS
WITH NOBLOCK EQ NOBLOCK
WITH DD_VBELN IN DD_VBELN.
ELSE.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
NO_DIALOG = 'X'
MODE = 'CURRENT'
IMPORTING
OUT_PARAMETERS = PARAMS.
SUBMIT RVKRED07 TO SAP-SPOOL SPOOL PARAMETERS PARAMS
WITHOUT SPOOL DYNPRO
WITH KKBER IN KKBER
WITH KNKLI IN KNKLI
WITH PROTB EQ PROTB
WITH TRACS EQ TRACS
WITH NOBLOCK EQ NOBLOCK
WITH DD_VBELN IN DD_VBELN.
ENDIF.