<?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: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202168#M1376239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ahmed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are you passing single entry in loop ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first you should take all entry in one internal table filter as per you requirement in Loop final table you pass in BAPI then use COMMIT , ROLLBACK. it will trigger your BAPI once&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2009 08:29:54 GMT</pubDate>
    <dc:creator>SujeetMishra</dc:creator>
    <dc:date>2009-10-12T08:29:54Z</dc:date>
    <item>
      <title>Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202163#M1376234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need your expert opion/view on this, which one is more efficient, to put the 'BAPI_TRANSACTION_COMMIT' call right after bapi posting call in loop OR put the bapi commit call statement at the end of the process (after looping). This is one of the area in interface program that need can be improved to make the database update and table locking run efficiently. Let say there are 1000 documents (in loop) that need to be posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXAMPLE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution 1: To put commit right after bapi posting in loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;    ...............................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;   EXPORTING &lt;/P&gt;&lt;P&gt;       WAIT = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution 2: To put commit at end of process (after loop)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;    CALL 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;    ...............................................&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;CALL 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;   EXPORTING &lt;/P&gt;&lt;P&gt;       WAIT = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which one is more efficient and faster? solution 1 or 2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ahmad Ariza Abdullah on Oct 11, 2009 4:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Oct 2009 14:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202163#M1376234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-11T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202164#M1376235</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;Better solution is to put Commit FM inside the loop. IF document is succefully posted , call commit bapi otherwise call Rollback bapi. Aslo pass Wait parameter in BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 03:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202164#M1376235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T03:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202165#M1376236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U need to commit only if the BAPI executed correctly without any errors...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab.

CALL 'BAPI_ACC_DOCUMENT_POST'
...............................................
if sy-subrc eq 0.
CALL 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 04:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202165#M1376236</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-10-12T04:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202166#M1376237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all replies. &lt;/P&gt;&lt;P&gt;Let say there are 30000 documents have been posted via BAPI in program without immediate commit call in loop, where exactly SAP will store the updates details before the updates will be commited at the end of process? Can we check the details of each update? Appreciate if you can share documetation or your view on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How exactly SAP handle the BAPI call, request update(SM13) and commit statement? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 06:17:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202166#M1376237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T06:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202167#M1376238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ahmad,&lt;/P&gt;&lt;P&gt;   Every Bapi returns a message table i.e RETURN. If there is any error in execution of BAPI. This table will have an error message in it.&lt;/P&gt;&lt;P&gt; In your case, what you can do is to create one update function module, include BAPI_ACC_DOCUMENT_POST in this function module and update all the documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now call your update function module with IN UPDATE TASK addtion, this way a LUW will be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now call BAPI_TRANSACTION_COMMIT with import parameter WAIT = 'X'.&lt;/P&gt;&lt;P&gt;This way it will execute COMMIT WORK AND WAIT statement which returns a sy-subrc value.&lt;/P&gt;&lt;P&gt;If there is some error in your function module, you 'll get sy-subrc not equal to zero and no document will be updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 06:44:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202167#M1376238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T06:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202168#M1376239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ahmed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are you passing single entry in loop ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first you should take all entry in one internal table filter as per you requirement in Loop final table you pass in BAPI then use COMMIT , ROLLBACK. it will trigger your BAPI once&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 08:29:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202168#M1376239</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2009-10-12T08:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Where should we put 'BAPI_TRANSACTION_COMMIT' call in program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202169#M1376240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless and until you use a commit statement the BAPI will not commit, if the BAPI doesn't have auto commit in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Document number will be generated and it will be wasted, its better you commit after the successful bapi call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maehsh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 11:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-should-we-put-bapi-transaction-commit-call-in-program/m-p/6202169#M1376240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-12T11:22:58Z</dc:date>
    </item>
  </channel>
</rss>

