CALL TRANSACTION
CALL TRANSACTION
Syntax 語法
CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
??? ????????????????| [USING bdc_tab [bdc_options]] }.
Extras: 附加項(xiàng)
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 調(diào)用一個(gè)事務(wù)碼包含在數(shù)據(jù)對象ta中的事務(wù)。數(shù)據(jù)對象ta必須是字符型并且必須以大寫字段包含事務(wù)碼。如果指定在ta中的事務(wù)不能被找到,將會觸發(fā)一個(gè)不能找到的異常。該附加項(xiàng)生成初始屏幕的顯示并且充許用一個(gè)批輸入會話執(zhí)行事務(wù)。
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 調(diào)用程序和它的數(shù)據(jù)被保存下來,在退出被調(diào)用事務(wù)之后,在調(diào)用程序調(diào)用之后的處理將重新開始。
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.
當(dāng)事務(wù)被調(diào)用之后,和事務(wù)碼相關(guān)的ABAP程序被加載到一個(gè)新的內(nèi)部會話中。調(diào)用程序的會話被保持。被調(diào)用程序在它自己的SAP LUW(logical unit of work)中執(zhí)行。
- 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.
如果被調(diào)用事務(wù)是一個(gè)對話事務(wù),在加載ABAP程序之后將會觸發(fā)事件load-of-program,并且定義為該事務(wù)初始屏幕的屏幕被調(diào)用。初始屏幕是一個(gè)屏幕序列的第一個(gè)屏幕。當(dāng)屏幕序列結(jié)束時(shí),遇到下一個(gè)屏幕的屏幕號是0或者程序通過leave program語句退出,則事務(wù)完成。
- 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.
如果被調(diào)用事務(wù)是一個(gè)面向?qū)ο笫聞?wù)(版本6.10),當(dāng)加載除了類型池的所有程序時(shí)觸發(fā)事件load-of-program,之后和事務(wù)碼相關(guān)聯(lián)的方法被調(diào)用。如果這個(gè)方法是一個(gè)實(shí)例方法,將會暗含的生成一個(gè)相關(guān)類的數(shù)據(jù)對象并且參照運(yùn)行時(shí)環(huán)境。當(dāng)方法完成時(shí)或者程序使用leave program退出時(shí)事務(wù)結(jié)束。
After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.
在事件調(diào)用結(jié)束后,調(diào)用程序恢復(fù)執(zhí)行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中,當(dāng)前用戶運(yùn)行被調(diào)用事務(wù)的權(quán)限將不會自動檢查。如果調(diào)用程序不執(zhí)行檢查,被調(diào)用程序必須檢查權(quán)限。為了做到這點(diǎn),被調(diào)用程序必須調(diào)用函數(shù)模塊AUTHORITY_CHECK_TCODE.
Addition 1 選項(xiàng)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:
這個(gè)選項(xiàng)生成被調(diào)用對話事務(wù)的初始屏幕的顯示屏幕。選項(xiàng)and skip first screen在這些前提下生成第一個(gè)屏幕。
- For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
對于初始屏幕,在屏幕繪制器中,屏幕自己的屏幕編號不能被指定為下一屏幕號。(應(yīng)該是當(dāng)前屏幕的next screen不能是屏幕本身)
- All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters
初始屏幕的所有強(qiáng)制輸入字段必須被全部填充并且被賦于恰當(dāng)?shù)闹低ㄟ^SAP/GPA字段(SAP內(nèi)存參數(shù)設(shè)置參見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.
當(dāng)有了這些前提條件,在屏幕繪制器中指定的做為初始屏幕下一屏的屏幕將會被顯示出來。
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.
如果被調(diào)用對話事務(wù)FLIGHT_TA的初始屏幕的靜態(tài)下一屏幕不是初始屏幕本身,它的屏幕就會被生成,因?yàn)樗妮斎胱侄伪?/span>SAP內(nèi)存參數(shù)字段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 選項(xiàng)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.
使用這個(gè)附加項(xiàng)傳送一個(gè)在ABAP字典中行類型為bdcdata的內(nèi)表bdc_tab到一個(gè)對話事務(wù)中。選項(xiàng)bdc_options控制批輸入處理。當(dāng)一個(gè)具有using附加項(xiàng)的事務(wù)被調(diào)用時(shí),系統(tǒng)字段sy-binpt在被調(diào)用程序中被設(shè)置成值“X”,當(dāng)這個(gè)事務(wù)運(yùn)行時(shí),其它事務(wù)不能使用這個(gè)附加項(xiàng)被調(diào)用。
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.
內(nèi)表bdc_tab是程序內(nèi)部一個(gè)批輸入session的表現(xiàn)形式,并且必須被相應(yīng)地填充。結(jié)構(gòu)bdcdata有如下表顯示的字段。
| Component 字段 | Description描述 |
| PROGRAM 程序 | Name of the program of the called transaction 被調(diào)用事務(wù)的程序名 |
| DYNPRO 屏幕 | Number of the dynpro to be processed 被處理的屏幕編號 |
| DYNBEGIN 屏幕開始 | Flag for the beginning of a new dynpro (possible values are "X" and " ") 一個(gè)新屏幕的開始標(biāo)志。(可能的值為“X”和“”) |
| FNAM 字段名 | Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor 一個(gè)需要填充的屏幕字段的名字或者批輸入控制語句,例如,來定位光標(biāo)。 |
| FVAL 字段值 | Value to be passed to the dynpro field or to the control statement 將要被傳輸?shù)狡聊蛔侄位蛘叩娇刂普Z句的值。 |
?
Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
使用內(nèi)表bdc_tab,你可以提供任意數(shù)量被調(diào)用事務(wù)的具有輸入字段和用戶操作屏幕。
System Fields 系統(tǒng)字段
| sy-subrc | Description描述 |
| 0 | The batch input processing of the called transaction was successful. 被調(diào)用事務(wù)的批輸入處理成功。 |
| < 1000 | Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES. 在被調(diào)用事務(wù)中產(chǎn)生錯(cuò)誤。如果在事務(wù)中,將會產(chǎn)生一個(gè)消息,可以用附加項(xiàng)messages來接收它。 |
| 1001 | Error in batch input processing. 在批輸入處理中產(chǎn)生錯(cuò)誤。 |
?
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是沒有意義的,因?yàn)楦郊禹?xiàng)and skip first screen設(shè)計(jì)的時(shí)候只是用來當(dāng)指定有using的批輸入表控制整個(gè)包含屏幕顯示的事務(wù)流時(shí)用SAP內(nèi)存參數(shù)字段來填充必須字段的。
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.
調(diào)用類制作器(事務(wù)碼SE24)并且顯示類CL_SPFLI_PERSISTENT.內(nèi)表bdcdata_tab包含事務(wù)的第一個(gè)屏幕(1000)的批輸入處理數(shù)據(jù)。使用結(jié)構(gòu)OPT,批輸入處理被設(shè)置為生成第一個(gè)屏幕并且以標(biāo)準(zhǔn)大小顯示下一個(gè)屏幕。
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過去只能進(jìn)入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. 事務(wù)未找到
Runtime Error: CALL_TRANSACTION_NOT_FOUND - Cause: Transaction is an area menu and can therefore not be called. 事務(wù)是區(qū)域菜單,不可調(diào)用
Runtime Error: CALL_TRANSACTION_IS_MENU - Cause: Transaction is locked. 事務(wù)被鎖
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
轉(zhuǎn)載于:https://www.cnblogs.com/clsoho/archive/2010/03/09/1681243.html
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的CALL TRANSACTION的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OCFS2+ASM 的RAC安装文档
- 下一篇: 通讯业2月网络广告投放环比增33% 联通