<?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: SAP ABAP Parallel Processing Controls in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676749#M29982</link>
    <description>&lt;P&gt;Hi Joshi,&lt;/P&gt;
  &lt;P&gt;SAP documentation about &lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapwait_until.htm" target="_blank"&gt;asynchronous&lt;/A&gt; tasks also will help you.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jun 2018 23:54:03 GMT</pubDate>
    <dc:creator>roberto_forti</dc:creator>
    <dc:date>2018-06-30T23:54:03Z</dc:date>
    <item>
      <title>SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676747#M29980</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I have gone through parallel processing concept of SAP where we are using below statement to achieve it:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;'CALL FUNCTION &lt;/STRONG&gt;‘ZPARALLEL_PROCESS_FM’ &lt;B&gt;STARTING NEW TASK&lt;/B&gt; lv_taskname&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt; DESTINATION IN GROUP&lt;/STRONG&gt; p_rfcgr'&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;But I wanted to know below:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;We have a scenario where we are running a daily batch job and that job has parallel processing logic. But the parallel processing is not getting completed by the time the same job starts again on the very next day. Due to which the output files are generating incorrectly.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;How we can control/handle a scenario to make sure the next job should not start until previous job completes or is it possible to make sure the asynchronous job should get complete with in some limited time. &lt;/P&gt;
  &lt;P&gt;There is a work around, we can write a condition in the report using lock object, we can do lock a table when job starts and unlock when it finishes in between if any the same job triggers again we will put it on wait.&lt;/P&gt;
  &lt;P&gt;But may i know is there any standard way of handling.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Prince Joshi&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 05:30:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676747#M29980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-06-29T05:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676748#M29981</link>
      <description>&lt;P&gt;Keep the main program active til end of execution (it would use one process) you can check execution of RFC call using option CALLING method ON END OF TASK. (add a counter when starting a task and decrement it in the end of task method, wait til 0 running tasks)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;" Call
DO  n TIMES.
  ADD 1 TO taskname.
  CALL FUNCTION ‘zparallel_process_fm’
    STARTING NEW TASK taskname
    CALLING method ON END OF TASK.
  "
ENDDO.
" Wait
WAIT UNTIL taskname LT '0001'.
" Method
SUBTRACT 1 FROM taskname.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In the main program check that no other job (same name or same report is currently running, don't forget you are running so exit when 2 'R'unning job are found.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;" Look for jobs running same program
CALL FUNCTION 'BP_FIND_JOBS_WITH_PROGRAM'
  EXPORTING
    abap_program_name = lv_repid
    status            = 'R'
  TABLES
    joblist           = lt_joblist
  EXCEPTIONS
    OTHERS            = 0.
" Exit if 2 jobs 
DESCRIBE TABLE lt_joblist LINES lv_nbjobs. " lines( ) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 05:49:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676748#M29981</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-06-29T05:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676749#M29982</link>
      <description>&lt;P&gt;Hi Joshi,&lt;/P&gt;
  &lt;P&gt;SAP documentation about &lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapwait_until.htm" target="_blank"&gt;asynchronous&lt;/A&gt; tasks also will help you.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 23:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676749#M29982</guid>
      <dc:creator>roberto_forti</dc:creator>
      <dc:date>2018-06-30T23:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676750#M29983</link>
      <description>&lt;P&gt;Hi Raymond,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thanks a lot for your inputs.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;So, Ideally you mean we should use FM &lt;STRONG&gt;'BP_FIND_JOBS_WITH_PROGRAM'&lt;/STRONG&gt; in the starting of our main program. So, It will check if already the report is executing in parallel or not.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;yes it seems to be correct for below statement where we are using END OF TASK method as our main program will still be running:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION ‘zparallel_process_fm’ STARTING NEW TASK taskname
CALLING method ON END OF TASK.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;But what if we not using statement &lt;STRONG&gt;CALLING ZMETHOD END OF TASK&lt;/STRONG&gt; (as i asked this in my question).&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;In that case, this FM &lt;STRONG&gt;'BP_FIND_JOBS_WITH_PROGRAM' &lt;/STRONG&gt;will not be useful because main program would have been finished the execution and in parallel the FM would be executing/waiting. So, how we can make sure that all the asynchronous FMs must execute before the next job starts(as it is a daily job).&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;Prince Joshi&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 06:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676750#M29983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-03T06:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676751#M29984</link>
      <description>&lt;P&gt;Then you could&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;switch from STARTING NEW TASK to IN BACKGROUND TASK/UNIT commit to trigger executions, at start of report select from ARFCSTATE for running task&lt;/LI&gt;
   &lt;LI&gt;Store number of submitted task somewhere (table, cluster, shared cluster...) decrement it at end of FM execution, read at start of report&lt;/LI&gt;
   &lt;LI&gt;Use some lock (create a z-lock object, lock value of task at start of FM, enqueue read at start of program for any lock)&lt;/LI&gt;
   &lt;LI&gt;...&lt;/LI&gt;
  &lt;/UL&gt;</description>
      <pubDate>Tue, 03 Jul 2018 07:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676751#M29984</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-07-03T07:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676752#M29985</link>
      <description>&lt;P&gt;Yes Correct, I think we have to go for Lock objects only to make sure process is consistent.&lt;/P&gt;
  &lt;P&gt;Thanks Raymond &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 10:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676752#M29985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-03T10:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAP ABAP Parallel Processing Controls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676753#M29986</link>
      <description>&lt;P&gt;Yes Correct!! &lt;/P&gt;&lt;P&gt;Parallel Processing means Asynchronous Type of function module. &lt;/P&gt;&lt;P&gt;Generally, when we call a function module, it will stop the current program , execute another ( called ) program and then returns control to original program and again origi...&lt;STRONG&gt;&lt;/STRONG&gt;&lt;A href="http://sapabapcentral.blogspot.com/p/sap-abap-ctaw12731.html" target="_blank"&gt;&lt;STRONG&gt;Read More&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:01:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-abap-parallel-processing-controls/m-p/676753#M29986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-07-08T11:01:04Z</dc:date>
    </item>
  </channel>
</rss>

