<?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:Performance Issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051505#M1174209</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;Try this...&lt;/P&gt;&lt;P&gt;Declare one internal table s031 with ur required fields......&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select spmon werks matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt;from s031 into table gt_s031 for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where   werks = gt_header-bwkey &lt;/P&gt;&lt;P&gt;and      matnr = gt_header-matnr&lt;/P&gt;&lt;P&gt; and     lgort = gt_header-lgort &lt;/P&gt;&lt;P&gt;and   spmon LE v_month_year&lt;/P&gt;&lt;P&gt; and  spmon GE month_lastyr  .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Upender Verma on Jan 5, 2009 7:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2009 06:41:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-05T06:41:22Z</dc:date>
    <item>
      <title>Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051504#M1174208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLz suggest..&lt;/P&gt;&lt;P&gt;My select query is taking large executio thime even for one month data.&lt;/P&gt;&lt;P&gt;t_header table has around 30,000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into corresponding fields of table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where (  spmon LE v_month_year and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr ) and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;      matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_month_year : sy-date (month &amp;amp; year)&lt;/P&gt;&lt;P&gt;month_lastyr : (month &amp;amp; year) enter by user  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz suggest how to improve performance of query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:35:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051504#M1174208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T06:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051505#M1174209</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;Try this...&lt;/P&gt;&lt;P&gt;Declare one internal table s031 with ur required fields......&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select spmon werks matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt;from s031 into table gt_s031 for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where   werks = gt_header-bwkey &lt;/P&gt;&lt;P&gt;and      matnr = gt_header-matnr&lt;/P&gt;&lt;P&gt; and     lgort = gt_header-lgort &lt;/P&gt;&lt;P&gt;and   spmon LE v_month_year&lt;/P&gt;&lt;P&gt; and  spmon GE month_lastyr  .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Upender Verma on Jan 5, 2009 7:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051505#M1174209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T06:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051506#M1174210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Aastha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check table S031 it has an index on MATNR &amp;amp; you have used MATNR in your selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can remove &lt;STRONG&gt;into corresponding fields&lt;/STRONG&gt; addition in the select stmt &amp;amp; check the execution time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few points to see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. gt_header[] table has how many records?&lt;/P&gt;&lt;P&gt;2. In the where clause :where ( spmon LE v_month_year and spmon GE month_lastyr ), what are the values in v_month_year &amp;amp; month_lastyr . Are you extracting data for a whole year?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:41:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051506#M1174210</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-05T06:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051507#M1174211</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;Avoid using "into corresponding fields of table gt_s031",instead delare the internal table gt_s031 with the required fields only &lt;/P&gt;&lt;P&gt;select spmon werks matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt;from s031&lt;/P&gt;&lt;P&gt;into table gt_s031&lt;/P&gt;&lt;P&gt;for all entries in gt_header...........&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;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:43:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051507#M1174211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T06:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051508#M1174212</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;avoid the corresponding fields in the select query,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select spmon werks matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt;from s031&lt;/P&gt;&lt;P&gt;into table gt_s031&lt;/P&gt;&lt;P&gt;for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;( werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;lgort = gt_header-lgort ) and &lt;/P&gt;&lt;P&gt;( spmon LE v_month_year and&lt;/P&gt;&lt;P&gt;spmon GE month_lastyr ).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:45:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051508#M1174212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T06:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051509#M1174213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aastha ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt;  from s031&lt;/P&gt;&lt;P&gt;  into table gt_s031&lt;/P&gt;&lt;P&gt;  for all entries in gt_header&lt;/P&gt;&lt;P&gt;  where spmon LE v_month_year &lt;/P&gt;&lt;P&gt;      and spmon GE month_lastyr &lt;/P&gt;&lt;P&gt;      and werks = gt_header-bwkey &lt;/P&gt;&lt;P&gt;      and matnr = gt_header-matnr &lt;/P&gt;&lt;P&gt;      and lgort = gt_header-lgort.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I think this should work as far as the data goes try to give as many primary fields as possible .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Sahil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 06:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051509#M1174213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T06:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051510#M1174214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aasta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have 30, 000 records in gt_header as you said, so there might be duplicates comparing fields bwkey matnr and lgort. so, you should:&lt;/P&gt;&lt;P&gt;- please make a copy of the gt_header table and do a sort and delete adjacent duplicates (comparing bwkey matnr and lgort) on the copy of gt_header before dong the for all entries.&lt;/P&gt;&lt;P&gt;- also try to put all the fields in the itab gt_s031 in the same order as in the select clause and remove the into corresponding fields clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Dev Parbutteea on Jan 5, 2009 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 08:59:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051510#M1174214</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2009-01-05T08:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051511#M1174215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query is taking lot of time for execution, i m not able to get the reason.&lt;/P&gt;&lt;P&gt;Plz tell something to improve my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_s031,&lt;/P&gt;&lt;P&gt;        spmon         type s031-spmon,&lt;/P&gt;&lt;P&gt;        werks         type s031-werks,&lt;/P&gt;&lt;P&gt;        matnr         type s031-matnr,&lt;/P&gt;&lt;P&gt;        lgort         type s031-lgort,&lt;/P&gt;&lt;P&gt;        mzubb         type s031-mzubb,&lt;/P&gt;&lt;P&gt;        wzubb         type s031-wzubb,&lt;/P&gt;&lt;P&gt;        magbb         type s031-magbb,&lt;/P&gt;&lt;P&gt;       end of ty_s031.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration for the Internal-Tables and Work-Areas.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_s031       type standard table of ty_s031,&lt;/P&gt;&lt;P&gt;      gw_s031       type ty_s031.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_header has around 30000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;        matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort and&lt;/P&gt;&lt;P&gt;         spmon LE v_month_year  and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_month_year : today's month &amp;amp; year &lt;/P&gt;&lt;P&gt;month_lastyr  : user enter month &amp;amp; year as per his requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 09:18:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051511#M1174215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T09:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051512#M1174216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query is taking lot of time for execution, i m not able to get the reason.&lt;/P&gt;&lt;P&gt;Plz tell something to improve my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_s031,&lt;/P&gt;&lt;P&gt;        spmon         type s031-spmon,&lt;/P&gt;&lt;P&gt;        werks         type s031-werks,&lt;/P&gt;&lt;P&gt;        matnr         type s031-matnr,&lt;/P&gt;&lt;P&gt;        lgort         type s031-lgort,&lt;/P&gt;&lt;P&gt;        mzubb         type s031-mzubb,&lt;/P&gt;&lt;P&gt;        wzubb         type s031-wzubb,&lt;/P&gt;&lt;P&gt;        magbb         type s031-magbb,&lt;/P&gt;&lt;P&gt;       end of ty_s031.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration for the Internal-Tables and Work-Areas.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_s031       type standard table of ty_s031,&lt;/P&gt;&lt;P&gt;      gw_s031       type ty_s031.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_header has around 30000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;        matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort and&lt;/P&gt;&lt;P&gt;         spmon LE v_month_year  and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_month_year : today's month &amp;amp; year &lt;/P&gt;&lt;P&gt;month_lastyr  : user enter month &amp;amp; year as per his requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 09:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051512#M1174216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T09:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051513#M1174217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query is taking lot of time for execution, i m not able to get the reason.&lt;/P&gt;&lt;P&gt;Plz tell something to improve my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_s031,&lt;/P&gt;&lt;P&gt;        spmon         type s031-spmon,&lt;/P&gt;&lt;P&gt;        werks         type s031-werks,&lt;/P&gt;&lt;P&gt;        matnr         type s031-matnr,&lt;/P&gt;&lt;P&gt;        lgort         type s031-lgort,&lt;/P&gt;&lt;P&gt;        mzubb         type s031-mzubb,&lt;/P&gt;&lt;P&gt;        wzubb         type s031-wzubb,&lt;/P&gt;&lt;P&gt;        magbb         type s031-magbb,&lt;/P&gt;&lt;P&gt;       end of ty_s031.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration for the Internal-Tables and Work-Areas.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_s031       type standard table of ty_s031,&lt;/P&gt;&lt;P&gt;      gw_s031       type ty_s031.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_header has around 30000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;        matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort and&lt;/P&gt;&lt;P&gt;         spmon LE v_month_year  and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_month_year : today's month &amp;amp; year &lt;/P&gt;&lt;P&gt;month_lastyr  : user enter month &amp;amp; year as per his requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 09:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051513#M1174217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T09:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051514#M1174218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query is taking lot of time for execution, i m not able to get the reason.&lt;/P&gt;&lt;P&gt;Plz tell something to improve my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_s031,&lt;/P&gt;&lt;P&gt;        spmon         type s031-spmon,&lt;/P&gt;&lt;P&gt;        werks         type s031-werks,&lt;/P&gt;&lt;P&gt;        matnr         type s031-matnr,&lt;/P&gt;&lt;P&gt;        lgort         type s031-lgort,&lt;/P&gt;&lt;P&gt;        mzubb         type s031-mzubb,&lt;/P&gt;&lt;P&gt;        wzubb         type s031-wzubb,&lt;/P&gt;&lt;P&gt;        magbb         type s031-magbb,&lt;/P&gt;&lt;P&gt;       end of ty_s031.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration for the Internal-Tables and Work-Areas.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_s031       type standard table of ty_s031,&lt;/P&gt;&lt;P&gt;      gw_s031       type ty_s031.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_header has around 30000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;        matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort and&lt;/P&gt;&lt;P&gt;         spmon LE v_month_year  and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_month_year : today's month &amp;amp; year &lt;/P&gt;&lt;P&gt;month_lastyr  : user enter month &amp;amp; year as per his requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 11:34:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051514#M1174218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T11:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051515#M1174219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Upender,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query is taking lot of time for execution, i m not able to get the reason.&lt;/P&gt;&lt;P&gt;Plz tell something to improve my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_s031,&lt;/P&gt;&lt;P&gt;        spmon         type s031-spmon,&lt;/P&gt;&lt;P&gt;        werks         type s031-werks,&lt;/P&gt;&lt;P&gt;        matnr         type s031-matnr,&lt;/P&gt;&lt;P&gt;        lgort         type s031-lgort,&lt;/P&gt;&lt;P&gt;        mzubb         type s031-mzubb,&lt;/P&gt;&lt;P&gt;        wzubb         type s031-wzubb,&lt;/P&gt;&lt;P&gt;        magbb         type s031-magbb,&lt;/P&gt;&lt;P&gt;       end of ty_s031.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration for the Internal-Tables and Work-Areas.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_s031       type standard table of ty_s031,&lt;/P&gt;&lt;P&gt;      gw_s031       type ty_s031.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_header has around 30000 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if gt_header[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select spmon  werks  matnr lgort mzubb wzubb magbb&lt;/P&gt;&lt;P&gt; from s031&lt;/P&gt;&lt;P&gt; into table gt_s031&lt;/P&gt;&lt;P&gt; for all entries in gt_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where&lt;/P&gt;&lt;P&gt;       werks = gt_header-bwkey and&lt;/P&gt;&lt;P&gt;        matnr = gt_header-matnr and&lt;/P&gt;&lt;P&gt;       lgort = gt_header-lgort and&lt;/P&gt;&lt;P&gt;         spmon LE v_month_year  and&lt;/P&gt;&lt;P&gt;        spmon GE month_lastyr   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_month_year : today's month &amp;amp; year &lt;/P&gt;&lt;P&gt;month_lastyr  : user enter month &amp;amp; year as per his requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 11:35:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051515#M1174219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T11:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051516#M1174220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aastha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please avoid using INTO CORRESPONDING FIELDS OF itab. This is because after selecting the fields from the database table and before putting them into the itab, it goes and check for the column everytime while putting an entry corresponding to it. &lt;/P&gt;&lt;P&gt;Select the fields in the order of which you have declared them in the internal table and Simply use &lt;/P&gt;&lt;P&gt;Select a b c from dbase&lt;/P&gt;&lt;P&gt;          INTO TABLE itab&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN itab1&lt;/P&gt;&lt;P&gt;          WHERE xxxx =itab1-yyyy..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 11:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051516#M1174220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T11:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051517#M1174221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please remove INTO CORRESPONDING FIELDS OF. Because it will check each and every field while updating entries into corresponding field. Specify the fields in the order in the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 11:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051517#M1174221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T11:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051518#M1174222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Moved to ABAP Performance forum...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2009 12:00:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051518#M1174222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-05T12:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query:Performance Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051519#M1174223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did the same , as I post in my earlier thread..&lt;/P&gt;&lt;P&gt;then also it is showing performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aastha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2009 06:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-performance-issue/m-p/5051519#M1174223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-06T06:15:33Z</dc:date>
    </item>
  </channel>
</rss>

