<?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: COMMIT WORK and WAIT FOR n SECONDS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491034#M562234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends a bit on the way you update the data. If you're doing this via batch load and then you call "CALL TRANSACTION" you can use "UPDATE S" parameter.&lt;/P&gt;&lt;P&gt;In other cases you can try to lock a record until it is changed and not read data not in display mode but in change mode. You'll be sure that the data has changed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2007 14:59:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-19T14:59:02Z</dc:date>
    <item>
      <title>COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491032#M562232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am designing a WebDynpro Java application.  It makes an update call followed immediately by a display call which should return the data that was just updated.  However, it appears that there is some DB latency involved and the data takes a few seconds to update.  The application displays old data if the display call is performed too quickly after the update call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All suggestions I could find point to having a Thread sleep on the Java side for a few seconds or have a WAIT FOR n SECONDS and/or COMMIT WORK AND WAIT statement in the ABAP function module.  Neither of these solutions is acceptable in a company-wide application where database latency could vary significantly based on traffic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried all kinds of functions (i.e. BAPI_TRANSACTION_COMMIT) as well as various forms of COMMIT WORK... nothing except a WAIT works correctly.  There must be a statement out there that waits for the database write to be complete!  How is this solved without picking an arbitrary WAIT time?  What am I missing?&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>Thu, 19 Jul 2007 13:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491032#M562232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T13:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491033#M562233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the commit work and wait you do not have to have a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition &lt;/P&gt;&lt;P&gt;... AND WAIT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The addition ... AND WAIT makes the program wait for the type V1 update (update with immediate start) to be executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;The update was performed successfully. &lt;/P&gt;&lt;P&gt;SY-SUBRC &amp;lt;&amp;gt; 0: &lt;/P&gt;&lt;P&gt;The update was not performed successfully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 14:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491033#M562233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491034#M562234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends a bit on the way you update the data. If you're doing this via batch load and then you call "CALL TRANSACTION" you can use "UPDATE S" parameter.&lt;/P&gt;&lt;P&gt;In other cases you can try to lock a record until it is changed and not read data not in display mode but in change mode. You'll be sure that the data has changed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 14:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491034#M562234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T14:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491035#M562235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried the statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it had no success.  It's like when I call the data update BAPI it runs asychronously.  Any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; With the commit work and wait you do not have to have&lt;/P&gt;&lt;P&gt;&amp;gt; a time.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Addition &lt;/P&gt;&lt;P&gt;&amp;gt; ... AND WAIT &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Effect &lt;/P&gt;&lt;P&gt;&amp;gt; The addition ... AND WAIT makes the program wait for&lt;/P&gt;&lt;P&gt;&amp;gt; the type V1 update (update with immediate start) to&lt;/P&gt;&lt;P&gt;&amp;gt; be executed. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;&amp;gt; The update was performed successfully. &lt;/P&gt;&lt;P&gt;&amp;gt; SY-SUBRC &amp;lt;&amp;gt; 0: &lt;/P&gt;&lt;P&gt;&amp;gt; The update was not performed successfully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 16:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491035#M562235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T16:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491036#M562236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can write the other way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare one variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wa_try type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_try = 10. -&amp;gt; set as 10 ,even you do not get value ,keep on incresing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after BAPI FM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can call comitt fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after BAPI_TRANSACTION_COMITT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just use simple logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do wa_try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from table into table &lt;/P&gt;&lt;P&gt;                              where record = bapi fm record ( You get in RET2 Message).&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&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;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 17:09:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491036#M562236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T17:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491037#M562237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing worked; we unfortunately ended up sticking with the WAIT FOR n SECONDS solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2008 12:36:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491037#M562237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-17T12:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: COMMIT WORK and WAIT FOR n SECONDS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491038#M562238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put the wait in a loop, and loop until the condition is met.  The condition could be the retrieved data matches what was written, that a lock has been removed, or the data exists in the table.  In the past, I've used the "lock" method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop.
  if I can lock the object.
    unlock object.
    exit.
  endif.
  wait.
endloop.

do something.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2008 12:44:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-for-n-seconds/m-p/2491038#M562238</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-10-17T12:44:22Z</dc:date>
    </item>
  </channel>
</rss>

