<?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: nested select stmts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457642#M551135</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;WE can use For all entries of one particular ITAB&lt;/P&gt;&lt;P&gt;and write a separate select to other database tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally looping the first ITAB.&lt;/P&gt;&lt;P&gt;and reading the other internal tables..&lt;/P&gt;&lt;P&gt;and appending data into a final ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the doc&lt;/P&gt;&lt;P&gt;1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;2 Avoid for all entries in JOINS &lt;/P&gt;&lt;P&gt;3 Try to avoid joins and use FOR ALL ENTRIES. &lt;/P&gt;&lt;P&gt;4 Try to restrict the joins to 1 level only ie only for 2 tables &lt;/P&gt;&lt;P&gt;5 Avoid using Select *. &lt;/P&gt;&lt;P&gt;6 Avoid having multiple Selects from the same table in the same object. &lt;/P&gt;&lt;P&gt;7 Try to minimize the number of variables to save memory. &lt;/P&gt;&lt;P&gt;8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any) &lt;/P&gt;&lt;P&gt;9 Avoid creation of index as far as possible &lt;/P&gt;&lt;P&gt;10 Avoid operators like &amp;lt;&amp;gt;, &amp;gt; , &amp;lt; &amp;amp; like % in where clause conditions &lt;/P&gt;&lt;P&gt;11 Avoid select/select single statements in loops. &lt;/P&gt;&lt;P&gt;12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH. &lt;/P&gt;&lt;P&gt;13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,) &lt;/P&gt;&lt;P&gt;14 Avoid using ORDER BY in selects &lt;/P&gt;&lt;P&gt;15 Avoid Nested Selects &lt;/P&gt;&lt;P&gt;16 Avoid Nested Loops of Internal Tables &lt;/P&gt;&lt;P&gt;17 Try to use FIELD SYMBOLS. &lt;/P&gt;&lt;P&gt;18 Try to avoid into Corresponding Fields of &lt;/P&gt;&lt;P&gt;19 Avoid using Select Distinct, Use DELETE ADJACENT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful Answers&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 08:52:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-04T08:52:40Z</dc:date>
    <item>
      <title>nested select stmts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457641#M551134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;        how can we avoid nested select statements?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 08:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457641#M551134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T08:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: nested select stmts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457642#M551135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;WE can use For all entries of one particular ITAB&lt;/P&gt;&lt;P&gt;and write a separate select to other database tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally looping the first ITAB.&lt;/P&gt;&lt;P&gt;and reading the other internal tables..&lt;/P&gt;&lt;P&gt;and appending data into a final ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the doc&lt;/P&gt;&lt;P&gt;1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;2 Avoid for all entries in JOINS &lt;/P&gt;&lt;P&gt;3 Try to avoid joins and use FOR ALL ENTRIES. &lt;/P&gt;&lt;P&gt;4 Try to restrict the joins to 1 level only ie only for 2 tables &lt;/P&gt;&lt;P&gt;5 Avoid using Select *. &lt;/P&gt;&lt;P&gt;6 Avoid having multiple Selects from the same table in the same object. &lt;/P&gt;&lt;P&gt;7 Try to minimize the number of variables to save memory. &lt;/P&gt;&lt;P&gt;8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any) &lt;/P&gt;&lt;P&gt;9 Avoid creation of index as far as possible &lt;/P&gt;&lt;P&gt;10 Avoid operators like &amp;lt;&amp;gt;, &amp;gt; , &amp;lt; &amp;amp; like % in where clause conditions &lt;/P&gt;&lt;P&gt;11 Avoid select/select single statements in loops. &lt;/P&gt;&lt;P&gt;12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH. &lt;/P&gt;&lt;P&gt;13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,) &lt;/P&gt;&lt;P&gt;14 Avoid using ORDER BY in selects &lt;/P&gt;&lt;P&gt;15 Avoid Nested Selects &lt;/P&gt;&lt;P&gt;16 Avoid Nested Loops of Internal Tables &lt;/P&gt;&lt;P&gt;17 Try to use FIELD SYMBOLS. &lt;/P&gt;&lt;P&gt;18 Try to avoid into Corresponding Fields of &lt;/P&gt;&lt;P&gt;19 Avoid using Select Distinct, Use DELETE ADJACENT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful Answers&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 08:52:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457642#M551135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T08:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: nested select stmts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457643#M551136</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;In SE38 follow the menu path -&amp;gt; Environment -&amp;gt; Examples -&amp;gt; Performance Examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to SQL Interface. You would find performance examles for Internal Tables, field conversion, ABAP Objects etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can compare the time taken for different type of statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srilatha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 09:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-select-stmts/m-p/2457643#M551136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T09:01:00Z</dc:date>
    </item>
  </channel>
</rss>

