<?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: How to split SELECT to slices (parallel processing) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042503#M1351064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Raymond,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate ur professional approach for helping me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ur answers are very precise and easy to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have my solution!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full points for u!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 13:15:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-04T13:15:00Z</dc:date>
    <item>
      <title>How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042494#M1351055</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've have following select statements and I want to split them to some slices so I can apply parallel processing correctly. I should do that because I want follow[ this logic|http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a7f1f505211d189550000e829fbbd/content.htm].&lt;/P&gt;&lt;P&gt;I followed this [guide|http://help.sap.com/saphelp_nw04/helpdata/en/fa/096e92543b11d1898e0000e8322d00/frameset.htm]. &lt;/P&gt;&lt;P&gt;But as I said I don't know how to build these packages.&lt;/P&gt;&lt;P&gt;My idea about package size&lt;/P&gt;&lt;P&gt;package size = Lines of itab in SELECT  / available wp.&lt;/P&gt;&lt;P&gt;But this idea is incorrect. Because first I must do this Select without parallel processing to get the lines of my itab. &lt;/P&gt;&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;how can i build packages and how can I set their size dynamically?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, SDN search or Help.sap.com do not have a solution.&lt;/P&gt;&lt;P&gt;Please do not give me hundred lines of code. Try to explain me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *
    FROM ltak
    INTO TABLE lt_ltak_all
    WHERE lgnum IN so_lgnum
      AND tanum IN so_tanum
      AND bdatu IN so_bdatu
      AND kquit = 'X'  
      AND betyp = 'L'.

  CHECK sy-subrc = 0.

    SELECT *
    FROM ltap
    INTO TABLE lt_ltap_all
    FOR ALL ENTRIES IN lt_ltak_all
    WHERE lgnum = lt_ltak_all-lgnum
      AND tanum = lt_ltak_all-tanum
      AND nltyp = '916'.&lt;/CODE&gt;&lt;/PRE&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;Zaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 10:38:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042494#M1351055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T10:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042495#M1351056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this logic below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE lt_ltak_ltap&lt;/P&gt;&lt;P&gt;  FROM ltak INNER JOIN ltap  &lt;/P&gt;&lt;P&gt;                    ON ltap&lt;SUB&gt;lgnum eq ltak&lt;/SUB&gt;lgnum AND&lt;/P&gt;&lt;P&gt;                       ltap&lt;SUB&gt;tanum eq ltak&lt;/SUB&gt;tanum &lt;/P&gt;&lt;P&gt; WHERE ltak~lgnum IN so_lgnum AND &lt;/P&gt;&lt;P&gt;       ltak~tanum IN so_tanum AND &lt;/P&gt;&lt;P&gt;       ltak~bdatu IN so_bdatu AND &lt;/P&gt;&lt;P&gt;       ltap~nltyp EQ '916'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope to help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 10:50:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042495#M1351056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T10:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042496#M1351057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *  FROM ltak&lt;/P&gt;&lt;P&gt;INTO TABLE lt_ltak_all&lt;/P&gt;&lt;P&gt;INNER JOIN ltap on ltak&lt;SUB&gt;LGNUM = ltap&lt;/SUB&gt;LGNUM&lt;/P&gt;&lt;P&gt;                               ltak&lt;SUB&gt;TANUM = ltap&lt;/SUB&gt;TANUM&lt;/P&gt;&lt;P&gt;WHERE ltak~lgnum IN so_lgnum&lt;/P&gt;&lt;P&gt;AND ltak~tanum IN so_tanum&lt;/P&gt;&lt;P&gt;AND ltak~bdatu IN so_bdatu&lt;/P&gt;&lt;P&gt;AND ltak~kquit = 'X'  &lt;/P&gt;&lt;P&gt;AND ltak~betyp = 'L'&lt;/P&gt;&lt;P&gt;AND nltyp = '916'.&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;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 10:57:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042496#M1351057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042497#M1351058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Akkadech,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;firstly, thank u for ur help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it OK to insert ur select into an aRFC and insert below code to an report, so this select would be parallel processed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report code:&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'Z_GET_PARALLEL'
          STARTING NEW TASK taskname
          DESTINATION IN GROUP mygroup
          CALLING me-&amp;gt;on_return ON END OF TASK
          TABLES
            lt_ltak   = gt_ltak
            lt_ltap   = gt_ltap
 

WAIT UNTIL rcv_jobs &amp;gt;= snd_jobs.

method on_return.
...
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think so because if I execute this report it starts one new task and it calls this aRFC. This aRFC will process it sequentially not parallel.&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 11:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042497#M1351058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T11:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042498#M1351059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try this logic agin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: LT_LTAK LIKE STANDARD TABLE OF LTAK &lt;/P&gt;&lt;P&gt;              WITH HEADER LINE ,&lt;/P&gt;&lt;P&gt;      LT_LTAP LIKE STANDARD TABLE OF LTAP&lt;/P&gt;&lt;P&gt;              WITH HEADER LINE ,&lt;/P&gt;&lt;P&gt;      LT_LTAK_LTAP LIKE STANDARD TABLE OF 'LTAK &amp;amp; LTAP,   &lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE LT_LTAK_LTAP&lt;/P&gt;&lt;P&gt;  FROM LTAK INNER JOIN LTAP&lt;/P&gt;&lt;P&gt;    ON LTAP&lt;SUB&gt;LGNUM EQ LTAK&lt;/SUB&gt;LGNUM AND&lt;/P&gt;&lt;P&gt;       LTAP&lt;SUB&gt;TANUM EQ LTAK&lt;/SUB&gt;TANUM&lt;/P&gt;&lt;P&gt; WHERE LTAK~LGNUM IN SO_LGNUM AND&lt;/P&gt;&lt;P&gt;       LTAK~TANUM IN SO_TANUM AND&lt;/P&gt;&lt;P&gt;       LTAK~BDATU IN SO_BDATU AND&lt;/P&gt;&lt;P&gt;       LTAK~kquit EQ 'X'      AND&lt;/P&gt;&lt;P&gt;       LTAK~betyp EQ 'L'      AND&lt;/P&gt;&lt;P&gt;       LTAP~NLTYP EQ '916'.&lt;/P&gt;&lt;P&gt;LOOP AT LT_LTAK_LTAP.&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING LT_LTAK_LTAP TO LT_LTAK.&lt;/P&gt;&lt;P&gt;  APPEND LT_LTAK.&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING LT_LTAK_LTAP TO LT_LTAK.&lt;/P&gt;&lt;P&gt;  APPEND LT_LTAP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this logic is saving performance for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 11:33:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042498#M1351059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T11:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042499#M1351060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, ur logic is right. But I need to know how should I implement this for parallel processing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 12:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042499#M1351060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T12:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042500#M1351061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First read the first table by package &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  OPEN CURSOR WITH HOLD s_cursor FOR
    SELECT *
      FROM ltak
      INTO TABLE lt_ltak_all
      WHERE lgnum IN so_lgnum
        AND tanum IN so_tanum
        AND bdatu IN so_bdatu
        AND kquit = 'X'  
        AND betyp = 'L'.
  DO. " read by package
    FETCH NEXT CURSOR s_cursor
               INTO TABLE itab1
               PACKAGE SIZE nnnnn.
  IF SY-SUBRC NE 0. EXIT. ENDIF.
" here parallelize
    ADD 1 TO nbr_process.
    CALL FUNCTION 'XXXXX'
       STARTING NEW TASK taskname DESTINATION IN GROUP DEFAULT
       PERFORMING return_info ON END OF TASK
       TABLES
            first_table = itab1
       ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You must use some limitation in the number of tasks running, so count number of tasks submitted, and decrement in the FORM performed ON END OF TASK. When the maximum number is reached you WAIT til a "slot" is free.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 12:23:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042500#M1351061</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-08-04T12:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042501#M1351062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raymond,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ure answer is awesome! It helped me a lot to solve my problem!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if I want to split my SELECT into Packages with linesize of 8000 I need to fill in this in PACKAGE SIZE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where are these packages being saved? &lt;/P&gt;&lt;P&gt;All In itab1? No,  I think,  itab1 is the first package with 8000. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, do I need another OPEN CURSOR WITH HOLD s_cursor FOR .. and  FETCH NEXT CURSOR s_cursor  INTO TABLE itab1 PACKAGE SIZE 8000 for getting and processing my next package?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tuncay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 12:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042501#M1351062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T12:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042502#M1351063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In each iteration in the DO/ENDDO you FETCH another package of say 8000 records in itab1, then you pass this itab1 to a function module in a new task, in the returning FORM executed at end of the FM, you get some internal table returned, which you add to the internal table of the main program.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR.
DO.
  FETCH a package into &amp;lt;work itab&amp;gt;
  Detect end of data, if yes exit DO/ENDDO
  WAIT until number of number of running tasks is correct
  CALL FUNCTION &amp;lt;ztask&amp;gt; STARTING NEW TASK &amp;lt;id&amp;gt; PERFORMING &amp;lt;return&amp;gt; ON END OF TASK TABLES &amp;lt;work itab&amp;gt;.
  Add 1 to number of running tasks
ENDDO.
WAIT until number of running task is zero.
end of job

FORM &amp;lt;return&amp;gt; USIND &amp;lt;id&amp;gt;
  RECEIVE RESULTS FROM FUNCTION TABLES local &amp;lt;returned itab&amp;gt;
  insert lines of &amp;lt;returned itab&amp;gt; to main internal table
  subtract 1 to number of running tasks
ENDFORM

FUNCTION &amp;lt;ztask&amp;gt;
  Execute other selection for all entries of &amp;lt;work itab&amp;gt; received
  fill &amp;lt;returned itab&amp;gt;
ENDFUNCTION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 13:06:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042502#M1351063</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-08-04T13:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to split SELECT to slices (parallel processing)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042503#M1351064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Raymond,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate ur professional approach for helping me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ur answers are very precise and easy to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have my solution!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full points for u!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 13:15:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-select-to-slices-parallel-processing/m-p/6042503#M1351064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T13:15:00Z</dc:date>
    </item>
  </channel>
</rss>

