<?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: Will OPEN CURSOR improve performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215646#M1206248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Package size is used to process limited amount of data because of  lack of memory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose if more records are there then 1000 records we select, and the next 1000 records can be read. &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Feb 2009 12:45:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-12T12:45:38Z</dc:date>
    <item>
      <title>Will OPEN CURSOR improve performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215645#M1206247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moved to correct forum by moderator.  Subject changed.  Please use a more informative subject in future.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got a requirement to improve the performance of a report . While debugging i came to know that the program got struck at the FETCH CURSOR  command. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; OPEN CURSOR WITH HOLD cur1 FOR&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select data from the purchase order header table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SELECT runit rprctr sprctr                                "CR0777&lt;/P&gt;&lt;P&gt;         racct rfarea hsl msl kostl aufnr ps_psp_pnr&lt;/P&gt;&lt;P&gt;          FROM glpca&lt;/P&gt;&lt;P&gt;         WHERE docnr  IN s_docnr&lt;/P&gt;&lt;P&gt;           AND rbukrs =  p_rbukrs&lt;/P&gt;&lt;P&gt;           AND rprctr IN s_rprctr&lt;/P&gt;&lt;P&gt;           AND sprctr IN s_sprctr                           "CR0777&lt;/P&gt;&lt;P&gt;           AND rfarea IN s_rfarea&lt;/P&gt;&lt;P&gt;           AND budat  IN s_budat&lt;/P&gt;&lt;P&gt;           AND kostl  IN s_kostl&lt;/P&gt;&lt;P&gt;           AND aufnr  IN s_aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;fetch rows from cursor depending on package size w.kuszelewicz&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    FETCH NEXT CURSOR cur1 INTO TABLE t_glpca&lt;/P&gt;&lt;P&gt;       PACKAGE SIZE p_size.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      CLOSE CURSOR cur1.&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;What is the use of PACKAGE SIZE command with FETCH CURSOR? It is in the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mudit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 12, 2009 2:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 12:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215645#M1206247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-12T12:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Will OPEN CURSOR improve performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215646#M1206248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Package size is used to process limited amount of data because of  lack of memory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose if more records are there then 1000 records we select, and the next 1000 records can be read. &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 12:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215646#M1206248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-12T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Will OPEN CURSOR improve performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215647#M1206249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please use a more informative subject in future.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use SELECT INTO TABLE, then all the data is retrieved from the database in one go.  This can result in running out of memory and other system resources for very large datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use CURSOR and FETCH, you limit the amount of data selected at a time by the package site.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BW/BI extractors often use this method to extract data a chunk at a time.  Read the ABAP Help of OPEN CURSOR, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can improve performance, but it depends on how exactly you are handling the data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 12, 2009 2:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 13:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215647#M1206249</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-02-12T13:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Will OPEN CURSOR improve performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215648#M1206250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PACKAGE SIZE is also available with SELECT. The combination with OPEN CURSOR ... WITH HOLD allows package processing of tasks that require a database commit inside the loop. A normal SELECT loop without holding the cursor would be interrupted by a commit -&amp;gt; short dump.&lt;/P&gt;&lt;P&gt;Other than that I see not much reason to use OPEN CURSOR and FETCH in Open SQL.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 15:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/will-open-cursor-improve-performance/m-p/5215648#M1206250</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-12T15:24:22Z</dc:date>
    </item>
  </channel>
</rss>

