<?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: MB_DOCUMENT_BADI (MB_DOCUMENT_BEFORE_UPDATE) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mb-document-badi-mb-document-before-update/m-p/5234960#M1209895</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;this BADI is really weird. You have to be really careful what you put in it. There is even OSS note related to this problem -  Note 1284654. I briefly checked BAPI BAPI_BATCH_CHANGE and I found the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* End of transaction - IDOC-creation or directly COMMIT WORK
  IF sy-subrc IS INITIAL.
    CALL FUNCTION 'TRANSACTION_END'
         EXPORTING
              transaction_id = f_transaction_id
         EXCEPTIONS
              OTHERS         = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it calls COMMIT WORK automatically. Therefore you don't have to call BAPI_COMMIT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 05:46:35 GMT</pubDate>
    <dc:creator>mvoros</dc:creator>
    <dc:date>2009-02-23T05:46:35Z</dc:date>
    <item>
      <title>MB_DOCUMENT_BADI (MB_DOCUMENT_BEFORE_UPDATE)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mb-document-badi-mb-document-before-update/m-p/5234959#M1209894</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;I implemented the BADI MB_DOCUMENT_BADI - Method MB_DOCUMENT_BEFORE_UPDATE. Inside the method I called a custom Function Module which calls a BAPI (BAPI_BATCH_CHANGE). However, it was reported that users sometimes encounter an update termination when using MIGO.When I opened an OSS message, they told me that the BADI implementation caused it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is, should the FM (which contains the call to the BAPI) be called in BACKGROUND TASK AS SEPARATE UNIT ? If it is going to be called in this mode, do I need to also add an explicit BAPI_COMMIT after the BAPI_BATCH_CHANGE is called ? In the current version of the method, the FM is called as a normal function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2009 02:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mb-document-badi-mb-document-before-update/m-p/5234959#M1209894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-20T02:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: MB_DOCUMENT_BADI (MB_DOCUMENT_BEFORE_UPDATE)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mb-document-badi-mb-document-before-update/m-p/5234960#M1209895</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;this BADI is really weird. You have to be really careful what you put in it. There is even OSS note related to this problem -  Note 1284654. I briefly checked BAPI BAPI_BATCH_CHANGE and I found the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* End of transaction - IDOC-creation or directly COMMIT WORK
  IF sy-subrc IS INITIAL.
    CALL FUNCTION 'TRANSACTION_END'
         EXPORTING
              transaction_id = f_transaction_id
         EXCEPTIONS
              OTHERS         = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it calls COMMIT WORK automatically. Therefore you don't have to call BAPI_COMMIT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mb-document-badi-mb-document-before-update/m-p/5234960#M1209895</guid>
      <dc:creator>mvoros</dc:creator>
      <dc:date>2009-02-23T05:46:35Z</dc:date>
    </item>
  </channel>
</rss>

