<?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 BAPI_TRANSACTION_COMMIT &amp; BAPI_TRANSACTION_ROLLBACK in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-bapi-transaction-rollback/m-p/8227571#M1628807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say I am uploading fixed assets data using BAPI_FIXEDASSET_CREATE from excel file. There are many assets to be uploaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this as the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at table ( table contains all the fixed assets data )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Logic follows here to populate data for one fixed asset ***&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call BAPI_FIXEDASSET_CREATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     BAPI_TRANSACTION_ROLLBACK.&lt;/P&gt;&lt;P&gt;    add error message to output report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif success message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     add success message to output report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&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 with wait = X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My queries:&lt;/P&gt;&lt;P&gt;1. Can BAPI_TRANSACTION_COMMIT commit all the successful created assets simultaneously?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Is it advisable to perform BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE or the above logic would work fine? If any record fails during commit I need to know which one failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Will performing BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE slow down the process when compared to commiting all successful records simultaneously&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2011 03:52:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-09-23T03:52:51Z</dc:date>
    <item>
      <title>BAPI_TRANSACTION_COMMIT &amp; BAPI_TRANSACTION_ROLLBACK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-bapi-transaction-rollback/m-p/8227571#M1628807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say I am uploading fixed assets data using BAPI_FIXEDASSET_CREATE from excel file. There are many assets to be uploaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this as the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at table ( table contains all the fixed assets data )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Logic follows here to populate data for one fixed asset ***&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call BAPI_FIXEDASSET_CREATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     BAPI_TRANSACTION_ROLLBACK.&lt;/P&gt;&lt;P&gt;    add error message to output report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif success message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     add success message to output report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&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 with wait = X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My queries:&lt;/P&gt;&lt;P&gt;1. Can BAPI_TRANSACTION_COMMIT commit all the successful created assets simultaneously?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Is it advisable to perform BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE or the above logic would work fine? If any record fails during commit I need to know which one failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Will performing BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE slow down the process when compared to commiting all successful records simultaneously&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 03:52:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-bapi-transaction-rollback/m-p/8227571#M1628807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-23T03:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT &amp; BAPI_TRANSACTION_ROLLBACK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-bapi-transaction-rollback/m-p/8227572#M1628808</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;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any record fails during commit I need to know which one failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you have to commit each bapi call and make use of the return parameter of BAPI_TRANSACTION_COMMIT, for this you have to pass wait = X becasue when sy-subrc is 4 after a synchronous call then it implies error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case you can do this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call your bapi with required data, check if the call is successfull and then can call commit with wait.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commit work - Asynchronous&lt;/P&gt;&lt;P&gt;Commit work with wait - Synchronous&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All your questions can be cleared by yourself by reading SAP help documentation on &lt;STRONG&gt;Logical unit of Work&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 04:25:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-bapi-transaction-rollback/m-p/8227572#M1628808</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-09-23T04:25:43Z</dc:date>
    </item>
  </channel>
</rss>

