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: 

Executing subroutine after commit work, not on commit work

manou_manou
Explorer
0 Kudos

Hi All,

I want to execute my sub-routine after commit work, not on commit work.

If any one have answer please mail me at emmanuelevy@gmail.com

1 ACCEPTED SOLUTION

manou_manou
Explorer
0 Kudos

thanks for your answer , but i have a user exit before the commit of sap standard .

and there aren't user exit after .

it's about transaction vl32n . i need to use batch input after the commit .

7 REPLIES 7

Former Member
0 Kudos

Hi,

use the addition ON COMMIT in the perform.

PERFORM sub_form ON COMMIT.

manou_manou
Explorer
0 Kudos

thanks ,

yes i know but i need AFTER the commit not BEFORE

0 Kudos

Hi,

You can use the level (LEVEL idx) with perform on commit.

Give a high value like 99. This will ensure that your subroutine will be the last one which will be executed from the commit queue.

But this will be still in the commit work not after.

Thanks

Vinod

0 Kudos

Not sure if this helps you but this event is fired, when commit work is fired.

Christian

report test.

class lcl_event_handler definition.
 public section.

    class-methods: on_commit_finished
         for event COMMIT_FINISHED
           of CL_OS_TRANSACTION_END_NOTIFIER.
endclass.

set handler lcl_event_handler=>on_commit_finished.

commit work.

class lcl_event_handler implementation.
 method on_commit_finished.
  break-point.
 endmethod.

endclass.

But check also oss note 704577

christian_wohlfahrt
Active Contributor
0 Kudos

Hi,

in which context do you want to do something? I guess, it's not a Z-report, that would be simple.

But it's also not every commit in system. There is no general answer (at least I don't know any), but there might be several options in a special case.

Regards,

Christian

manou_manou
Explorer
0 Kudos

thanks for your answer , but i have a user exit before the commit of sap standard .

and there aren't user exit after .

it's about transaction vl32n . i need to use batch input after the commit .

0 Kudos

so I guess you would like to perform the routne after to avoid lock conflicts.

I am not sure about that transaction but since you are talking of batch input why not scheduling the BI (via Job scheduling - there are a couple of Function modules to achieve that rather easily) with some kind of delay to avoid these conflicts.

Christian