<?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: Performance with internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956855#M66514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's point# 11 that I mentioned in the earlier list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. Try to avoid using 'ALL ENTRIES'. If using and make &lt;/P&gt;&lt;P&gt;sure that the ref.internal table have entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopakumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2005 15:01:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-11T15:01:36Z</dc:date>
    <item>
      <title>Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956847#M66506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I'm having trouble with the performance of a report.&lt;/P&gt;&lt;P&gt;The reports selects data out of many different tables and merges them together in one extraction file. (I would really like it to be executable in dialog task, because I don't want to write the file on the application sever)&lt;/P&gt;&lt;P&gt;I've done what I could using runtime analysis to improve performance of the db accesses. Now 97% of runtime is consumed by abap.&lt;/P&gt;&lt;P&gt;I'm using several internal tables which will have many entries, and at the moment I'm using nested loops to gather the information out of the internal tables into one extraction file. (Reading the internal tables with key is not always possible, I do this whenever possible)&lt;/P&gt;&lt;P&gt;I've tried to use loop... assigning &amp;lt;fs&amp;gt; instead of loop... into, but it doesn't really help too much.&lt;/P&gt;&lt;P&gt;Any other suggestions?&lt;/P&gt;&lt;P&gt;Thank you for your help, regards, Kathrin!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 16:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956847#M66506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T16:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956848#M66507</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; Some of these might be able to help for improving the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Read table with key using binary search.&lt;/P&gt;&lt;P&gt;2. While comparing two internal tables, user Kernal &lt;/P&gt;&lt;P&gt;   method. Eg: If I_TAB1[] = I_TAB2[]. Enfif.&lt;/P&gt;&lt;P&gt;3. Instead of appending records within loop/endloop, &lt;/P&gt;&lt;P&gt;   use 'Append lines of'.&lt;/P&gt;&lt;P&gt;4. When populate different internal tables, try to create &lt;/P&gt;&lt;P&gt;   with key field which will make a big difference while &lt;/P&gt;&lt;P&gt;   accessing the data.&lt;/P&gt;&lt;P&gt;5. Sort the internal tables.&lt;/P&gt;&lt;P&gt;6. Use Case/Endcase in place of If/Endif.&lt;/P&gt;&lt;P&gt;7. While making values negative, use 0 - &amp;lt;field&amp;gt;, in &lt;/P&gt;&lt;P&gt;   place of &amp;lt;field&amp;gt; * -1.&lt;/P&gt;&lt;P&gt;8. If the field structures are similar in two internal &lt;/P&gt;&lt;P&gt;   tables, for appending records use I_TAB2[] = I_TAB1[].&lt;/P&gt;&lt;P&gt;9. After the complete usage of internal tables, release &lt;/P&gt;&lt;P&gt;   the resources using FREE/FREFRESH &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;10. For data extraction, use field by field selection &lt;/P&gt;&lt;P&gt;    from database.&lt;/P&gt;&lt;P&gt;11. Try to avoid using 'ALL ENTRIES'. If using and make &lt;/P&gt;&lt;P&gt;    sure that the ref.internal table have entries.&lt;/P&gt;&lt;P&gt;12. Try using Inner Join using Foriegn key fields.&lt;/P&gt;&lt;P&gt;13. To get sum or count use Aggregate functions.&lt;/P&gt;&lt;P&gt;14. Try to use Views if need appropriately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Gopakumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 17:07:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956848#M66507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T17:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956849#M66508</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;this is a good list, so&lt;/P&gt;&lt;P&gt;15. If you can define keys for internal tables, define sorted or hashed tables.&lt;/P&gt;&lt;P&gt;15a. Use sorted tables, if you use 'loop at ... where', with your where clause as partial key.&lt;/P&gt;&lt;P&gt;15b. Use hashed tables, if you have full key access.&lt;/P&gt;&lt;P&gt;16. Try to avoid unecessary SORT (on big tables with a lot of sort fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 18:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956849#M66508</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-07-08T18:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956850#M66509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see you have lots of good suggestions already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One trick that sometimes gets forgotten is that you can fill new internal table records very quickly this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
APPEND INITIAL LINE TO itab ASSIGNING &amp;lt;line&amp;gt; 
LOOP AT itab2 ASSIGNING &amp;lt;line2&amp;gt;.
  &amp;lt;line&amp;gt;-field = &amp;lt;line2&amp;gt;-field.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other than this, I'll echo the advice above on defining your internal tables as type SORTED or HASHED. This saves a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't be more specific without more detail. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 23:49:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956850#M66509</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2005-07-08T23:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956851#M66510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'Now 97% of runtime is consumed by abap'&lt;/P&gt;&lt;P&gt;Why it cost you so much on ABAP?&lt;/P&gt;&lt;P&gt;Can you tell us what is the most cost part in your application? How many entris your application will handle normally?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, a suggestion:  don't delete or modify in a internal LOOP(like following), if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB INTO LC_ENTRY WHERE XXXX.&lt;/P&gt;&lt;P&gt;  DELETE(MODIFY) .....&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume your internal table is very large, modify specially delete very often in loop will cost much, if the populate times is too many, the cumulative cost will be large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And delete the dynamic table and dynamic generate tech in your application, if they exists. They always cost a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2005 05:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956851#M66510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-09T05:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956852#M66511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kathrin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's one small point that you need to consider. Don't get too carried away by the persentages that you find in the Runtime Analysis. It is only to help you have a rough idea about where the optimization needs to be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The three components that you find there, ABAP , Database and R/3 system will togetther make up the 100%. So, even if you try to reduce one of them, the other has to go up, to make the total 100 !! And then you try to see what's gone wrong.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a simple fact, but very often I find ABAP developers not noticing this. They are always trying to bring down everything :-).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though in your case, 97% in ABAP may be considered to be a bit on the higher side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2005 10:28:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956852#M66511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-09T10:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956853#M66512</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;     I would like to add one more point which normally most of us forget. Before using the internal tables in SELECT Statements ( ..FOR ALL ENTRIES) , checking the internal table for records is very essential.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;K Vijayasekar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2005 11:30:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956853#M66512</guid>
      <dc:creator>VijayasekarK</dc:creator>
      <dc:date>2005-07-09T11:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956854#M66513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would u compare case/endcase against if/endif ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nitin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jul 2005 05:33:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956854#M66513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-10T05:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956855#M66514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's point# 11 that I mentioned in the earlier list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. Try to avoid using 'ALL ENTRIES'. If using and make &lt;/P&gt;&lt;P&gt;sure that the ref.internal table have entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopakumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2005 15:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956855#M66514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-11T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Performance with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956856#M66515</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;You say "Now 97% of runtime is consumed by abap". I've been working on a report that takes more than 24h running - we applied the knowledge of the Performance Tunning Course and verified that the problem was precisely on the amount of data in internal tables.&lt;/P&gt;&lt;P&gt;We changed the report, to reduce the loops on the giants internal tables and this action optimize the performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a bit strange, because in all most of our performance optimizations we use the internal tables...(but not so fat)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maria João Rocha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2005 14:37:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-internal-tables/m-p/956856#M66515</guid>
      <dc:creator>MariaJooRocha</dc:creator>
      <dc:date>2005-07-12T14:37:16Z</dc:date>
    </item>
  </channel>
</rss>

