<?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: Performance issue with a select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067416#M427899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kapil, Matkl is not needed but it was requested by the users.  It is in there so they can look at only certain material groups.  For input I have a date range, movement types, and plants (all select-options).  They are all required.  We have matkl and matnr as optional inputs (also select-options) so they can further refine the search.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you response,&lt;/P&gt;&lt;P&gt;Davis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Mar 2007 13:44:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-26T13:44:39Z</dc:date>
    <item>
      <title>Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067410#M427893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The follow code is the select statement in question.  This statement works beautifully unless I input a matnr or matkl as a parameter.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT b~matnr a~budat b~menge a~mblnr a~mjahr b~bwart b~werks b~meins c~matkl c~mtart d~maktx b~shkzg
  INTO TABLE it_detail_temp
  FROM mkpf AS a
    INNER JOIN mseg AS b
          ON b~mblnr = a~mblnr
          AND b~mjahr = a~mjahr
    INNER JOIN mara AS c
          ON c~matnr = b~matnr
    INNER JOIN makt AS d
          ON d~matnr = c~matnr
                 WHERE  a~budat IN s_budat
                AND b~bwart IN s_bwart
               AND b~werks IN s_werks
                AND b~matnr IN s_matnr
                AND c~matkl IN s_matkl.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I input matnr or matkl the program does not run, it just hangs there.  I don't understand why either of these parameters would cause the program to freeze at the select.  Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 12:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067410#M427893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T12:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067411#M427894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please check wether any of the accessed tables has a non-standard index created on them? If there are any indexes created please post them incuding their fields.&lt;/P&gt;&lt;P&gt;I would say you've got an Index / access problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also compare the result of SE30 with and without matnr an matkl in the selection to see what the SQL is really doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alfonso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:14:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067411#M427894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067412#M427895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfonso, is there an easy way to see if any of the tables have a non-standard index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067412#M427895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067413#M427896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl let me know whether u want MATKL in selection field. is it ok if u remove it from selection as i think there is not such need. As per my knowlege every material in one plant is having only one materil group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also pl check whether that material group is belong to that material or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we consider performance of the program then SAP recomend to use only 2-3 tables in inner join. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl check above points and in case of issue pl reply the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if this solve ur problem the give appropriate points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kapil Soni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067413#M427896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067414#M427897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SE11 --&amp;gt; Inser table name, click on display&lt;/P&gt;&lt;P&gt;"Indexes"  Button on top of page (right side) a pop-up with all indexes for that table should appear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alfonso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067414#M427897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067415#M427898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is one on matkl (MARA-L).  This is a non-unique index created by SAP in package ML.  The select isn't so bad when you input at matnr but it is with matkl.  There is an index with matnr (MSEG-M) in package MB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is the information were asking for,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:41:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067415#M427898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067416#M427899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kapil, Matkl is not needed but it was requested by the users.  It is in there so they can look at only certain material groups.  For input I have a date range, movement types, and plants (all select-options).  They are all required.  We have matkl and matnr as optional inputs (also select-options) so they can further refine the search.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you response,&lt;/P&gt;&lt;P&gt;Davis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:44:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067416#M427899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067417#M427900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have inner joins on more than 2 tables it will effect the performance a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its advisible to use FOR ALL ENTRIES and get the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As You are getting only MAKTX from MAKT for MATNRs, so get the MATNRs and their descriptions by using FOR ALL ENTRIES on the result internal table of MSEG and MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can one more condition in your WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT b&lt;SUB&gt;matnr a&lt;/SUB&gt;budat b&lt;SUB&gt;menge a&lt;/SUB&gt;mblnr a&lt;SUB&gt;mjahr b&lt;/SUB&gt;bwart b&lt;SUB&gt;werks b&lt;/SUB&gt;meins c&lt;SUB&gt;matkl c&lt;/SUB&gt;mtart d&lt;SUB&gt;maktx b&lt;/SUB&gt;shkzg&lt;/P&gt;&lt;P&gt;  INTO TABLE it_detail_temp&lt;/P&gt;&lt;P&gt;  FROM mkpf AS a&lt;/P&gt;&lt;P&gt;    INNER JOIN mseg AS b&lt;/P&gt;&lt;P&gt;          ON b&lt;SUB&gt;mblnr = a&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;          AND b&lt;SUB&gt;mjahr = a&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;    INNER JOIN mara AS c&lt;/P&gt;&lt;P&gt;          ON c&lt;SUB&gt;matnr = b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;    INNER JOIN makt AS d&lt;/P&gt;&lt;P&gt;          ON d&lt;SUB&gt;matnr = c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                 WHERE  a~budat IN s_budat&lt;/P&gt;&lt;P&gt;                AND b~bwart IN s_bwart&lt;/P&gt;&lt;P&gt;               AND b~werks IN s_werks&lt;/P&gt;&lt;P&gt;                AND b~matnr IN s_matnr&lt;/P&gt;&lt;P&gt;                AND c~matkl IN s_matkl&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;                AND D~SPRAS = SY-LANGU.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:48:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067417#M427900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067418#M427901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT b&lt;SUB&gt;matnr a&lt;/SUB&gt;budat b&lt;SUB&gt;menge a&lt;/SUB&gt;mblnr a&lt;SUB&gt;mjahr b&lt;/SUB&gt;bwart b&lt;SUB&gt;werks b&lt;/SUB&gt;meins c&lt;SUB&gt;matkl c&lt;/SUB&gt;mtart d&lt;SUB&gt;maktx b&lt;/SUB&gt;shkzg&lt;/P&gt;&lt;P&gt;  INTO TABLE it_detail_temp&lt;/P&gt;&lt;P&gt;  FROM mkpf AS a&lt;/P&gt;&lt;P&gt;    INNER JOIN mseg AS b&lt;/P&gt;&lt;P&gt;          ON b&lt;SUB&gt;mblnr = a&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;          AND b&lt;SUB&gt;mjahr = a&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;    INNER JOIN mara AS c&lt;/P&gt;&lt;P&gt;          ON c&lt;SUB&gt;matnr = b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;               WHERE  a~budat IN s_budat&lt;/P&gt;&lt;P&gt;                AND b~bwart IN s_bwart&lt;/P&gt;&lt;P&gt;               AND b~werks IN s_werks&lt;/P&gt;&lt;P&gt;                AND b~matnr IN s_matnr&lt;/P&gt;&lt;P&gt;                AND c~matkl IN s_matkl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_detail_temp.&lt;/P&gt;&lt;P&gt;select single maktx from makt &lt;/P&gt;&lt;P&gt;              where matnr = it_detail_temp-matnr.&lt;/P&gt;&lt;P&gt;modify it_detail_temp.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i had not done anything extra only keep join on 3 tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also make sure that there is Foreign key relationshipis set for ( Matnr and Matkl ) at selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&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;Kapil Soni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:56:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067418#M427901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T13:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with a select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067419#M427902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all for their suggestions.  I have not been able to get any of the suggested fixes to work.  Vinaykumar and Kapil, thanks for your suggestions but they didn''t seem to improve the performance.  This program will take up to an hour to run anyway (without using matkl or matnr) so I think I'll leave it as is for now and if they want to run a the report with either of the two they will have to run it overnight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Davis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 14:28:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-a-select-statement/m-p/2067419#M427902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T14:28:48Z</dc:date>
    </item>
  </channel>
</rss>

