<?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: Open Cursor (Does this drastically improve performance) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391966#M814445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try out your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"" OPEN CURSOR ... WITH HOLD and then FETCH ... PACKAGE SIZE.""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Aby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2008 13:12:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-18T13:12:31Z</dc:date>
    <item>
      <title>Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391959#M814438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts, Rob/Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly give me some education regarding Open Cursor functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me Blogs/links explaining the usage/advantages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to fine tune the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


==========
*Check if datapackage is initial or not
  IF NOT itab_temp[] IS INITIAL.                      "(1)

    REFRESH itab_zfccoo02.

*******************

  OPEN CURSOR dbcur FOR
   SELECT DISTINCT REF_DOC_NO FISCPER3 /BIC/ZCOREFBZ COMP_CODE FISCPER
   CREDITOR PART_CCTR PART_COORD PART_WBSEL /BIC/ZPCOOBJNR AUXACCVAL
   AUXACCTYPE CO_DOC_NO CO_ITEM_NO /BIC/ZCOBUSTRN /BIC/ZCOVTYPE
   DOC_DATE /BIC/ZCOREFBZ
   FROM /bic/azfccoo0200
            for all entries in itab_temp
            where comp_code       = itab_temp-comp_code
            and fiscyear          = itab_temp-fiscyear
            and fiscper           = itab_temp-fiscper
            and /bic/zcovtype    NE '11'
            and /bic/zcovtype    NE '60'.



  DO.
    FETCH NEXT CURSOR dbcur APPENDING TABLE itab_zfccoo02
                                   PACKAGE SIZE 20000.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      EXIT.
    ENDIF.
  ENDDO.

  CLOSE CURSOR: dbcur.

===========

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your Help and replies&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aby Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2008 08:32:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391959#M814438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-15T08:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391960#M814439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There was a question about this earlier this week or last.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN CURSOR is used so that you can have two access paths to the same table at the same time. I've never seen anything that leads me to believe that it helps performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2008 14:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391960#M814439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-15T14:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391961#M814440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this Help documentation helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3b23358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3b23358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2008 07:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391961#M814440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-16T07:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391962#M814441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FETCH NEXT CURSOR dbcur APPENDING TABLE itab_zfccoo02&lt;/P&gt;&lt;P&gt;                                   PACKAGE SIZE 20000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I thought it looks o.k.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main usage for open cursor is the creation of package size, and 20.000 is a good size! It is not about performance improvement, but about prevention of performance deterioration. The database creates redo logs in the background, where it keeps the information to do a rollback if the database update does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But here is not update, only a select and package of size 20.000 are selected into an internal table which must hold everything. This is nonsense!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FOR ALL ENTRIES selects anyway in packages of much much smaller size (5 to 30). The FOR ALL ENTRIES can create duplicates which are automatically &lt;/P&gt;&lt;P&gt;deleted when the final result is available, this will not work with packages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also depends what you want to do with the table itab_zfccoo02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 09:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391962#M814441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T09:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391963#M814442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate your Suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Would it be Okay to remove the Open Cursor functionality&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;altogether from the SELECT statement ??&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==========&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT DISTINCT REF_DOC_NO FISCPER3 /BIC/ZCOREFBZ COMP_CODE FISCPER
   CREDITOR PART_CCTR PART_COORD PART_WBSEL /BIC/ZPCOOBJNR AUXACCVAL
   AUXACCTYPE CO_DOC_NO CO_ITEM_NO /BIC/ZCOBUSTRN /BIC/ZCOVTYPE
   DOC_DATE /BIC/ZCOREFBZ
   
into TABLE itab_zfccoo02

FROM /bic/azfccoo0200
            for all entries in itab_temp
            where comp_code       = itab_temp-comp_code
            and fiscyear          = itab_temp-fiscyear
            and fiscper           = itab_temp-fiscper
            and /bic/zcovtype    NE '11'
            and /bic/zcovtype    NE '60'.
 
 
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==========&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Aby&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 11:16:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391963#M814442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T11:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391964#M814443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try a different version, and always don't remove old coding directly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ( 1 = 2 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to test new versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many records do you expect in itab_zfccoo02 in production?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 11:22:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391964#M814443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T11:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391965#M814444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aby,&lt;/P&gt;&lt;P&gt;like the other gentlemen I am doubtful whether OPEN CURSOR has a significant advantage over regular SELECT statements regarding performance improvement.&lt;/P&gt;&lt;P&gt;There is one application where I have used OPEN CURSOR in the past, and that is with the addition WITH HOLD, regarding block processing of mass data where I have to do a COMMIT WORK after each block has been processed. A standard SELECT ... PACKAGE SIZE would result in a shortdump because the DB cursor is lost, not so with OPEN CURSOR ... WITH HOLD and then FETCH ... PACKAGE SIZE.&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 12:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391965#M814444</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-02-18T12:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391966#M814445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try out your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"" OPEN CURSOR ... WITH HOLD and then FETCH ... PACKAGE SIZE.""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Aby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 13:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391966#M814445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T13:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Open Cursor (Does this drastically improve performance)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391967#M814446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am Closing this Thread&lt;/P&gt;&lt;P&gt;Many Thanks for all your help and support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Aby Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 08:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-cursor-does-this-drastically-improve-performance/m-p/3391967#M814446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T08:53:45Z</dc:date>
    </item>
  </channel>
</rss>

