2005 Dec 20 7:37 PM
Hi friends ,
Can u please explain or tell me when does roll back and commit work come into play in BAPI ? What exactly happens during roll back and commit work with regard to BAPI's?
Thank you ,
2005 Dec 20 7:41 PM
Check out the help.
http://help.sap.com/saphelp_470/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/frameset.htm
Regards,
RIch Heilman
2005 Dec 20 7:40 PM
commit work updates the data to tables.
but roll back it will roll back the update if any error occurs.
generally we use commit work after sy-subrc = 0.
rool back will be used after sy-subrc <> 0.
vijay
2005 Dec 20 7:41 PM
Check out the help.
http://help.sap.com/saphelp_470/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/frameset.htm
Regards,
RIch Heilman
2005 Dec 20 7:42 PM
Normally data is sent to BAPI for processing. Now, if 1 record has been processed successfully, the COMMIT works gets triggered internally. So, Commit works as such when an entry is processed successfully.
When u pass data and inbetween BAPI fails due to some reason, ROLL BACK gets triggered and the updates that has happened for that particular record data are been roll backed.
Pl. award appropriate points.
2005 Dec 20 8:27 PM
BAPIs are a bit odd. If you are using one to post a transaction for example, you will have to do an explicit COMMIT after the BAPI is complete. You have to examine the contents of the BAPIRETURN table to decide if you want to do this.
However, I've also found that if the BAPI succeeds but no commit is done then the number that was assigned to the document is not rolled back. So you end up with missing document numbers. I haven't tried this, but a ROLLBACK might take care of this.
Rob
2005 Dec 20 10:40 PM
I just did a quick check. I ran a BAPI, but instead of doing a commit, I did a rollback. The number range was still updated.
Rob