CALL TRANSACTION

来源:互联网 发布:看电视的直播软件 编辑:程序博客网 时间:2024/06/17 05:40
Syntax Diagram

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 thetransaction whose transaction code is contained in data objectta. The data objectta must be of character type and must contain the transaction code in uppercase letters. If the transaction specified inta 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 abatch input session.

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.

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 anSAP LUW of its own.

  • If the called transaction is a dialog transaction, after loading the ABAP program the eventLOAD-OF-PROGRAM is triggered and thedynpro defined as initial dynpro of the transaction is called. The initial dynpro is the first dynpro of adynpro 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 theLEAVE PROGRAM statement.
  • If the called transaction is an OO transaction (as of release 6.10), when loading all programs exceptclass 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 theLEAVE PROGRAM statement.

After the end of the transaction call, program execution of the calling program resumes after theCALL TRANSACTION statement.

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.

Addition 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:

  • For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
  • All mandatory input fields of the initial dynpro must be filled completely and with the correct values by theSPA/GPA parameters

If these prerequisites are met, that screen of the dynpro is displayed that is specified in the Screen Painter as thenext 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.

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

... 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 additionsbdc_options control the batch input processing. When a transaction with additionUSING is called, the system fieldsy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.

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.

ComponentDescriptionPROGRAMName of the program of the called transactionDYNPRONumber of the dynpro to be processedDYNBEGINFlag for the beginning of a new dynpro (possible values are "X" and " ")FNAMName of a dynpro field to be filled or batch input control statement, for example, to position the cursorFVALValue 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.

System Fields

sy-subrcDescription0The batch input processing of the called transaction was successful.< 1000Error in the called transaction. If within the transaction amessage was sent, you can receive it using the additionMESSAGES.1001Error in batch input processing. 

Note

Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN andUSING together. However, this does not make sense, because the additionAND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields usingSPA/GPA parameters, while the batch input table specified withUSING controls the entire transaction flow including the display of thescreens.

Example

Call of the Class Builder (transactionSE24) and display of class CL_SPFLI_PERSISTENT. The internal tablebdcdata_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.

DATA class_name TYPE c LENGTH 30 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'.
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 additionUSING.
    Runtime Error: CALL_TRANSACTION_USING_NESTED