<?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 problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146103#M1514035</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;asish..&lt;/P&gt;&lt;P&gt;few suggestions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do not keep non key fields in the where clause, rather use DELETE after selection is done to remove the unwanted entries in the fetched table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. break down the big select statement . that will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Aug 2010 12:13:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-15T12:13:33Z</dc:date>
    <item>
      <title>select query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146102#M1514034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Expert ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             i have one which take more time to execute .  can you please suggest me how to make it effective .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select KUNNR  from knvp into CORRESPONDING FIELDS OF TABLE customer where KUNN2 = P_KUNNR AND  PARVW = 'ZD' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT CUSTOMER BY KUNNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM CUSTOMER .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="16" type="ul"&gt;&lt;P&gt;p_year - 1**********&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF CUSTOMER[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT A&lt;SUB&gt;KUNAG  A&lt;/SUB&gt;VBELN A&lt;SUB&gt;FKDAT B&lt;/SUB&gt;MATNR B&lt;SUB&gt;ARKTX B&lt;/SUB&gt;FKIMG B&lt;SUB&gt;VRKME B&lt;/SUB&gt;MEINS C~EXTWG INTO CORRESPONDING FIELDS OF TABLE IT FROM ( ( VBRK AS A INNER JOIN VBRP AS B ON&lt;/P&gt;&lt;P&gt;     A&lt;SUB&gt;VBELN = B&lt;/SUB&gt;VBELN ) INNER JOIN  MARA AS C ON B&lt;SUB&gt;MATNR = C&lt;/SUB&gt;MATNR ) FOR ALL ENTRIES IN&lt;/P&gt;&lt;P&gt;         CUSTOMER WHERE A&lt;SUB&gt;KUNAG = CUSTOMER-KUNNR AND ( B&lt;/SUB&gt;PSTYV NE 'TANN' AND B~PSTYV NE 'RENN' )&lt;/P&gt;&lt;P&gt;                                                                      AND   A~VBTYP = 'M'&lt;/P&gt;&lt;P&gt;                                                                      AND   C~EXTWG = 'SALE_IB'&lt;/P&gt;&lt;P&gt;                                                                      AND  A~BUKRS IN S_BUKRS&lt;/P&gt;&lt;P&gt;                                                                      AND   A~FKSTO = SPACE&lt;/P&gt;&lt;P&gt;                                                                      AND   ( A~FKDAT BETWEEN CUTOFF AND CUTOFF1 ) .&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cutoff &amp;amp; cutoff1 are month variable between dates&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;&lt;/P&gt;&lt;P&gt;Ashish Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 11:42:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146102#M1514034</guid>
      <dc:creator>ashish_gupta11</dc:creator>
      <dc:date>2010-08-15T11:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: select query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146103#M1514035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;asish..&lt;/P&gt;&lt;P&gt;few suggestions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do not keep non key fields in the where clause, rather use DELETE after selection is done to remove the unwanted entries in the fetched table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. break down the big select statement . that will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 12:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146103#M1514035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-15T12:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: select query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146104#M1514036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. In the select you're neither utilising any key fields nor hitting any DB indexes (as a matter of fact i checked and do not find any relevant indexes defined by SAP as well) If i understand correctly you're searching for billing dates in 1 month range (correct me if i'm wrong).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;B~PSTYV NE 'TANN' AND B~PSTYV NE 'RENN'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can take this out of your SELECT &amp;amp; add a DELETE statement on the corresponding internal table after your SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. You can try removing the INTO CORRESPONDING FIELDS OF addition &amp;amp; check if it fasten your runtime. ( I know many sceptics who would say  this doesn't improve the runtimes much ! )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All said make full use of SAP Runtime Analysis Tool (SE30), compare your runtimes, tweak the SELECT &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways good join construct &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (i prefer them with aliases)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 13:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146104#M1514036</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-08-15T13:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: select query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146105#M1514037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Masters ................Thanks for replies .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes I am searching within one month ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your supports are valuable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 13:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-problem/m-p/7146105#M1514037</guid>
      <dc:creator>ashish_gupta11</dc:creator>
      <dc:date>2010-08-15T13:38:18Z</dc:date>
    </item>
  </channel>
</rss>

