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: 

Calling 2 dependent BAPI in exit

suwandi_cahyadi
Contributor
0 Kudos
200

Hi,

I have a scenario where I have to call 2 BAPIs in an enhancement. These 2 BAPIs are dependent, first BAPI need to be committed first before the second can be called.

Now, in enhancements we cannot call COMMIT, if I use IN UPDATE TASK I also cannot call COMMIT. In this situation, how could I achieve it?

Thank you.

2 REPLIES 2

FredericGirod
Active Contributor
68

Why did you wrote "if I use IN UPDATE TASK I also cannot call COMMIT" you don't need it in UPDATE TASK

Sandra_Rossi
Active Contributor
68

Calling BAPIs while another object is being saved to database is not a good idea. What if there are errors?

It should be developed more like a workflow: Enter object 1 to be created -> User saves -> BAdI to start workflow event in update task -> Commit work -> update task runs, database updates for object 1 -> event is started asynchronously -> actual database commit -> workflow starts -> BAPI 1 is called -> BAPI 2 is called. You can monitor workflow.