Ansicht
Dokumentation

ABAPPERFORM_SUBR - PERFORM SUBR

ABAPPERFORM_SUBR - PERFORM SUBR

CL_GUI_FRONTEND_SERVICES - Frontend Services   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

PERFORM, ON COMMIT, ROLLBACK

Short Reference



PERFORM subr ON ${ ${COMMIT $[LEVEL idx$]$} $| ROLLBACK $}.

Addition:

... LEVEL idx

Effect

This statement registers subroutine of the current program for later execution. The name of the subroutine is directly specified as subr. The subroutine is not executed immediately, but is flagged for execution by one of the statements COMMIT WORK or ROLLBACK WORK.

The statements COMMIT WORK or ROLLBACK WORK execute the subroutines that are registered with ON COMMIT or ON ROLLBACK respectively in the current work process and before update function modules registered using CALL FUNCTION ... IN UPDATE TASK are called. Subroutines that are registered during execution of an update function module with ON COMMIT are executed at the end of the update. In non-local updates, this takes places in the update work process and in local updates in the current work process.

Do not implement in function modules and subroutines

Notes

  • Creating subroutines is obsolete. If new subroutines are required for PERFORM subr ON COMMIT or PERFORM subr ON ROLLBACK, they should only be used as wrapping for a method call and must not contain any other functional code.
  • Registered subroutines cannot have any parameter interface. Therefore, data can only be passed through external interfaces - for example, the ABAP memory. Subroutines that are executed in COMMIT WORK or ROLLBACK WORK are thus more suitable for management tasks, such as cleanup work at the end of a SAP LUW, than for database changes.
  • During processing of a registered subroutine after COMMIT WORK or ROLLBACK WORK, the statements PERFORM ... ON COMMIT, PERFORM ... ON ROLLBACK, COMMIT WORK, or ROLLBACK WORK must not be executed. Type "A" messages caught using the predefined exception error_message in function module calls execute the statement ROLLBACK WORK implicitly and are therefore also forbidden.
  • If, during the processing of a registered subroutine after COMMIT WORK, update function modules are registered using CALL FUNCTION ... IN UPDATE TASK, this registration still applies to the current SAP LUW.
  • If the registration of subroutines is combined with the registration of update function modules with CALL FUNCTION ... IN UPDATE TASK special care has to be taken regarding the database LUWs involved. Especially for asynchronous update, procedures that are registered outside update processing are executed in different work processes and therefore in different database LUWs. The changes in the database LUW of the subroutine can be committed before the update function modules are executed and a database rollback during an asynchronous update does not rollback these changes.

Addition

... LEVEL idx

Effect

In the case of subroutines registered for COMMIT, the order of execution can be controlled using the addition LEVEL, where idx expects a data object of the type i. The execution then takes place, sorted according to ascending value of idx. idx has the value 0, if a value is not explicitly specified. If the value is the same as idx or if no value is specified, the order of execution is the same as the order of registration. A subroutine registered multiple times for COMMIT or ROLLBACK is executed once in each case.

Example

Registers a subroutine insert of the same program for execution in the statement COMMIT WORK. The data is passed using the ABAP memory.

SAP LUW, ON COMMIT






TXBHW - Original Tax Base Amount in Local Currency   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 6008 Date: 20240416 Time: 185327     sap01-206 ( 109 ms )