<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI_TRANSACTION_COMMIT - return error handling in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198693#M1626017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data will be saved to database once you use " BAPI_TRANSACTION_COMMIT".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what i can suggest is that you pass 100 records to the bapi and check for error message in the return strucure.. if you find any error then throw message else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call again bapi and pass the data and update .. try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.
 
read table BAPI_RETURN_TABLE with msgtype = 'E'.
if sy-subrc eq 0.
error = 'X'.
exit.
endif.
endloop.
Throw error message here.

if error is initial.
LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
               WAIT = 'X'
      IMPORTING
               RETURN = RETURN.
endloop.

endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Aug 2011 09:45:55 GMT</pubDate>
    <dc:creator>former_member404244</dc:creator>
    <dc:date>2011-08-26T09:45:55Z</dc:date>
    <item>
      <title>BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198691#M1626015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to save N  documents in DB. If an error happens in any document, you should not save any other document, that is, or ALL  or NOTHING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The algorithm is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 Error = ''. 
 LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.

         LOOP AT  BAPI_RETURN_TABLE ASSIGNING &amp;lt;ret&amp;gt;.
               IF &amp;lt;ret&amp;gt;-TYPE = 'E'.
	 	 "If an error occurs on a document, do rollback on all the documents 
                 "already posted and flow ends.
                  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
                            IMPORTING RETURN = RETURN.
                   "I do not analyze the error in the ROLBACK RETURN, 
                   "because read somewhere that ROLLBACK can not fail.
		   Error = 'X'.  "In case of error, flow ends!
		   EXIT.  
         ENDLOOP.
  	IF Error = 'X'.
 	     EXIT. 
        ENDIF.
 ENDLOOP.        
    
 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
               WAIT = 'X'
      IMPORTING
               RETURN = RETURN.
     "In the COMMIT, in case of error, RETURN table has only one record.
      IF RETURN-TYPE = 'E'.  
            "Point A:      I do not know what to do??????
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions are:&lt;/P&gt;&lt;P&gt;1. The algorithm is correct?&lt;/P&gt;&lt;P&gt;2. I am not sure that I do in "Point A". How does the COMMIT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that could happen: &lt;/P&gt;&lt;P&gt;(a) with COMMIT are written in DB, for example, 30 documents, after that fails COMMIT of 31. document? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(b) If (a) is  yes, i do ROLLBACK  on other documents (from 31. up to 100.), posted but not saved in DB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(c) If (b) is yes, at the end, 30 documents are saved and 70 documents are not saved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This situation does not suit me, because, I repeat, I have to saved all 100 or nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Serena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 09:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198691#M1626015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-26T09:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198692#M1626016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi serenaaa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I consider this as a challenging requirement. Though I've never used it before, but, I can suggest you to try the option synchronous Update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the keywords, 'IN UPDATE TASK' after the CALL FUNCTION 'BAPI........' IN UPDATE TASK and then try the COMMIT or ROLLBACK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a common scenario, COMMIT is done after every BAPI call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pranav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 09:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198692#M1626016</guid>
      <dc:creator>former_member222709</dc:creator>
      <dc:date>2011-08-26T09:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198693#M1626017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data will be saved to database once you use " BAPI_TRANSACTION_COMMIT".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what i can suggest is that you pass 100 records to the bapi and check for error message in the return strucure.. if you find any error then throw message else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call again bapi and pass the data and update .. try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.
 
read table BAPI_RETURN_TABLE with msgtype = 'E'.
if sy-subrc eq 0.
error = 'X'.
exit.
endif.
endloop.
Throw error message here.

if error is initial.
LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
               WAIT = 'X'
      IMPORTING
               RETURN = RETURN.
endloop.

endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 09:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198693#M1626017</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2011-08-26T09:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198694#M1626018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Serenaa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check 'BAPI_TRANSACTION_COMMIT', you'll see that the 'E' message will be populated only if the COMMIT WORK AND WAIT fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SAP documentation non-zero SY-SUBRC after COMMIT WORK AND WAIT signifies, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;the updating of the update function modules was not successful.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i would not worry much if you've bundled the calls in one LUW. If your BAPI_TRANSACTION_COMMIT fails, all the updates will be reversed &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 10:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198694#M1626018</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-08-26T10:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198695#M1626019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nagaraj, thanks for the reply. Could you clarify this in the response of ".. if you find any error message then throw else.&lt;/P&gt;&lt;P&gt;BAPI call again and pass the time and update .. try like this "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps I should say that this code should be part of an ABAP program scheduled in the background and the outcome of the update should write a log file. According to the outcome, the end user should repeat the update failed, launching the program at hand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate it very much the answer that refers to my algorithm, very precise. Please give me your expert opinion on the things I wrote in the questions and comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Serena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 10:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198695#M1626019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-26T10:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198696#M1626020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Suhas!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check 'BAPI_TRANSACTION_COMMIT', you'll see that the 'E' message will be populated only if the COMMIT WORK AND WAIT fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is OK!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SAP documentation non-zero SY-SUBRC after COMMIT WORK AND WAIT signifies,&lt;/P&gt;&lt;P&gt;the updating of the update function modules was not successful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;These two versions are the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
    " 1. Vesrion
    
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
                   WAIT = 'X'
         IMPORTING
                   RETURN = RETURN.

    IF RETURN-TYPE = 'E'.
       LOG-TYPE  = RETURN-TYPE.
       LOG-ID    = RETURN-ID.
       LOG-NUMBER= RETURN-NUMBER.
       LOG-MESSAGE= RETURN-MESSAGE.
    ENDIF.
    
    " 2. Vesrion
    
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
                   WAIT = 'X'
         IMPORTING
                   RETURN = RETURN.

    IF SY-SUBRC &amp;lt;&amp;gt;  0.      " SY-SUBRC NE  0
       LOG-TYPE  = RETURN-TYPE.
       LOG-ID    = RETURN-ID.
       LOG-NUMBER= RETURN-NUMBER.
       LOG-MESSAGE= RETURN-MESSAGE.
    ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i would not worry much if you've bundled the calls in one LUW. If your BAPI_TRANSACTION_COMMIT fails, all the updates will be reversed &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are you telling me if COMMIT fails at any point and for whatever reason, none of the 100 documents are not saved in the DB? If you are very sure, I will believe it &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grazie e ciao,&lt;/P&gt;&lt;P&gt;Serena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 10:53:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198696#M1626020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-26T10:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198697#M1626021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you have 10 documents and out of which 9 or correct and the last one is error . If you go with a commit then the 9 records will be created and the last one will be error and it will be roll back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose you have 10 documents , first eight are correct, ninethone is error and tenth one is correct. so it will create 9 documents and will leave 9th one and even though you used roll back it will roll back only 9th one not all 8 one's which already created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actaully we use test run fucntionality to check whether the records are correct . it seems the bapi you are using doesn't have any test run functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also i have suggested error message if you run online if not then you can write error log and download to desktop or application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 11:21:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198697#M1626021</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2011-08-26T11:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198698#M1626022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Nagaraj!&lt;/P&gt;&lt;P&gt;I have verified that all documents are posted without error, with 'BAPI_ACC_DOCUMENT_POST', after which I COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, I'm sorry, I forgot two lines in my algorithm. I write CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'  between IF Error = '' and ENDIF.&lt;/P&gt;&lt;P&gt;Here is the updated algorithm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
  
Error = ''. 
LOOP AT ....  "For example, 100 times for 100 Documents
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
                  EXPORTING ...
                 IMPORTING ...
                 TABLES    ....
                                 RETURN = BAPI_RETURN_TABLE.
 
         LOOP AT  BAPI_RETURN_TABLE ASSIGNING &amp;lt;ret&amp;gt;.
               IF &amp;lt;ret&amp;gt;-TYPE = 'E'.
	 	 "If an error occurs on a document, do rollback on all the documents 
                 "already posted and flow ends.
                  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
                            IMPORTING RETURN = RETURN.
                   "I do not analyze the error in the ROLBACK RETURN, 
                   "because read somewhere that ROLLBACK can not fail.
		   Error = 'X'.  "In case of error, flow ends!
		   EXIT.  
         ENDLOOP.
  	IF Error = 'X'.
         EXIT. 
      ENDIF.
 ENDLOOP.        

 IF Error = ''.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
                  WAIT = 'X'
            IMPORTING
               RETURN = RETURN.
                 "In the COMMIT, in case of error, RETURN table has only one record.
     IF RETURN-TYPE = 'E'.  
            "Point A:      I do not know what to do??????
      ENDIF.
 ENDIF.     


.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;His speech changed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciao,&lt;/P&gt;&lt;P&gt;Serena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 12:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198698#M1626022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-26T12:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198699#M1626023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Serena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP transactions adhere to the properties of an [ACID transaction|http://en.wikipedia.org/wiki/ACID#Isolation]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key point to discuss here is "atomicity" which means "all or nothing". As i had mentioned in my previous post, you should bundle all the BAPI calls in a single LUW. This will ensure if the commit fails all the previous changes are also rolled back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you get the point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Aug 2011 11:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198699#M1626023</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-08-28T11:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198700#M1626024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas&lt;/P&gt;&lt;P&gt;It is true, the key point here is to discuss "atomicity" -  "all or nothing".&lt;/P&gt;&lt;P&gt;Thank you, your response is clear and precise and is worth 10 points :-).&lt;/P&gt;&lt;P&gt;Ciao,&lt;/P&gt;&lt;P&gt;Serena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2011 06:19:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198700#M1626024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-29T06:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT - return error handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198701#M1626025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just came across this old post and find your suggestion... and I don't think it's 100% correct, sorry. IMHO, your statement would be correct, if saying 'you should bundle all &lt;STRONG&gt;function calls in update task&lt;/STRONG&gt; in a single LUW. This will ensure if the commit fails all the previous changes are also rolled back.'&lt;/P&gt;&lt;P&gt;The important thing is that we are discussing the BAPIs here - and these are usually developed the way that all the checks are carried out before the update FM is registered in the BAPI for update processing, with purpose to detect all potential errors at the first place. So, it's very, very unlikely that any BAPI would trigger the same kind of errors in the update FM as we can normally see in dialog transactions where the errors occur time from time and lead to express message about cancelled update.&lt;/P&gt;&lt;P&gt;What I intend to say is that BAPI errors (of application nature, i.e. 'logical' or 'data integrity risk' errors) are detected first and (should any be found) returned in some BAPIRET2 return table actually &lt;STRONG&gt;before&lt;/STRONG&gt; BAPI reaches the update FM registration internally. Then if one out of 10 BAPI calls fails this way (which can be detected just by looking for 'E' messages in return table) then COMMIT WORK AND WAIT would not fail but would rather process remaining 9 BAPIs successfully (since the BAPI which 'failed' did not manage to register the update FM yet).&lt;/P&gt;&lt;P&gt;So, to reach 'all or nothing' logic on more BAPIs in one LUW, the only way is to check the presence of 'E' message after each BAPI call and stop the processing on the first 'E' message found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Michal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2016 01:38:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-return-error-handling/m-p/8198701#M1626025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-09T01:38:35Z</dc:date>
    </item>
  </channel>
</rss>

