Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to peform work after commit?

former_member333493
Participant
0 Kudos

PEFORM subroutine on COMMIT executes the subroutine before the actual commit happens. Is there any way to call a function module or subroutine AFTER the actual commit happens?

1 ACCEPTED SOLUTION

rajad
Participant

(1) Create an event handler method for TRANSACTION_FINISHED event of CL_SYSTEM_TRANSACTION_STATE class and implement your logic there.

(2)SET handler in your enhancement logic

7 REPLIES 7

rajad
Participant

(1) Create an event handler method for TRANSACTION_FINISHED event of CL_SYSTEM_TRANSACTION_STATE class and implement your logic there.

(2)SET handler in your enhancement logic

0 Kudos

Thanks for the solution. My follow-up question is: how do I export parameters from my SET HANDLER context to my event handler method? (I tried to add parameters to my event handler, but I get the error "Event parameter <param> does not exist" )

Sandra_Rossi
Active Contributor
Aveek Kumar Baruah in the class containing your event handler, define and initialize attributes with the values you need.

Sandra_Rossi
Active Contributor
0 Kudos

You mean, that during the internal processing of ABAP "COMMIT WORK", all recorded "PERFORM subroutine ON COMMIT" (before COMMIT WORK) are actually processed before the database commit occurs.

GK817
Active Contributor
0 Kudos

Hi

You can try implementing your logic in function modules and use the update option as V1 or V2. Though all the FMs will be triggered on COMMIT, you can determine which FMs trigger first at commit. See if it serves your requirement.

Regards

GK

Sandra_Rossi
Active Contributor
0 Kudos

There are several solutions proposed by SAP. So that to limit the number of answers, can you explain what kind of logic you want to perform?

former_member333493
Participant
0 Kudos

Agreed with your clarification of the question sandra.rossi (I am unable to edit the question now).