CALL TRANSACTION
CALL TRANSACTION
Syntax 語法
CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
??? ????????????????| [USING bdc_tab [bdc_options]] }.
Extras: 附加項
1. ... AND SKIP FIRST SCREEN
2. ... USING bdc_tab [bdc_options]
Effect 作用
The statement CALL TRANSACTION calls the transaction whose transaction code is contained in data object ta. The data object ta must be of character type and must contain the transaction code in uppercase letters. If the transaction specified in ta cannot be found, an untreatable exception is triggered. The additions suppress the display of the initial screen and allow you to execute the transaction using a batch input session.
語句call transaction 調用一個事務碼包含在數據對象ta中的事務。數據對象ta必須是字符型并且必須以大寫字段包含事務碼。如果指定在ta中的事務不能被找到,將會觸發一個不能找到的異常。該附加項生成初始屏幕的顯示并且充許用一個批輸入會話執行事務。
At CALL TRANSACTION the calling program and its data is kept, and after exiting the called transaction, processing is resumed in the calling program after the call.
在call transaction 調用程序和它的數據被保存下來,在退出被調用事務之后,在調用程序調用之后的處理將重新開始。
When the transaction is called, the ABAP program linked with the transaction code is loaded in a new internal session. The session of the calling program is kept. The called program runs in an SAP LUW of its own.
當事務被調用之后,和事務碼相關的ABAP程序被加載到一個新的內部會話中。調用程序的會話被保持。被調用程序在它自己的SAP LUW(logical unit of work)中執行。
- If the called transaction is a dialog transaction, after loading the ABAP program the event LOAD-OF-PROGRAM is triggered and the dynpro defined as initial dynpro of the transaction is called. The initial dynpro is the first dynpro of a dynpro sequence. The transaction is finished when the dynpro sequence is ended by encountering the next dynpro with dynpro number 0 or when the program is exited with the LEAVE PROGRAM statement.
如果被調用事務是一個對話事務,在加載ABAP程序之后將會觸發事件load-of-program,并且定義為該事務初始屏幕的屏幕被調用。初始屏幕是一個屏幕序列的第一個屏幕。當屏幕序列結束時,遇到下一個屏幕的屏幕號是0或者程序通過leave program語句退出,則事務完成。
- If the called transaction is an OO transaction (as of release 6.10), when loading all programs except class pools the event LOAD-OF-PROGRAM is triggered and then the method linked with the transaction code is called. If the method is an instance method, implicitly an object of the corresponding class is generated and referenced by the runtime environment. The transaction is finished when the method is finished or when the program is exited using the LEAVE PROGRAM statement.
如果被調用事務是一個面向對象事務(版本6.10),當加載除了類型池的所有程序時觸發事件load-of-program,之后和事務碼相關聯的方法被調用。如果這個方法是一個實例方法,將會暗含的生成一個相關類的數據對象并且參照運行時環境。當方法完成時或者程序使用leave program退出時事務結束。
After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.
在事件調用結束后,調用程序恢復執行call transaction語句之后的程序。
Note 注
At the statement CALL TRANSACTION, the authorization of the current user to execute the called transaction is not checked automatically. If the calling program does not execute a check, the called program must check the authorization. To do this, the called program must call function module AUTHORITY_CHECK_TCODE.
在語句call transaction中,當前用戶運行被調用事務的權限將不會自動檢查。如果調用程序不執行檢查,被調用程序必須檢查權限。為了做到這點,被調用程序必須調用函數模塊AUTHORITY_CHECK_TCODE.
Addition 1 選項1
... AND SKIP FIRST SCREEN
Effect 作用
This addition suppresses the display of a screen of the initial dynpro of a called dialog transaction. The addition AND SKIP FIRST SCREEN suppresses the first screen under these prerequisites:
這個選項生成被調用對話事務的初始屏幕的顯示屏幕。選項and skip first screen在這些前提下生成第一個屏幕。
- For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
對于初始屏幕,在屏幕繪制器中,屏幕自己的屏幕編號不能被指定為下一屏幕號。(應該是當前屏幕的next screen不能是屏幕本身)
- All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters
初始屏幕的所有強制輸入字段必須被全部填充并且被賦于恰當的值通過SAP/GPA字段(SAP內存參數設置參見http://www.cnblogs.com/clsoho/archive/2010/01/21/1653115.html)。
If these prerequisites are met, that screen of the dynpro is displayed that is specified in the Screen Painter as the next dynpro of the initial dynpro.
當有了這些前提條件,在屏幕繪制器中指定的做為初始屏幕下一屏的屏幕將會被顯示出來。
Example 例子
If the static next dynpro of the initial dynpro of the called dialog transaction FLIGHT_TA is not the initial dynpro itself, its screen is suppressed, because its input fields are filled using the SPA/GPA parameters CAR and CON.
如果被調用對話事務FLIGHT_TA的初始屏幕的靜態下一屏幕不是初始屏幕本身,它的屏幕就會被生成,因為它的輸入字段被SAP內存參數字段CAR和CON填充。
DATA: carrid TYPE spfli-carrid,
??????connid TYPE spfli-connid.
...
SET PARAMETER ID: 'CAR' FIELD carrid,
??????????????????'CON' FIELD connid.
CALL TRANSACTION 'FLIGHT_TA' AND SKIP FIRST SCREEN.
Addition 2 選項2
... USING bdc_tab [bdc_options]
Effect 作用
Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
使用這個附加項傳送一個在ABAP字典中行類型為bdcdata的內表bdc_tab到一個對話事務中。選項bdc_options控制批輸入處理。當一個具有using附加項的事務被調用時,系統字段sy-binpt在被調用程序中被設置成值“X”,當這個事務運行時,其它事務不能使用這個附加項被調用。
The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
內表bdc_tab是程序內部一個批輸入session的表現形式,并且必須被相應地填充。結構bdcdata有如下表顯示的字段。
| Component 字段 | Description描述 |
| PROGRAM 程序 | Name of the program of the called transaction 被調用事務的程序名 |
| DYNPRO 屏幕 | Number of the dynpro to be processed 被處理的屏幕編號 |
| DYNBEGIN 屏幕開始 | Flag for the beginning of a new dynpro (possible values are "X" and " ") 一個新屏幕的開始標志。(可能的值為“X”和“”) |
| FNAM 字段名 | Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor 一個需要填充的屏幕字段的名字或者批輸入控制語句,例如,來定位光標。 |
| FVAL 字段值 | Value to be passed to the dynpro field or to the control statement 將要被傳輸到屏幕字段或者到控制語句的值。 |
?
Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
使用內表bdc_tab,你可以提供任意數量被調用事務的具有輸入字段和用戶操作屏幕。
System Fields 系統字段
| sy-subrc | Description描述 |
| 0 | The batch input processing of the called transaction was successful. 被調用事務的批輸入處理成功。 |
| < 1000 | Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES. 在被調用事務中產生錯誤。如果在事務中,將會產生一個消息,可以用附加項messages來接收它。 |
| 1001 | Error in batch input processing. 在批輸入處理中產生錯誤。 |
?
Note 注
Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
除了abap對象之外,你在一塊指定指定and skip first screen和using是沒有意義的,因為附加項and skip first screen設計的時候只是用來當指定有using的批輸入表控制整個包含屏幕顯示的事務流時用SAP內存參數字段來填充必須字段的。
Example 例子
Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
調用類制作器(事務碼SE24)并且顯示類CL_SPFLI_PERSISTENT.內表bdcdata_tab包含事務的第一個屏幕(1000)的批輸入處理數據。使用結構OPT,批輸入處理被設置為生成第一個屏幕并且以標準大小顯示下一個屏幕。
DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
DATA: bdcdata_wa??TYPE bdcdata,
??????bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program??= 'SAPLSEOD'.
bdcdata_wa-dynpro?? = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
bdcdata_wa-fval = class_name.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CIDI'. "注:在SAPrelease7.10中,此處的功能碼為:WB_DISPLAY,大家可以測試一下,如果直接COPY過去只能進入SE24界面
APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt.
Exceptions 異常
Non-Catchable Exceptions 不可捕捉的異常
- Cause: Transaction not found. 事務未找到
Runtime Error: CALL_TRANSACTION_NOT_FOUND - Cause: Transaction is an area menu and can therefore not be called. 事務是區域菜單,不可調用
Runtime Error: CALL_TRANSACTION_IS_MENU - Cause: Transaction is locked. 事務被鎖
Runtime Error: CALL_TRANSACTION_LOCKED - Cause: Error in the internal storage administration.
Runtime Error: CALL_TRANSACTION_MSG_NO_PAGING - Cause: Recursive call of a transaction with addition USING.
Runtime Error: CALL_TRANSACTION_USING_NESTED
轉載于:https://www.cnblogs.com/clsoho/archive/2010/03/09/1681243.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的CALL TRANSACTION的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OCFS2+ASM 的RAC安装文档
- 下一篇: 通讯业2月网络广告投放环比增33% 联通