<?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 what is parallel cursor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082110#M431996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is parallel cursor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2007 07:13:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-05T07:13:14Z</dc:date>
    <item>
      <title>what is parallel cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082110#M431996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is parallel cursor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 07:13:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082110#M431996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T07:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: what is parallel cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082111#M431997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is the sample program which use the parallel cursor, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;************************************************************************
*              Performance Tuning using parallel cursor
*
* Extracts from program ZFAL2002
************************************************************************


************************************************************************
* START-OF-SELECTION
  SELECT *
  INTO TABLE I_KEPH FROM KEPH
  WHERE KADKY &amp;lt;= SY-DATUM
    AND TVERS = '01'
    AND KALKA IN ('01','Z1','Z2')
    AND BWVAR IN ('Z01','Z02','Z03','Z04','Z07')
    AND KKZST = ' '
    AND KKZMA = ' '
    AND KKZMM = ' '
    AND KEART = 'H'
    AND PATNR = 0.

* Table must be sorted to ensure all required records are together
  SORT I_KEPH BY KALNR KALKA BWVAR KADKY.

* Perform actual processing
  Perform get_cost_values.


*----------------------------------------------------------------------*
FORM GET_COST_VALUES.
* Determine start position and then process all records for given key
* from that starting point
* i_keph is sorted on kalnr kalka bwvar kadky.
  READ TABLE I_KEPH WITH KEY KALNR = W_KEKO-KALNR
                             KALKA = W_KEKO-KALKA
                             BWVAR = W_KEKO-BWVAR
                             KADKY = W_KEKO-KADKY BINARY SEARCH.
  IF SY-SUBRC = 0.
* Loop at itab from first record found (sy-tabix) until record
* no-longer matches your criteria.
    LOOP AT I_KEPH FROM SY-TABIX.
      IF  I_KEPH-KALNR = W_KEKO-KALNR AND I_KEPH-KALKA = W_KEKO-KALKA
      AND I_KEPH-BWVAR = W_KEKO-BWVAR AND I_KEPH-KADKY = W_KEKO-KADKY.
*       Key match
        D_MAT_COST = D_MAT_COST + I_KEPH-KST001.
        D_LAB_COST = D_LAB_COST + I_KEPH-KST004.
        D_OVER_HEAD = D_OVER_HEAD + I_KEPH-KST010.
        D_EXT_PURCH = D_EXT_PURCH + I_KEPH-KST014.
        D_MISC_COST = D_MISC_COST + I_KEPH-KST002 + I_KEPH-KST003
                    + I_KEPH-KST005 + I_KEPH-KST006 + I_KEPH-KST007
                    + I_KEPH-KST008 + I_KEPH-KST009 + I_KEPH-KST011
                    + I_KEPH-KST012 + I_KEPH-KST013 + I_KEPH-KST015
                    + I_KEPH-KST016 + I_KEPH-KST017 + I_KEPH-KST018
                    + I_KEPH-KST019 + I_KEPH-KST020 + I_KEPH-KST021
                    + I_KEPH-KST022 + I_KEPH-KST023 + I_KEPH-KST024
                    + I_KEPH-KST025 + I_KEPH-KST026 + I_KEPH-KST027
                    + I_KEPH-KST028 + I_KEPH-KST029 + I_KEPH-KST030
                    + I_KEPH-KST031 + I_KEPH-KST032 + I_KEPH-KST033
                    + I_KEPH-KST034 + I_KEPH-KST035 + I_KEPH-KST036
                    + I_KEPH-KST037 + I_KEPH-KST038 + I_KEPH-KST039
                    + I_KEPH-KST040.
      ELSE.
*       Key greater - can't be less
        EXIT.                                               " Exit loop
      ENDIF.
    ENDLOOP.
  ENDIF.

  D_MAT_COST  = D_MAT_COST  / W_KEKO-LOSGR.
  D_LAB_COST  = D_LAB_COST  / W_KEKO-LOSGR.
  D_OVER_HEAD = D_OVER_HEAD / W_KEKO-LOSGR.
  D_EXT_PURCH = D_EXT_PURCH / W_KEKO-LOSGR.
  D_MISC_COST = D_MISC_COST / W_KEKO-LOSGR.
ENDFORM.                               " GET_COST_VALUES
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 07:16:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082111#M431997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T07:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: what is parallel cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082112#M431998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At times, no matter howmuch you want to avoid nested loops, you will have no choice left but to use nested loops, and they surely are a hinderence to program performance. P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parallel cursors are used to improve performance of nested loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below links will give you a better insight:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/perform/perform_pcursor.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/perform/perform_pcursor.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 07:19:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082112#M431998</guid>
      <dc:creator>former_member189629</dc:creator>
      <dc:date>2007-04-05T07:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: what is parallel cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082113#M431999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In se30(abap tips &amp;amp; tricks), u wil get foll code for parallel cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entries: 1000 (ITAB1), 300 (ITAB2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Line width: 100&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Both tables sorted by unique key K&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: I TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I = 1.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1 INTO WA1.&lt;/P&gt;&lt;P&gt;  READ TABLE ITAB2 INTO WA2 INDEX I.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;  IF WA2-K = WA1-K.&lt;/P&gt;&lt;P&gt;    " ...&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 08:29:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082113#M431999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T08:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: what is parallel cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082114#M432000</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;&lt;/P&gt;&lt;P&gt;Go to transaction se30 -&amp;gt;utilities -&amp;gt; trips and tricks&lt;/P&gt;&lt;P&gt;-&amp;gt;internal tables -&amp;gt;simple algorithms&lt;/P&gt;&lt;P&gt;You will find the sample code and some documentation. This should be helpful for you ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi just see the following link. it is very simple and useful.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a blog on SDN /people/rob.burbank/blog/2006/02/07/performance-of-nested-loops &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it helps you a lot...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;guess you are referring to the SE30 Tipps&amp;amp;Tricks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to avoid nested loops:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nestedLoop:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entries: 100 (ITAB1), 1000 (ITAB2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Line width: 100&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Both tables sorted by key K&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT ITAB1 INTO WA1.&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB2 INTO WA2&lt;/P&gt;&lt;P&gt;                WHERE K = WA1-K.&lt;/P&gt;&lt;P&gt;    " ...&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;parallel cursors:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entries: 100 (ITAB1), 1000 (ITAB2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Line width: 100&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Both tables sorted by key K&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I = 1.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1 INTO WA1.&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB2 INTO WA2 FROM I.&lt;/P&gt;&lt;P&gt;    IF WA2-K &amp;lt;&amp;gt; WA1-K.&lt;/P&gt;&lt;P&gt;      I = SY-TABIX.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    " ...&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If ITAB1 has n1 entries and ITAB2 has n2 entries, the time needed for the nested loop with the straightforward algorithm is O(n1 * n2),whereas the parallel cursor approach takes only O(n1 + n2) time.&lt;/P&gt;&lt;P&gt;The above parallel cursor algorithm assumes that ITAB2 contains only entries also contained in ITAB1.If this assumption does not hold, the parallel cursor algorithm gets slightly more complicated, but its performance characteristics remain the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also go through this link,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b23358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b23358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful......&lt;/P&gt;&lt;P&gt;Suresh......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 08:57:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-parallel-cursor/m-p/2082114#M432000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T08:57:54Z</dc:date>
    </item>
  </channel>
</rss>

