Application Development and Automation 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: 
Read only

Perform ON COMMIT doesn't work (Try it)

Former Member
0 Likes
2,100

Has anyone tried a PERFORM ON COMMIT within a BADI? It doesn't work and i don't know why.

I am working with the HR Module, and i have a BADI, which is fired when the user hits the 'SAVE' button (PA30 Transaction).. when this happens, i execute a PERFORM ON COMMIT and the subroutine is never called...

Does anyone know anything about this?

Regards

9 REPLIES 9
Read only

former_member209217
Active Contributor
0 Likes
1,200

This message was moderated.

Read only

Former Member
0 Likes
1,200

This message was moderated.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,200

Hi,

Same was the case with me.

I also used statement PERFORM <sub_routine_name> ON COMMIT but it was not working.

So I used statement WAIT UP TO 5 SECONDS

Hope it works in your case.

Regards,

Tarun

Read only

Former Member
0 Likes
1,200

Hi,

'perform on commit' only works when 'BAPI_TRASACTION_COMMIT' is executed successfully .

check sy-subrc = 0 after this BAPI.

Thanks,

Krishna..

Read only

0 Likes
1,200

And do you suggest any solutions?

Regards

Read only

0 Likes
1,200

Hi Yashir,

Have you tried debugging it with "UPDATE DEBUGGING" option?

I have no idea if this is applicable to "perform on commit" but incase of "call function in update task" you have to use update debugging option then only you can debug function module. Normal debugging does not work in that case as function module executes in separate luw after commit statement.

Hope this information helps you.

Regards,

Vishal

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,200

I never get any (unsolvable) problem with PERFORM ON COMMIT, be it fired from COMMIT WORK or BAPI_TRANSACTION_COMMIT. So i suppose your BADI is executed when the transaction is in update task, so the commit event has already been triggered, can you check. (debug)

example: in BADI HRPAD00INFTY, method IN_UPDATE is executed in update task, so PERFORM AT COMMIT will not be triggered.

Regards

Read only

0 Likes
1,200

That's exactly my case.

I'm trying to update infotype 0001, just after the infotype 0002 is saved, via PA30, so i'm using the method IN_UPDATE to do so, and obviously is not working at all.

Do you have any idea on what should i do? I've been thinking of a separate batch input so i could update the second infotype....

Thanks a lot.

Read only

0 Likes
1,200

In your BADI submit a function module [IN BACKGROUND TASK|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=inBACKGROUNDTASK&adv=false&sortby=cm_rnd_rankvalue] to update the second infotype via FM [HR_INFOTYPE_OPERATION|https://www.sdn.sap.com/irj/scn/advancedsearch?query=hr_infotype_operation&cat=sdn_all] (create a RFC enabled Z-FM that call the standard FM)

Regards