SAP CALL TRANSACTION ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for CALL_TRANSACTION

CALL TRANSACTION

Short Reference
• CALL TRANSACTION ABAP Statement


ABAP Syntax

Simple transaction call

1 CALL TRANSACTION ta WITH|WITHOUT AUTHORITY-CHECK [AND SKIP FIRST SCREEN].

Transaction call usingbatch input table

2 CALL TRANSACTION ta WITH|WITHOUT AUTHORITY-CHECK
USING bdc_tab { {[MODE mode][UPDATE upd]}
| [OPTIONS FROM opt] }
[MESSAGES INTO itab].

What does it do? The statement CALL TRANSACTION calls the transaction whose transaction code is contained in data object ta. The calling program and its data are retained. After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.

The data object ta must be character-like, flat and contain the transaction code in uppercase letters. If the transaction specified in ta cannot be found, a non-handleable exception is raised. In the first first variant, the display of the initial screen can be suppressed. In the second variant, the transaction is executed using a batch input table.

In both variants, an authorization check can be performed on the called transaction.

When the transaction is called, the ABAP program associated with the transaction code is loaded in a new internal session. The session of the calling program and the current SAP LUW are retained. The called program runs in its own SAP LUW. If the called transaction is a dialog transaction, the event LOAD-OF-PROGRAM is triggered after the ABAP programs is loaded and the dynpro defined as the 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 using the LEAVE PROGRAM statement. If the called transaction is an OO transaction, then when loading all programs (except class pools), the event LOAD-OF-PROGRAM is triggered and the method associated with the transaction code is called. If the method is an instance method, an object of the associated class is generated implicitly 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.

Latest notes:CALL TRANSACTION does not end the current database LUW. A database commit or database rollback in the called program works in exactly the same way as in the current program. The statement CALL TRANSACTION opens a new SAP-LUW but it does not open a new database LUW. This means that a database rollback in this SAP LUW can roll back all registration entries made by the statements CALL FUNCTION IN UPDATE TASK or CALL FUNCTION IN BACKGROUND TASK in the tables VB... or ARFCSSTATE and ARFCSDATA. Under certain circumstances, the statement ROLLBACK WORK in the called program can also affect the interrupted SAP LUW. To prevent this, an explicit database commit must be executed before the program is called. This problem does not occur in local updates. Specifying a transaction in a variable data object ta is one of the dynamic programming techniques.
ABAP Code Snippet

Security Note

ABAP Code Snippet If used wrongly, dynamic calls of program units can present a serious security risk. Names of program units that are passed to a program from the outside must be checked thoroughly before being used in dynamic calls. The system class CL_ABAP_DYN_PRG , for example, can be used to do this.
ABAP Code Snippet
ABAP Code Snippet See Dynamic Calls.



Runtime Exceptions

Catchable Exceptions
CX_SY_AUTHORIZATION_ERROR
Reason for error:
No authorization for this transaction
Runtime error:
CALL_TRANSACTION_FAILED


Non-catchable Exceptions
Reason for error:
Transaction not found.
Runtime error:
CALL_TRANSACTION_NOT_FOUND
Reason for error:
Transaction is an area menu and cannot be called.
Runtime error:
CALL_TRANSACTION_IS_MENU
Reason for error:
Transaction is locked.
Runtime error:
CALL_TRANSACTION_LOCKED
Reason for error:
Error in internal memory management.
Runtime error:
CALL_TRANSACTION_MSG_NO_PAGING
Reason for error:
Recursive call of a transaction with addition USING .
Runtime error:
CALL_TRANSACTION_USING_NESTED


Return to menu