<?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 Select query takes long time.... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722876#M631711</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 am using a select query in which inspection lot is in another table and order no. is in another table. this select query taking very long time, what is the problem in this query ? Pl. guide us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select b&lt;SUB&gt;PRUEFLOS b&lt;/SUB&gt;MBLNR b&lt;SUB&gt;CPUDT a&lt;/SUB&gt;AUFNR a&lt;SUB&gt;matnr a&lt;/SUB&gt;LGORT a~bwart&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;ummat a&lt;SUB&gt;sgtxt a&lt;/SUB&gt;xauto&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;*into table itab&lt;/P&gt;&lt;P&gt;from mseg as a inner join qamb as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;and a&lt;SUB&gt;zeile = b&lt;/SUB&gt;zeile&lt;/P&gt;&lt;P&gt;where b~PRUEFLOS in insp&lt;/P&gt;&lt;P&gt; and  b~cpudt in date1&lt;/P&gt;&lt;P&gt; and b~typ = '3'&lt;/P&gt;&lt;P&gt; and a~bwart = '321'&lt;/P&gt;&lt;P&gt; and a~aufnr in aufnr1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2007 08:56:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-24T08:56:14Z</dc:date>
    <item>
      <title>Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722876#M631711</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 am using a select query in which inspection lot is in another table and order no. is in another table. this select query taking very long time, what is the problem in this query ? Pl. guide us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select b&lt;SUB&gt;PRUEFLOS b&lt;/SUB&gt;MBLNR b&lt;SUB&gt;CPUDT a&lt;/SUB&gt;AUFNR a&lt;SUB&gt;matnr a&lt;/SUB&gt;LGORT a~bwart&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;ummat a&lt;SUB&gt;sgtxt a&lt;/SUB&gt;xauto&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;*into table itab&lt;/P&gt;&lt;P&gt;from mseg as a inner join qamb as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;and a&lt;SUB&gt;zeile = b&lt;/SUB&gt;zeile&lt;/P&gt;&lt;P&gt;where b~PRUEFLOS in insp&lt;/P&gt;&lt;P&gt; and  b~cpudt in date1&lt;/P&gt;&lt;P&gt; and b~typ = '3'&lt;/P&gt;&lt;P&gt; and a~bwart = '321'&lt;/P&gt;&lt;P&gt; and a~aufnr in aufnr1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 08:56:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722876#M631711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T08:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722877#M631712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yusuf,&lt;/P&gt;&lt;P&gt;Also put MJAHR in selection criteria, as the same document can exist in many years. USE the following &lt;/P&gt;&lt;P&gt;select b&lt;SUB&gt;PRUEFLOS b&lt;/SUB&gt;MBLNR b&lt;SUB&gt;CPUDT a&lt;/SUB&gt;AUFNR a&lt;SUB&gt;matnr a&lt;/SUB&gt;LGORT a~bwart&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;ummat a&lt;SUB&gt;sgtxt a&lt;/SUB&gt;xauto&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;*into table itab&lt;/P&gt;&lt;P&gt;from mseg as a inner join qamb as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mjahr = b&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;and a&lt;SUB&gt;zeile = b&lt;/SUB&gt;zeile&lt;/P&gt;&lt;P&gt;where b~PRUEFLOS in insp&lt;/P&gt;&lt;P&gt;and b~cpudt in date1&lt;/P&gt;&lt;P&gt;and b~typ = '3'&lt;/P&gt;&lt;P&gt;and a~bwart = '321'&lt;/P&gt;&lt;P&gt;and a~aufnr in aufnr1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it takes a lot of time then make a view comprising of MSEG and QAMB containing all the fields.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mallick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:13:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722877#M631712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722878#M631713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mallick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is View comprising ? How to make it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722878#M631713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722879#M631714</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;&lt;/P&gt;&lt;P&gt;What is the structure of ITAB. If it is in same order as fields selected in the select query use INTO TABLE ITAB instead of INTO CORRESPONDING FIELDS OF TABLE ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is not of the same order then define another internal table with same order of fields and use in select query. &lt;/P&gt;&lt;P&gt;Into corresponding fields degrades performance of the program. &lt;/P&gt;&lt;P&gt;Never use INTO CORRESPONDING FIELDS...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722879#M631714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722880#M631715</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;instead of using 'move to corresponding of itab'  fields use  'into table itab'.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coz......if u use move to corresponding it will search for all the appropriate fields then it will place u r data........instead of that declare apprpiate internal table and use 'into table itab'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and one more thing dont use joins ......coz joins will decrease u r performance .....so instead of that use 'for all entries' ....and mention all the key fields in where condition ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points for helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722880#M631715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722881#M631716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sankar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have removed Corresponding but eventhough it takes long time ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722881#M631716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722882#M631717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722882#M631717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722883#M631718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 06:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722883#M631718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T06:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select query takes long time....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722884#M631719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The main problem in your code is ur using inner join syntax and fields which is using in on  "a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr and a&lt;SUB&gt;zeile = b&lt;/SUB&gt;zeile" are not Key fields in other table is QUMB, its leads highly perforamnce issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the FOR ENTRIES concept inseady of joins.&lt;/P&gt;&lt;P&gt;and you have to give the key fields in where condition for a table MSEG, this tabel contain huge data. so while getting date use always key fields in where condition and maintain sequence..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward with points if it useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 09:44:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-takes-long-time/m-p/2722884#M631719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T09:44:30Z</dc:date>
    </item>
  </channel>
</rss>

