<?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 queries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632414#M1090907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Whenever you are using the select statements it is advisory to use the key fields otherwise some performance issues will come sometime run time errors can also occurs .&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thiru. R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2008 10:12:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-21T10:12:15Z</dc:date>
    <item>
      <title>select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632409#M1090902</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;when using select query like &lt;/P&gt;&lt;P&gt;  Select VDATU BDATU LIFNR NOTKZ from EORD into table IT_EORD&lt;/P&gt;&lt;P&gt;                                                    where MATNR = WA_FINAL-MATNR&lt;/P&gt;&lt;P&gt;                                                      And WERKS = WA_FINAL-WERKS.&lt;/P&gt;&lt;P&gt;is it is mandatory to keep all key fields in where condition.&lt;/P&gt;&lt;P&gt;IS above query is correct(performance wise).Because in EORD key fields are MATNR,&lt;/P&gt;&lt;P&gt;WERKS,ZEORD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In which case it's mandatory to keep all key fields in where condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 09:56:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632409#M1090902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T09:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632410#M1090903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Boss,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO improve the performance of the program in select querey the key fields are must and should in the where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best  Regards,&lt;/P&gt;&lt;P&gt;Narasimha Rao.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632410#M1090903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632411#M1090904</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;The Select query is fine, it is not mandatory to include all the key fields in the where clause, it all depends on the requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, putting all the key fields in the where clause will definitely help to fetch data faster. Since system has to less check for data, it can directly go keeping all the key fields as search criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Navneeth  K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:03:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632411#M1090904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632412#M1090905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;looks like the SELECT is in a LOOP (because of the wa_...), which is not a good technique, however you have to run SE30 first to analyse where are the performance issues in the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:04:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632412#M1090905</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-10-21T10:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632413#M1090906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;praveena you can yourself judge your program's performance, &lt;/P&gt;&lt;P&gt;SAP has provided SLIN check,code inspector etc..&lt;/P&gt;&lt;P&gt;one way i can tell you :open your program and in the menu :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program -&amp;gt; Check -&amp;gt; Code Inspector&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another way you can goto tcode SE30 for runtime analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also search for your querry on sdn forum, i think so many posts had already been on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632413#M1090906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632414#M1090907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Whenever you are using the select statements it is advisory to use the key fields otherwise some performance issues will come sometime run time errors can also occurs .&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thiru. R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632414#M1090907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632415#M1090908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is good to have key fields in the select queries where clause,but as we all know its not always possible due to various reasons, example we might want to find sales orders for a particular partner etc.&lt;/P&gt;&lt;P&gt;This is when indices come handy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, the query look good , but it seems that you are looping at some internal table into work area and then writing the select query. Avoid writing select queries in a loop, instead use FOR ALL ENTRIES or even better JOIN if you can join the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select VDATU BDATU LIFNR NOTKZ from EORD into table IT_EORD
for all entries in it_final     " assuming your internal table is it_final and you are using an internal table
where MATNR = it_FINAL-MATNR
And WERKS = it_FINAL-WERKS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to be sure that in this case the table it_final is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632415#M1090908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: select queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632416#M1090909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Praveena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For better performance we try to use all the key fields in that table in where condition.&lt;/P&gt;&lt;P&gt;but it is not mandatory to use all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Kumar M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 10:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-queries/m-p/4632416#M1090909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T10:19:53Z</dc:date>
    </item>
  </channel>
</rss>

