<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998310#M1164069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a &lt;STRONG&gt;Do enddo&lt;/STRONG&gt; here. Inside this you can select the data from database and exit if the record is found. If the record is not found, you can increament a counter and wait for 1 second. if the counter reaches upto a certain limit , then you can forcefully exit.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data counter type i.
do.
 select  (fields) from (table)
   into (wa)  
      where &amp;lt;condtion&amp;gt;.

   if sy-subrc = 0 or counter = 10.  " for example
     exit.
   endif.

add 1 to counter.
wait up to 1 seconds.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way , the program will try to select the data and after 10 seconds it will forecefull exit if the record is still not fetched. But in most cases it might exit at the first select if the sy-subrc is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jan 2009 10:58:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-13T10:58:42Z</dc:date>
    <item>
      <title>Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998305#M1164064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement at the end of which a number is generated(Say Business Partner no. or Sales order number.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to use the number immediately afterwards(in the same program) I get an error like the number does not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Evidently, the database takes some time to be updated(4-5 seconds). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to make this process instantaneous?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already used Commit work / BAPI_TRANSACTION_COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:32:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998305#M1164064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T10:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998306#M1164065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;afer commit write statement as follwos:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wait up to 5 sec.&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;anupama.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998306#M1164065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T10:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998307#M1164066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i don't know to do it in system, bcoz system takes some time .&lt;/P&gt;&lt;P&gt;i am having one alternate solution wait u put delay conditon there till ur BAPI commiting when commit finish nad u have that no u can us no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Do.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Receiving task results&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT' --Put ur BAPI There after Commit i don't know its working for bapi or not &lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      RESOURCE_FAILURE      = 1&lt;/P&gt;&lt;P&gt;      communication_failure = 2  MESSAGE lv_mssg&lt;/P&gt;&lt;P&gt;      system_failure        = 3  MESSAGE lv_mssg&lt;/P&gt;&lt;P&gt;      OTHERS                = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if  sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     ""Do your Process&lt;/P&gt;&lt;P&gt;    exit&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Wait in a task&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '001'&lt;/P&gt;&lt;P&gt;    PERFORMING f_task_end ON END OF TASK&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      seconds               = 5        " Refresh time&lt;/P&gt;&lt;P&gt;      busy_waiting          = space&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      RESOURCE_FAILURE      = 1&lt;/P&gt;&lt;P&gt;      communication_failure = 2  MESSAGE lv_mssg&lt;/P&gt;&lt;P&gt;      system_failure        = 3  MESSAGE lv_mssg&lt;/P&gt;&lt;P&gt;      OTHERS                = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also check syntex i make this in hurry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put send u ur feedback/query  i am wating&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:45:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998307#M1164066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T10:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998308#M1164067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done that too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But we are talking about 1000 such records at a time.&lt;/P&gt;&lt;P&gt;5 seconds per record gives 5000 seconds.&lt;/P&gt;&lt;P&gt;Or 82 minutes??????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:49:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998308#M1164067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T10:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998309#M1164068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI "BAPI_TRANSACTION_COMMIT" is already doin commit and wait. you can check the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only thing you can do is first check whatever updates you are doing in your program check if sy-subrc = 0 then use commit work and wait.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you use above BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a Nice Day.&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>Tue, 13 Jan 2009 10:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998309#M1164068</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2009-01-13T10:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998310#M1164069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a &lt;STRONG&gt;Do enddo&lt;/STRONG&gt; here. Inside this you can select the data from database and exit if the record is found. If the record is not found, you can increament a counter and wait for 1 second. if the counter reaches upto a certain limit , then you can forcefully exit.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data counter type i.
do.
 select  (fields) from (table)
   into (wa)  
      where &amp;lt;condtion&amp;gt;.

   if sy-subrc = 0 or counter = 10.  " for example
     exit.
   endif.

add 1 to counter.
wait up to 1 seconds.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way , the program will try to select the data and after 10 seconds it will forecefull exit if the record is still not fetched. But in most cases it might exit at the first select if the sy-subrc is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998310#M1164069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T10:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998311#M1164070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the use of COMMIT WORK statement? what is its advantage? Reply me asap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2009 10:33:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work/m-p/4998311#M1164070</guid>
      <dc:creator>Rushikesh_Yeole</dc:creator>
      <dc:date>2009-03-09T10:33:04Z</dc:date>
    </item>
  </channel>
</rss>

