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

BAPI_INCOMINGINVOICE_CREATE - a rolling back errors question

christine_evans
Active Contributor
0 Likes
931

I need to use this BAPI to create an invoice and a credit memo against the same purchase order in one 'hit'. If the second call to the BAPI fails, I want to rollback both sets of changes. IIt's been fixed in my mind for a while now that this is not possible.; that if you call this BAPI you have to complete the process by committing or rolling back the changes before calling it a second time. However, I've done a bit of testing and doing the commit / rollback after the second call seems to be working fine.

Has anyone else done this sort of thing successfully in Production? I don't want to tell them that it is possible and make them really happy and then find out that I was wrong.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
841

I have a similar scenario with BAPI_ACC_DOCUMENT_POST, where two or even four postings need to be made successfully or none at all. The rollback is actually a very rare case in production, but it was tested quite a bit beforehand with forced errors and always worked as desired.

As you know, it works only as long as the BAPI does not have a commit work inside (they should not if programmed properly).

Thomas

3 REPLIES 3
Read only

ThomasZloch
Active Contributor
0 Likes
842

I have a similar scenario with BAPI_ACC_DOCUMENT_POST, where two or even four postings need to be made successfully or none at all. The rollback is actually a very rare case in production, but it was tested quite a bit beforehand with forced errors and always worked as desired.

As you know, it works only as long as the BAPI does not have a commit work inside (they should not if programmed properly).

Thomas

Read only

Former Member
0 Likes
841

We have used this approach with combination of BAPI's and Z function modules and have had no problem.

Read only

christine_evans
Active Contributor
0 Likes
841

Thanks for your reassuring replies. The customer is going to be very, very happy....