Ansicht
Dokumentation

ABAPLEAVE_TO_TRANSACTION - LEAVE TO TRANSACTION

ABAPLEAVE_TO_TRANSACTION - LEAVE TO TRANSACTION

Vendor Master (General Section)   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

LEAVE TO TRANSACTION

Short Reference


LEAVE TO ${ ${TRANSACTION ta$} $| ${CURRENT TRANSACTION$} $}
         $[AND SKIP FIRST SCREEN$].


Addition:

... AND SKIP FIRST SCREEN

Effect

The statement LEAVE TO TRANSACTION calls either the transaction whose transaction code is contained in data object ta or the current transaction, and in doing so exits the current call sequence. The data object ta must be character-like, flat and contain the transaction code in uppercase letters. The following can be specified for ta:

  • Literal or constant
If the data object ta is specified as a text field literal or as a constant, it is evaluated as a static specification by tools such as the extended program check or the where-used list.
  • Variable
If the data object ta is specified as a variable, it is specified only dynamically, and the content is not evaluated statically.

When the statement is executed, ta is not evaluated until runtime (in both cases).

If CURRENT TRANSACTION is specified, the current transaction is called using the transaction code that was used to call the transaction using CALL TRANSACTION or LEAVE TO TRANSACTION. This transaction code is contained in the system field sy-tcode except for parameter transactions or variant transactions. When using parameter transactions or variant transactions, their transaction code is used for the call and sy-tcode contains the name of the implicitly called dialog transaction.

When using LEAVE TO TRANSACTION, the current call sequence is exited completely. When the called transaction is terminated, the runtime framework returns to the position where the first program in the call sequence was called and the current SAP LUW is terminated.

When the transaction is called, the ABAP program to which the transaction code is linked is loaded in a new internal session. All previous internal sessions are deleted from the stack. At the same time, the ABAP memory is deleted, which means that EXPORT FROM MEMORY or IMPORT TO MEMORY cannot be used to pass data when using LEAVE TO TRANSACTION.

The steps of the called dialog transaction or OO transaction are the same as in CALL TRANSACTION. When the called transaction is exited, the runtime framework returns to the position where the first program in the current call sequence was called.

If the transaction specified in ta is not found, or if ta is initial or contains a blank, the stack of the current call sequence is deleted and the runtime framework returns directly to the position where the first program in the current call sequence was called. If ta is not initial, an appropriate message appears in the status bar.

The statement LEAVE TO TRANSACTION always terminates the current call sequence, regardless of whether or not a new transaction can be called.

Unlike in the statement CALL TRANSACTION, the authorization of the current user for executing the called transaction is always checked automatically as follows when using the statement LEAVE TO TRANSACTION:

  • It is checked against any authorization object entered in the definition of the transaction code (maintenance transaction SE93). Fields of the authorization object for which no value is specified here are not checked.

If the required authorization is missing, a message with message type A (termination message) is sent and the system responds appropriately.

Notes

  • The CURRENT TRANSACTION call can be used to execute a current parameter transaction or variant transaction again with the corresponding parameters or the transaction variant. Alternatively, the static method GET_CURRENT_TRANSACTION of the class CL_DYNPRO can be used to obtain the transaction code of the current transaction. This method returns the transaction code during a parameter transaction or variant transaction instead of the transaction code of the implicitly called dialog transaction.
  • If procedures are still registered for LEAVE TO TRANSACTION in the current SAP LUW, the SAP LUW is terminated and the procedures are not called or rolled back. Any registered update function modules are preserved in the database, but can no longer be executed. In cases like this, therefore, it is advisable to execute the statement COMMIT WORK or ROLLBACK WORK explicitly before the program call. See Dynamic Calls.

Addition

... AND SKIP FIRST SCREEN

Effect

The addition AND SKIP FIRST SCREEN has the same meaning as inCALL TRANSACTION.

Example

Call of transaction DEMO_TRANSACTION, suppressing the first screen.






ROGBILLS - Synchronize billing plans   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 8835 Date: 20240616 Time: 121622     sap01-206 ( 130 ms )