<?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 Query optimisation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751481#M325865</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT DISTINCT t005t~land1 landx
  FROM t005t
  JOIN tzone ON tzone~land1 = t005t~land1
  INTO CORRESPONDING FIELDS OF TABLE t_landx
  FOR ALL ENTRIES IN int_delivery
  WHERE zone1 = int_delivery-zone1
    AND spras = sy-langu.
  SORT t_landx.
  DELETE ADJACENT DUPLICATES FROM t_landx.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: t005t is language-dependent tect table for T005, If you don't want the country names in all languages maintained in your system, add spras = sy-langu to your WHERE condition. If a country is not maintained in logon language in T005T, nothing is retrieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Dec 2006 13:24:10 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2006-12-02T13:24:10Z</dc:date>
    <item>
      <title>Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751480#M325864</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;Is there any way to optimise the below code. or can i write a join query for this if yes then how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT land1&lt;/P&gt;&lt;P&gt;         zone1&lt;/P&gt;&lt;P&gt;    FROM tzone&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE t_land&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN int_delivery&lt;/P&gt;&lt;P&gt;    WHERE zone1 = int_delivery-zone1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SELECT land1&lt;/P&gt;&lt;P&gt;           landx&lt;/P&gt;&lt;P&gt;      FROM t005t&lt;/P&gt;&lt;P&gt;      INTO CORRESPONDING FIELDS OF TABLE t_landx&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN t_land&lt;/P&gt;&lt;P&gt;      WHERE land1 = t_land-land1.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Any help will not go unappreciated..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2006 10:45:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751480#M325864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-02T10:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751481#M325865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT DISTINCT t005t~land1 landx
  FROM t005t
  JOIN tzone ON tzone~land1 = t005t~land1
  INTO CORRESPONDING FIELDS OF TABLE t_landx
  FOR ALL ENTRIES IN int_delivery
  WHERE zone1 = int_delivery-zone1
    AND spras = sy-langu.
  SORT t_landx.
  DELETE ADJACENT DUPLICATES FROM t_landx.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: t005t is language-dependent tect table for T005, If you don't want the country names in all languages maintained in your system, add spras = sy-langu to your WHERE condition. If a country is not maintained in logon language in T005T, nothing is retrieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2006 13:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751481#M325865</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-02T13:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751482#M325866</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;&amp;lt;i&amp;gt;how to optimize ?&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Avoid &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INTO CORRESPONDING&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;, create an internal table with required fields only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select tzone~land1 tzone~zone1 t005~landx
from tzone 
join t005t
on tzone~land1 = t005t~land1
into table t_landx
for all entries in int_delivery
where
tzone~zone1 = int_delivery-zone1
AND spras = sy-langu.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2006 15:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751482#M325866</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-12-02T15:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751483#M325867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;T005T is a small table. If TZONE is also small in your system, you might try reading all entries (for your language in T005T) from both tables into an internal table and then doing a binary search to get entries when you need them. This also assumes that INT_DELIVERY is relatively large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2006 19:32:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751483#M325867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-02T19:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751484#M325868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As suggested by Mr Burbank, i could go for his suggestion&lt;/P&gt;&lt;P&gt;however just to kill my curiosity which is more better way for optimising in &lt;/P&gt;&lt;P&gt;the current situation. &lt;/P&gt;&lt;P&gt;in this case I have to write two select queries and as suggested by anver there is only one select but the join is there. &lt;/P&gt;&lt;P&gt;So which one is more efficient.&lt;/P&gt;&lt;P&gt;Anver : any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards &lt;/P&gt;&lt;P&gt;Mohiuddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Dec 2006 05:35:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751484#M325868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-03T05:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751485#M325869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on the number of entries in the tables - I still like mine. Why don't you try them all out and let us know?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Dec 2006 18:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-optimisation/m-p/1751485#M325869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-03T18:16:41Z</dc:date>
    </item>
  </channel>
</rss>

