<?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: optimise in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154094#M454931</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In range object , you can fill upto 2500 entries , if the rows exceeds 2500 , dump will occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of using range object , change the select with FOR ALL ENTRIES option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    select rsnum into table i_rsnum.
    if not i_rsnum[] is initial.
       SELECT rsnum matnr werks sobkz 
           bdmng enmng shkzg aufnr
            postp potx1 pspel 
           INTO TABLE t_output
             FROM resb
             for all entries in i_rsnum
           WHERE rsnum = i_rsnum-rsnum
                  AND xloek EQ ' '
                  AND shkzg NE 'S' .
         endif.

then find out sum of the values

loop at t_output.
Move-corresponding t_output to t_output_1.
collect t_output_1.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;L Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Apr 2007 13:57:07 GMT</pubDate>
    <dc:creator>Laxmana_Appana_</dc:creator>
    <dc:date>2007-04-14T13:57:07Z</dc:date>
    <item>
      <title>optimise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154091#M454928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;           rsnum&lt;/P&gt;&lt;P&gt;           matnr&lt;/P&gt;&lt;P&gt;           werks&lt;/P&gt;&lt;P&gt;           sobkz  &lt;/P&gt;&lt;P&gt;           SUM( bdmng )&lt;/P&gt;&lt;P&gt;           SUM( enmng )     &lt;/P&gt;&lt;P&gt;           shkzg&lt;/P&gt;&lt;P&gt;           aufnr&lt;/P&gt;&lt;P&gt;           postp&lt;/P&gt;&lt;P&gt;           potx1&lt;/P&gt;&lt;P&gt;           pspel  &lt;/P&gt;&lt;P&gt;       INTO TABLE t_output&lt;/P&gt;&lt;P&gt;       FROM resb&lt;/P&gt;&lt;P&gt;       WHERE rsnum IN r_rsnum&lt;/P&gt;&lt;P&gt;         AND xloek EQ ' '&lt;/P&gt;&lt;P&gt;         AND shkzg NE 'S'  &lt;/P&gt;&lt;P&gt;    GROUP by rsnum matnr werks sobkz shkzg aufnr postp potx1 pspel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the selection criteria has lesser number of records this code works. but as soon as the number increases to a moderate level it results in ABAP dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSNUM is the 'Number of reservation', is the range that is passed through the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me optimise this code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2007 08:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154091#M454928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-14T08:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: optimise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154092#M454929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use FOR ALL VALUES IN if your range/select-option only contains EQ test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE rsnum IN r_rsnum&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FOR ALL ENTIRES IN r_rsnum
WHERE rsnum = r_rsnum-low&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Else you could break the range in sub-set, as you group per RSNUM, no problem should arise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;APPEND LINES OF r_snum FROM 1 TO 100 TO r_rsnum_2
SELECT ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2007 11:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154092#M454929</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2007-04-14T11:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: optimise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154093#M454930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you dont do the SUM wihtin the select, since for that u need to use the GROUP statement within the SQL query and that hinters performance pretty badly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead, first read all the records into an internal table and then sort the table based on your key fields and finally looping you use the COLLECT statements. Just ensure all the key fields (based on which you are grouping) are character/numeric fields, to support the COLLECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. you can create a copy of the current report, and implement the above correction and test the performance response using ST05 and SE30 tools and then settle on the optimum option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2007 12:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154093#M454930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-14T12:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: optimise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154094#M454931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In range object , you can fill upto 2500 entries , if the rows exceeds 2500 , dump will occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of using range object , change the select with FOR ALL ENTRIES option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    select rsnum into table i_rsnum.
    if not i_rsnum[] is initial.
       SELECT rsnum matnr werks sobkz 
           bdmng enmng shkzg aufnr
            postp potx1 pspel 
           INTO TABLE t_output
             FROM resb
             for all entries in i_rsnum
           WHERE rsnum = i_rsnum-rsnum
                  AND xloek EQ ' '
                  AND shkzg NE 'S' .
         endif.

then find out sum of the values

loop at t_output.
Move-corresponding t_output to t_output_1.
collect t_output_1.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;L Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2007 13:57:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimise/m-p/2154094#M454931</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2007-04-14T13:57:07Z</dc:date>
    </item>
  </channel>
</rss>

