<?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: Rollback a transaction in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107592#M982255</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;In BAPI we can use BAPI_TRANSACTION_ROLLBACK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM commit_work .

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = ' '.


ENDFORM.                    " COMMIT_WORK&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BDC we can commit in following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL TRANSACTION 'SE38'  USING BDCDATA  MODE 'N' 
                           MESSAGES INTO ITAB.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A call transaction ends successfully for the following reasons: &lt;/P&gt;&lt;P&gt;1. COMMIT WORK &lt;/P&gt;&lt;P&gt;2. Next screen = 0 &lt;/P&gt;&lt;P&gt;3. LEAVE TO TRANSACTION SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any errors are found they get stored in itab as above.&lt;/P&gt;&lt;P&gt;We can handle that error message and commit the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If itab[] is initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;commit and wait.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2008 06:11:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-07T06:11:21Z</dc:date>
    <item>
      <title>Rollback a transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107589#M982252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling an RFC from VB.&lt;/P&gt;&lt;P&gt;The RFC first executes a BDC, then a BAPI and finally inserts data in z-table.&lt;/P&gt;&lt;P&gt;In case operation fails in any one process, I want to rollback.&lt;/P&gt;&lt;P&gt;Is this possible ? if yes then plz let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 05:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107589#M982252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-07T05:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rollback a transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107590#M982253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for BAPI u can use BAPI_TRANSACTION_ROLLBACK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for BDC you can put a commit and wait statement in a condition..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if &amp;lt;condition&amp;gt; eq 'false'.
commit work and wait.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 05:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107590#M982253</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-07-07T05:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rollback a transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107591#M982254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;call commit BAPI after entire process is done...&lt;/P&gt;&lt;P&gt;this way is anything fails in between data will not get comitted...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 05:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107591#M982254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-07T05:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rollback a transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107592#M982255</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;In BAPI we can use BAPI_TRANSACTION_ROLLBACK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM commit_work .

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = ' '.


ENDFORM.                    " COMMIT_WORK&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BDC we can commit in following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL TRANSACTION 'SE38'  USING BDCDATA  MODE 'N' 
                           MESSAGES INTO ITAB.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A call transaction ends successfully for the following reasons: &lt;/P&gt;&lt;P&gt;1. COMMIT WORK &lt;/P&gt;&lt;P&gt;2. Next screen = 0 &lt;/P&gt;&lt;P&gt;3. LEAVE TO TRANSACTION SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any errors are found they get stored in itab as above.&lt;/P&gt;&lt;P&gt;We can handle that error message and commit the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If itab[] is initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;commit and wait.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 06:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107592#M982255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-07T06:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rollback a transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107593#M982256</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;Your procedure should first lock all necessary data.&lt;/P&gt;&lt;P&gt;After that it should check out whether intended changes are possible.&lt;/P&gt;&lt;P&gt;If it is not possible remove locks and provide negative return.&lt;/P&gt;&lt;P&gt;If it is possible perform your changes, remove locks and provide positive return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Walter Habich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Walter Habich on Jul 7, 2008 8:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 06:29:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rollback-a-transaction/m-p/4107593#M982256</guid>
      <dc:creator>former_member435013</dc:creator>
      <dc:date>2008-07-07T06:29:42Z</dc:date>
    </item>
  </channel>
</rss>

