<?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: select performance help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375522#M810490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These links help me a lot too:&lt;/P&gt;&lt;P&gt;/people/harry.dietz/blog/2005/11/03/performance-improvement-hints-4-loop-at-itab-where&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2006/03/07/using-field-symbols-in-loop-statements--performance-boost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The time out dump occurs after select, in the loop at ti_viaufks. But i change the select with your tips.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More blog links, tips and others are welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2008 12:57:14 GMT</pubDate>
    <dc:creator>rodrigo_paisante3</dc:creator>
    <dc:date>2008-01-23T12:57:14Z</dc:date>
    <item>
      <title>select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375516#M810484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to change a zprogram, specific select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to change the basic things and i did not get the best performance yet. When the hs_iphas have data (2 to 6 lines only), get time out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, now i will try to change the filters order. See my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Code before&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SELECT        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        FROM   viaufks&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WHERE  aufnr  IN hs_aufnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  objnr  IN hs_objnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  iphas  IN hs_iphas&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  iwerk  IN s_iwerk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  priok  IN s_priok&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  ilart  IN s_ilart&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  ingpr  IN s_ingpr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  ernam  IN s_aernam&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  erdat  IN s_aerdat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  aenam  IN s_aaenam&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  aedat  IN s_aaedat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  pspel  IN hs_pspel&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  swerk  IN s_swerk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  bukrs  IN s_bukrs&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  beber  IN s_beber&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  vkorg  IN s_vkorg&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  vtweg  IN s_vtweg&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  spart  IN s_spart&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          AND  tplnr  IN s_tplnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              AND  gewrk  IN hs_gewrk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          .&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;routines.. appends and others&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*after change&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT&lt;/P&gt;&lt;P&gt;aedat  aenam  aufnr  aufpl  beber  bukrs  equnr&lt;/P&gt;&lt;P&gt;erdat  ernam  gewrk  gltrp  gluzp  gstrp  gsuzp&lt;/P&gt;&lt;P&gt;ilart  ingpr  iphas  iwerk  kostl  ktext  kunum&lt;/P&gt;&lt;P&gt;objnr  priok  sermat spart  swerk  tplnr  vkorg&lt;/P&gt;&lt;P&gt;vtweg  serialnr&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ti_viaufks&lt;/P&gt;&lt;P&gt;         FROM   viaufks&lt;/P&gt;&lt;P&gt;         WHERE  aufnr  IN hs_aufnr&lt;/P&gt;&lt;P&gt;           AND  objnr  IN hs_objnr&lt;/P&gt;&lt;P&gt;           AND  iphas  IN hs_iphas&lt;/P&gt;&lt;P&gt;           AND  iwerk  IN s_iwerk&lt;/P&gt;&lt;P&gt;           AND  priok  IN s_priok&lt;/P&gt;&lt;P&gt;           AND  ilart  IN s_ilart&lt;/P&gt;&lt;P&gt;           AND  ingpr  IN s_ingpr&lt;/P&gt;&lt;P&gt;           AND  ernam  IN s_aernam&lt;/P&gt;&lt;P&gt;           AND  erdat  IN s_aerdat&lt;/P&gt;&lt;P&gt;           AND  aenam  IN s_aaenam&lt;/P&gt;&lt;P&gt;           AND  aedat  IN s_aaedat&lt;/P&gt;&lt;P&gt;           AND  pspel  IN hs_pspel&lt;/P&gt;&lt;P&gt;           AND  swerk  IN s_swerk&lt;/P&gt;&lt;P&gt;           AND  bukrs  IN s_bukrs&lt;/P&gt;&lt;P&gt;           AND  beber  IN s_beber&lt;/P&gt;&lt;P&gt;           AND  vkorg  IN s_vkorg&lt;/P&gt;&lt;P&gt;           AND  vtweg  IN s_vtweg&lt;/P&gt;&lt;P&gt;           AND  spart  IN s_spart&lt;/P&gt;&lt;P&gt;           AND  tplnr  IN s_tplnr&lt;/P&gt;&lt;P&gt;           AND  gewrk  IN hs_gewrk&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;LOOP AT ...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;routines appends and others&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:20:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375516#M810484</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-22T16:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375517#M810485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;code looks good except INTO CORRESPONDING FIELDS OF TABLE  ,please change this into into table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you can decrease little bit time but you will not get it full performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:33:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375517#M810485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T16:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375518#M810486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the most important thing to do will be to check that there are actually entries in the select-options for primary or secondary index key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:52:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375518#M810486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T16:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375519#M810487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all replies!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob, do you write or have a blog about select performance, like the blog about nested loop? I used this logic here, it increase the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 18:43:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375519#M810487</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-22T18:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375520#M810488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Blogs (performance related):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[The  Performance of Nested Loops|/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops]&lt;/P&gt;&lt;P&gt;[Using an Index When You Don't Have all of the Fields|/people/rob.burbank/blog/2006/09/13/using-an-index-when-you-dont-have-all-of-the-fields]&lt;/P&gt;&lt;P&gt;[Performance - what will kill you and what will leave you with only a flesh wound|/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound]&lt;/P&gt;&lt;P&gt;[JOINS vs. FOR ALL ENTRIES - Which Performs Better?|/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better]&lt;/P&gt;&lt;P&gt;[Quickly Retrieving FI document Data from BSEG|/people/rob.burbank/blog/2007/11/12/quickly-retrieving-fi-document-data-from-bseg]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 18:50:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375520#M810488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T18:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375521#M810489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be aware, that not all IN clauses are alwys filled. You must check the indexes whether they can support the important queries (i.e. a certain combination of filled in clauses).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important queries should be index-supported, less important probably not as to many index will confuse the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check performance with SQL Trace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 12:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375521#M810489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T12:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375522#M810490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These links help me a lot too:&lt;/P&gt;&lt;P&gt;/people/harry.dietz/blog/2005/11/03/performance-improvement-hints-4-loop-at-itab-where&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2006/03/07/using-field-symbols-in-loop-statements--performance-boost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The time out dump occurs after select, in the loop at ti_viaufks. But i change the select with your tips.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More blog links, tips and others are welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 12:57:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375522#M810490</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-23T12:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375523#M810491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you paste the code within the LOOP (along with the FORMs it calls), we can look at that as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 22:24:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375523#M810491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T22:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375524#M810492</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 did good changes. i have one idea but i am not sure.just try it. reward me if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;give key field condition in SELECT statement.&lt;/P&gt;&lt;P&gt;give non-key field condition in LOOP statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because key fields are indexed. Fetching will take some more time While fetching records based on non-key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L.Velu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 06:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375524#M810492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T06:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375525#M810493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Rodrigi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the links you provide might help you with your actual problem but they are not related to your question, your question mentions only SELECT statements! So the answers will only refer to SELECT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always with performance problems, I would recommend to run traces, definitely ABAP trace (SE30) and also SQL trace (ST05)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List total runtime and top 10 of both traces&lt;/P&gt;&lt;P&gt;=&amp;gt; Then it becomes really obvious where the problem is hidden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the traces I have provided blogs&lt;/P&gt;&lt;P&gt;SQL trace&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SE30&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/11/13/the-abap-runtime-trace-se30--quick-and-easy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 07:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375525#M810493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T07:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375526#M810494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that Siegfried, but when i saw the info in links, i thought it can be a good ideal to put this precious links in the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i started the thread, i thought the time out problem was in select, but it is in loop.. endloop too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The loop code with changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT ti_viaufks ASSIGNING &amp;lt;fs_viaufks&amp;gt; WHERE objnr IN hs_objnr.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CHECK ti_viaufks-objnr IN hs_objnr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Describe date selection in detail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Why is the 'between' statement not used&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      IF NOT p_gstrp IS INITIAL.&lt;/P&gt;&lt;P&gt;        CHECK &amp;lt;fs_viaufks&amp;gt;-gstrp GE p_gstrp OR&lt;/P&gt;&lt;P&gt;              &amp;lt;fs_viaufks&amp;gt;-gltrp GE p_gstrp.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT p_gltrp IS INITIAL.&lt;/P&gt;&lt;P&gt;        CHECK &amp;lt;fs_viaufks&amp;gt;-gstrp LE p_gltrp OR&lt;/P&gt;&lt;P&gt;              &amp;lt;fs_viaufks&amp;gt;-gltrp LE p_gltrp.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt; Data fits first selection  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      MOVE-CORRESPONDING &amp;lt;fs_viaufks&amp;gt; TO hviaufks.&lt;/P&gt;&lt;P&gt;      APPEND hviaufks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt; Memorize TPLNR and EQUNR used in reference objects  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      IF NOT &amp;lt;fs_viaufks&amp;gt;-tplnr IS INITIAL.&lt;/P&gt;&lt;P&gt;        hs_tplnr-low = &amp;lt;fs_viaufks&amp;gt;-tplnr.&lt;/P&gt;&lt;P&gt;        APPEND hs_tplnr.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT &amp;lt;fs_viaufks&amp;gt;-equnr IS INITIAL.&lt;/P&gt;&lt;P&gt;        hs_equnr-low = &amp;lt;fs_viaufks&amp;gt;-equnr.&lt;/P&gt;&lt;P&gt;        APPEND hs_equnr.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;And i still working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 10:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375526#M810494</guid>
      <dc:creator>rodrigo_paisante3</dc:creator>
      <dc:date>2008-01-24T10:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: select performance help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375527#M810495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have checked the first blog which you mentioned, and I would not regard that one as especially helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ... WHERE should only be used with sorted tables as the WHERE is then optimized.&lt;/P&gt;&lt;P&gt;An IF inside the LOOP can not provide a fast access to the line fulfilling the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For standard tables one should not use LOOP AT WHERE but READ BINARY SEARCH and LOOP FROM INDEX  with - very important - EXIT CONDITION. For details check here last section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Measurements on internal tables: Reads and Loops:&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also here an IF can not help. This should always be done if the loop is accessed several times and if the table is large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your checks, IF p_... is ..., P is a constant, i.e. the check should not be done inside the loop, &lt;/P&gt;&lt;P&gt;it holds for all line of the loop and should be done outside. It will even improve your performance,  if you have to program the loop several time depending on the cases whether the p_... are initial or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 11:53:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance-help/m-p/3375527#M810495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T11:53:09Z</dc:date>
    </item>
  </channel>
</rss>

