<?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: Timeout when foreground &amp; background run concurrently using SD_SALESDOCUMENT_CREATE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429918#M1739086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like there is a lock on the number range set by one of the two programs (probably the background one). The other program tries to access the number range to get a new sales order number but fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could solve this by changing your program where you first check if another instance is running already. Implement the singleton pattern.(ABAP OO) or call the lock mechanism for a report at the start of your program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See e.g.&amp;nbsp; &lt;A _jive_internal="true" href="https://answers.sap.com/thread/1838118"&gt;http://scn.sap.com/thread/1838118&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to try until the lock is finished, place the call to the enqueue function module in a while loop (on sy-subrc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 May 2013 13:04:58 GMT</pubDate>
    <dc:creator>PeterJonker</dc:creator>
    <dc:date>2013-05-01T13:04:58Z</dc:date>
    <item>
      <title>Timeout when foreground &amp; background run concurrently using SD_SALESDOCUMENT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429916#M1739084</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;I have a program to create sales documents using SD_SALESDOCUMENT_CREATE. The program can be run in &lt;SPAN style="text-decoration: underline;"&gt;foreground &lt;/SPAN&gt;&amp;amp; &lt;SPAN style="text-decoration: underline;"&gt;background&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;It works fine if when the program is executed in foreground when there is no other background job running. But the foreground processing will fail with &lt;STRONG&gt;time out error&lt;/STRONG&gt; when there is &lt;SPAN style="color: #ff0000;"&gt;another background job for this program that is running concurrently&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/210932" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 03:45:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429916#M1739084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-04-30T03:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout when foreground &amp; background run concurrently using SD_SALESDOCUMENT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429917#M1739085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prakesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please check the performance making use of the tool SAT/SE30. Hope you have made use of locks before actually processing the sales orders if not that could be one of the issues.&lt;/P&gt;&lt;P&gt;&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;Suresh Nair&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 04:49:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429917#M1739085</guid>
      <dc:creator>former_member15255</dc:creator>
      <dc:date>2013-04-30T04:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout when foreground &amp; background run concurrently using SD_SALESDOCUMENT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429918#M1739086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like there is a lock on the number range set by one of the two programs (probably the background one). The other program tries to access the number range to get a new sales order number but fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could solve this by changing your program where you first check if another instance is running already. Implement the singleton pattern.(ABAP OO) or call the lock mechanism for a report at the start of your program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See e.g.&amp;nbsp; &lt;A _jive_internal="true" href="https://answers.sap.com/thread/1838118"&gt;http://scn.sap.com/thread/1838118&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to try until the lock is finished, place the call to the enqueue function module in a while loop (on sy-subrc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2013 13:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429918#M1739086</guid>
      <dc:creator>PeterJonker</dc:creator>
      <dc:date>2013-05-01T13:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout when foreground &amp; background run concurrently using SD_SALESDOCUMENT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429919#M1739087</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;It look like from the DUMP sceenshot that the creation process hits the NRIV table quiet frequently as both your background and your foreground programs try to access the same number range. You can try to use the locks (Lock Obj. ESNRIV) associated with the usage of the table for better access of this and hence improve the execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for the background jobs to be more efficient you can design to trigger multiple jobs for a set of input values. Say before you use the BAPI SD_SALESDOCUMENT_CREATE. create a job for first 50 entries then for next 50 another job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can use SET UPDATE TASK LOCAL feature in SAP along with CALL FUNCTION ... IN UPDATE TASK this can help you in better processing management. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Arindam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 05:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/timeout-when-foreground-background-run-concurrently-using-sd-salesdocument/m-p/9429919#M1739087</guid>
      <dc:creator>arindam_m</dc:creator>
      <dc:date>2013-05-03T05:03:50Z</dc:date>
    </item>
  </channel>
</rss>

