<?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 Performance wise which one is better: loop inside select single or select outside loop and reading inside loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076292#M1703910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having code like shown below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbeln.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT * &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;vbfa&amp;nbsp; &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;vbeln &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_vbeln&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;vbeln&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;SPAN class="L0S52"&gt;SINGLE &lt;/SPAN&gt;* &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;vbkd &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;vbeln &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;vbfa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;vbelv&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whether can i use the select statements outside the loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POSNR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KDGRP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PLTYP&lt;/P&gt;&lt;P&gt;from vbfa&lt;/P&gt;&lt;P&gt;into table it_vbfa&lt;/P&gt;&lt;P&gt;for all entries in it_vbeln&lt;/P&gt;&lt;P&gt;where vbeln = it_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbeln.&lt;/P&gt;&lt;P&gt;read table it_vbfa into wa_vbaf with key vbeln = it_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which one is better&lt;STRONG&gt;....inside loop select single is better or use select outside the loop and read the table&lt;/STRONG&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i seen the execution time &lt;STRONG&gt;select single inside loop is taking less time as compared with select outside loop and reading inside loop&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2012 06:39:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-10-19T06:39:14Z</dc:date>
    <item>
      <title>Performance wise which one is better: loop inside select single or select outside loop and reading inside loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076292#M1703910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having code like shown below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbeln.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT * &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;vbfa&amp;nbsp; &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;vbeln &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_vbeln&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;vbeln&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;SPAN class="L0S52"&gt;SINGLE &lt;/SPAN&gt;* &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;vbkd &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;vbeln &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;vbfa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;vbelv&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whether can i use the select statements outside the loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POSNR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KDGRP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PLTYP&lt;/P&gt;&lt;P&gt;from vbfa&lt;/P&gt;&lt;P&gt;into table it_vbfa&lt;/P&gt;&lt;P&gt;for all entries in it_vbeln&lt;/P&gt;&lt;P&gt;where vbeln = it_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbeln.&lt;/P&gt;&lt;P&gt;read table it_vbfa into wa_vbaf with key vbeln = it_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which one is better&lt;STRONG&gt;....inside loop select single is better or use select outside the loop and read the table&lt;/STRONG&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i seen the execution time &lt;STRONG&gt;select single inside loop is taking less time as compared with select outside loop and reading inside loop&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 06:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076292#M1703910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-19T06:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Performance wise which one is better: loop inside select single or select outside loop and reading inside loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076293#M1703911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) as far as I remember selecting from VBFA with VBELN is bad (no index). There is a good SAP note for this, please study carefully: 185530.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Select outside a loop should be better. The other results might be caused by the differences between subsequent executions. Please select outside of loop!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 07:55:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076293#M1703911</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2012-10-19T07:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance wise which one is better: loop inside select single or select outside loop and reading inside loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076294#M1703912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;additionally make sure &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; it_vbfa&lt;/SPAN&gt; is a sorted table (binary search).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my system there is a delivered non activated index on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;VBELN&lt;/P&gt;&lt;P&gt;POSNN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vor vbfa (index M01).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check if you need to activate it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 07:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076294#M1703912</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2012-10-19T07:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Performance wise which one is better: loop inside select single or select outside loop and reading inside loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076295#M1703913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://answers.sap.com/thread/3254323"&gt;http://scn.sap.com/thread/3254323&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;locked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 08:50:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-wise-which-one-is-better-loop-inside-select-single-or-select/m-p/9076295#M1703913</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2012-10-19T08:50:56Z</dc:date>
    </item>
  </channel>
</rss>

