<?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 commit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134015#M112513</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;i developed a custom transaction in which i am doing several database updates. i want these to take place like standard SAP LUW all or none changes.&lt;/P&gt;&lt;P&gt;what has to be done to accomplish this..&lt;/P&gt;&lt;P&gt;presently i have something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update xxx .&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;update yyy.&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'z_bapi_xxx' in update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'bapi_transaction_commit'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2005 19:26:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-29T19:26:25Z</dc:date>
    <item>
      <title>commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134015#M112513</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;i developed a custom transaction in which i am doing several database updates. i want these to take place like standard SAP LUW all or none changes.&lt;/P&gt;&lt;P&gt;what has to be done to accomplish this..&lt;/P&gt;&lt;P&gt;presently i have something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update xxx .&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;update yyy.&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'z_bapi_xxx' in update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'bapi_transaction_commit'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 19:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134015#M112513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-29T19:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134016#M112514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you put commit work after every table then it will commit till that time and if something goes wrong later the previous one will not rollback. &lt;/P&gt;&lt;P&gt;So, you have put commit work after all. so that it will either commit all or rollback all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 19:51:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134016#M112514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-29T19:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134017#M112515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can issue commit work after every logical point you want to save data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 20:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134017#M112515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-29T20:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134018#M112516</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;usually you do not need any COMMIT WORK in your program, because at the end of the program run, a commit work is issued automatically and all data are stored in the database.&lt;/P&gt;&lt;P&gt;If the program ends with an error (message type E, A, X), the data are rolled baxk and nothing is stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But note: Any interruption of the program flow (also and especially online acreen input) will do a commit work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And there are exceptions: Any PERFORM ... ON COMMIT will need an explicit COMMIT WORK. The auto commit work will not trigger PERFORM ON COMMIT. Thats why you have to do a COMMIT WORK explicitly after calling any updating BAPI modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best and safest and most efficient way is always to do as SAP does: &lt;/P&gt;&lt;P&gt;Put all to-be-stored data into internal tables. At the end of your transaction, if everything is fine, call a function module IN UPDATE TASK. Create this function module as an UPDATE module, the interface should have all your internal tables. In the module, just do the necessary updates and inserts.&lt;/P&gt;&lt;P&gt;After the CALL FUNCTION ... IN UPDATE TASK&lt;/P&gt;&lt;P&gt;issue the COMMIT WORK.&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;C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 20:47:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134018#M112516</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2005-12-29T20:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134019#M112517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep your code sequence like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update XXX.&lt;/P&gt;&lt;P&gt;Update YYY.&lt;/P&gt;&lt;P&gt;Commit Work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call 'Z_BAPI_XXX'.&lt;/P&gt;&lt;P&gt;Call 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreekanth G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2005 10:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134019#M112517</guid>
      <dc:creator>sreekanthgo</dc:creator>
      <dc:date>2005-12-30T10:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: commit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134020#M112518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your BAPI has RETURN table..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    CLEAR V_ERROR.
    LOOP AT RETURN WHERE TYPE = K_E OR
                         TYPE = K_A OR
                         TYPE = K_X.
      MOVE K_X TO V_ERROR.
      EXIT.
    ENDLOOP.

    IF V_ERROR IS INITIAL.
*-- BAPI COMMIT
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ELSE.
*-- BAPI ROll BACK
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK.
    ENDIF.    " V_ERROR is initial
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreekanth G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2005 10:39:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit/m-p/1134020#M112518</guid>
      <dc:creator>sreekanthgo</dc:creator>
      <dc:date>2005-12-30T10:39:02Z</dc:date>
    </item>
  </channel>
</rss>

