<?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: WAIT UNTIL during parallel processing - condition true, when obviously false in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263191#M1987221</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt;, what is the general logic behind used_slots and slots_allocated and how do both values change over time?&lt;/P&gt;&lt;P&gt;In my scenarios of applying parall processing, I would manage the parallel tasks this way:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Determine how many parallel tasks are &lt;STRONG&gt;necessary and available&lt;/STRONG&gt; (e.g. &lt;EM&gt;n&lt;/EM&gt;-tasks)&lt;BR /&gt;If necessary tasks are less than available, n will be equal to necessary tasks&lt;BR /&gt;If available tasks are less then necessary, n will be equal to available tasks&lt;/LI&gt;&lt;LI&gt;Start &lt;EM&gt;n&lt;/EM&gt;-parallel tasks and &lt;EM&gt;add 1&lt;/EM&gt; to &lt;EM&gt;count_tasks&lt;/EM&gt; for each task started&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Add 1&lt;/EM&gt; to &lt;EM&gt;finished_tasks&lt;/EM&gt; for each task that is finished&lt;/LI&gt;&lt;LI&gt;Wait for all &lt;EM&gt;n&lt;/EM&gt;-parallel tasks to end which is when &lt;EM&gt;count_tasks = finished_tasks:&lt;/EM&gt;&lt;BR /&gt;During the execution of the &lt;EM&gt;WAIT UNTIL&lt;/EM&gt; command, &lt;EM&gt;count_task&lt;/EM&gt; has the value &lt;EM&gt;n&lt;/EM&gt; from the beginning and &lt;EM&gt;finished_tasks&lt;/EM&gt; will gradually get higher until it also has the value of &lt;EM&gt;n&lt;/EM&gt;, which takes place when all tasks are finished.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In your scenario, I assume you have m parallel tasks, but only n available slots at the same time for processing the tasks (n &amp;lt; m). That way, you can only start n tasks right away, and have to queue the remaining tasks until the first set of tasks are finished. Once a task is finished, you will take the first next task in the queue and start it.&lt;/P&gt;&lt;P&gt;Is this correct so far?&lt;BR /&gt;The interesting question would be then, how and when do the counters for used_slots and slots_allocated change over time? Are both 'moving' targets?&lt;BR /&gt;I am not sure if my questioning is going to solve your problem, but I am trying to understand the logic first.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Aug 2020 11:58:57 GMT</pubDate>
    <dc:creator>michael_piesche</dc:creator>
    <dc:date>2020-08-25T11:58:57Z</dc:date>
    <item>
      <title>WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263188#M1987218</link>
      <description>&lt;P&gt;From the debugger&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1837763-condition-ignored.jpg" /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;   WAIT UNTIL used_slots LT slots_allocated.
    " Get number of first free slot
    READ TABLE slots WITH KEY used = abap_false REFERENCE INTO DATA(slot).
    ADD 1 TO used_slots.
    slot-&amp;gt;used = abap_true.
    ret_result = slot-&amp;gt;task_name.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Clearly used_slots is &lt;STRONG&gt;not&lt;/STRONG&gt; less than slots_allocated. &lt;/P&gt;
  &lt;P&gt;Any suggestions? Thanks,&lt;/P&gt;
  &lt;P&gt;matt&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:25:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263188#M1987218</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-08-25T10:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263189#M1987219</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Just a guess, but maybe that's the reason: "&lt;EM&gt;If the result of log_exp is false and &lt;STRONG&gt;there is no asynchronous function call with a callback routine&lt;/STRONG&gt;, the execution of the program is not interrupted (regardless of the result of log_exp) and sy-subrc is set to the value 4.&lt;/EM&gt;". Although, you probably checked this already.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapwait_until.htm"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapwait_until.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263189#M1987219</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-08-25T10:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263190#M1987220</link>
      <description>&lt;P&gt;Also, from the same SAP Help page: "&lt;EM&gt;If the new check on the result of the logical expression is false and the callback routines of the functions previously called asynchronously were all executed, sy-subrc is set to 4 and the execution of the program is resumed with the statement that follows WAIT.&lt;/EM&gt;". This gives me an idea, that maybe records of the USED_SLOTS internal table are not updated properly. Have you checked that part? &lt;/P&gt;&lt;P&gt;What is the SY-SUBRC value after the WAIT?&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
      <pubDate>Tue, 25 Aug 2020 10:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263190#M1987220</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-08-25T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263191#M1987221</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt;, what is the general logic behind used_slots and slots_allocated and how do both values change over time?&lt;/P&gt;&lt;P&gt;In my scenarios of applying parall processing, I would manage the parallel tasks this way:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Determine how many parallel tasks are &lt;STRONG&gt;necessary and available&lt;/STRONG&gt; (e.g. &lt;EM&gt;n&lt;/EM&gt;-tasks)&lt;BR /&gt;If necessary tasks are less than available, n will be equal to necessary tasks&lt;BR /&gt;If available tasks are less then necessary, n will be equal to available tasks&lt;/LI&gt;&lt;LI&gt;Start &lt;EM&gt;n&lt;/EM&gt;-parallel tasks and &lt;EM&gt;add 1&lt;/EM&gt; to &lt;EM&gt;count_tasks&lt;/EM&gt; for each task started&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Add 1&lt;/EM&gt; to &lt;EM&gt;finished_tasks&lt;/EM&gt; for each task that is finished&lt;/LI&gt;&lt;LI&gt;Wait for all &lt;EM&gt;n&lt;/EM&gt;-parallel tasks to end which is when &lt;EM&gt;count_tasks = finished_tasks:&lt;/EM&gt;&lt;BR /&gt;During the execution of the &lt;EM&gt;WAIT UNTIL&lt;/EM&gt; command, &lt;EM&gt;count_task&lt;/EM&gt; has the value &lt;EM&gt;n&lt;/EM&gt; from the beginning and &lt;EM&gt;finished_tasks&lt;/EM&gt; will gradually get higher until it also has the value of &lt;EM&gt;n&lt;/EM&gt;, which takes place when all tasks are finished.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In your scenario, I assume you have m parallel tasks, but only n available slots at the same time for processing the tasks (n &amp;lt; m). That way, you can only start n tasks right away, and have to queue the remaining tasks until the first set of tasks are finished. Once a task is finished, you will take the first next task in the queue and start it.&lt;/P&gt;&lt;P&gt;Is this correct so far?&lt;BR /&gt;The interesting question would be then, how and when do the counters for used_slots and slots_allocated change over time? Are both 'moving' targets?&lt;BR /&gt;I am not sure if my questioning is going to solve your problem, but I am trying to understand the logic first.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 11:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263191#M1987221</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-08-25T11:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263192#M1987222</link>
      <description>&lt;P&gt;You got it first time - although I was thinking it must the second one, initially. I saw asynchronous function calls with callback executing - but then I checked ST22 and found dumps... I'd a typo in the FM name. It didn't exist...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 12:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263192#M1987222</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-08-25T12:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: WAIT UNTIL during parallel processing - condition true, when obviously false</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263193#M1987223</link>
      <description>&lt;P&gt;The lack of function name validation during code activation should be added long time ago...&lt;/P&gt;&lt;P&gt;Glad you've found the issue.&lt;/P&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Tue, 25 Aug 2020 12:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-until-during-parallel-processing-condition-true-when-obviously-false/m-p/12263193#M1987223</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-08-25T12:20:47Z</dc:date>
    </item>
  </channel>
</rss>

