<?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 Statement Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147572#M453169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't understand srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then how to optimise the performance of above select statement is there any other way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more thing also there like...i have filter the po number by putting the below condition in the above select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;b&amp;gt;ekpo~elikz = ' '&amp;lt;/b&amp;gt;  ,     that means when i put this condition then the po r open.. how to add this condition to the above select statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz someone help me its bit urgent....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Apr 2007 19:15:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-13T19:15:42Z</dc:date>
    <item>
      <title>Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147568#M453165</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;here is the select statemenet can anyone modify this select statement in such a way that performance should be good....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_ekgrp FOR ekko-ekgrp.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_matkl FOR ekpo-matkl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT    a&lt;SUB&gt;ebeln a&lt;/SUB&gt;lifnr a~ernam&lt;/P&gt;&lt;P&gt;                 b&lt;SUB&gt;ebelp b&lt;/SUB&gt;matnr b&lt;SUB&gt;txz01 b&lt;/SUB&gt;werks b&lt;SUB&gt;menge b&lt;/SUB&gt;meins b~ktpnr  &lt;/P&gt;&lt;P&gt;                 b~konnr&lt;/P&gt;&lt;P&gt;                 c~eindt&lt;/P&gt;&lt;P&gt;                 d&lt;SUB&gt;netpr d&lt;/SUB&gt;infnr d~netpr&lt;/P&gt;&lt;P&gt;                 e~name1       into  table T_EKKO from ekko as a&lt;/P&gt;&lt;P&gt;inner join eket as b on a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;inner join eket as c on b&lt;SUB&gt;ebeln = c&lt;/SUB&gt;ebeln and b&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;inner join eine as d on a&lt;SUB&gt;ekorg = d&lt;/SUB&gt;ekorg&lt;/P&gt;&lt;P&gt;inner join lfa1 as e on a&lt;SUB&gt;lifnr = e&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;where a&lt;SUB&gt;ekgrp in s_ekgrp and b&lt;/SUB&gt;matkl in s_maktl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so here my question is in the selection screen i am having only two field those r not key fileds in the corresponding tables where as in indexes those two are included as in ekko as ekko 1 as ekorg, and ekpo as ekpo 1 as matkl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to include these indexes into the above select statement... plz its bit urgent...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 18:55:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147568#M453165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T18:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147569#M453166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The determinatino of using indexes on tables is totally up to the optimizer.  Yes, I am aware that Hints can be used, but I am under the impression that it doesn't help unless you are running an Oracle database(i could be wrong). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 18:58:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147569#M453166</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-04-13T18:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147570#M453167</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;You can use the following statement in your select statement:&lt;/P&gt;&lt;P&gt;%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;  SELECT carrid connid cityfrom&lt;/P&gt;&lt;P&gt;  FROM spfli INTO (xcarrid, xconnid, xcityfrom)&lt;/P&gt;&lt;P&gt;  WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'&lt;/P&gt;&lt;P&gt;  %_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivasa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 19:07:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147570#M453167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T19:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147571#M453168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, there seems to be mistakes in your SELECT,  notice you are joining EKET twice, this is not right, and the join to EINE is not right either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some modified code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT  zrich_0001.

TABLES: ekko, ekpo.

data: begin of t_ekko occurs 0,
      ebeln type ekko-ebeln,
      lifnr type ekko-lifnr,
      ernam type ekko-ernam,
      ebelp type ekpo-ebelp,
      matnr type ekpo-matnr,
      txz01 type ekpo-txz01,
      werks type ekpo-werks,
      menge type ekpo-menge,
      meins type ekpo-meins,
      ktpnr type ekpo-ktpnr,
      konnr type ekpo-konnr,
      eindt type eket-eindt,
      netpr type eine-netpr,
      infnr type eine-infnr,
      name1 type lfa1-name1,
      end of t_ekko.

SELECT-OPTIONS: s_ekgrp FOR ekko-ekgrp.
SELECT-OPTIONS: s_matkl FOR ekpo-matkl.

SELECT a~ebeln a~lifnr a~ernam
b~ebelp b~matnr b~txz01 b~werks b~menge b~meins b~ktpnr
b~konnr
c~eindt
d~netpr d~infnr
e~name1
     INTO TABLE t_ekko FROM ekko AS a
           INNER JOIN ekpo AS b
                ON a~ebeln = b~ebeln
           INNER JOIN eket AS c
                ON b~ebeln = c~ebeln
               AND b~ebelp = c~ebelp
           INNER JOIN eine AS d
                ON b~INFNR = d~INFNR
           INNER JOIN lfa1 AS e
                ON a~lifnr = e~lifnr
                  WHERE a~ekgrp IN s_ekgrp
                    AND b~matkl IN s_matkl.

  check sy-subrc = 0.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This coding runs pretty fast in my system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 19:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147571#M453168</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-04-13T19:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147572#M453169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't understand srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then how to optimise the performance of above select statement is there any other way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more thing also there like...i have filter the po number by putting the below condition in the above select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;b&amp;gt;ekpo~elikz = ' '&amp;lt;/b&amp;gt;  ,     that means when i put this condition then the po r open.. how to add this condition to the above select statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz someone help me its bit urgent....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 19:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147572#M453169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T19:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147573#M453170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So adding the additional  filter to the WHERE clause would be like so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~ebeln a~lifnr a~ernam
b~ebelp b~matnr b~txz01 b~werks b~menge b~meins b~ktpnr
b~konnr
c~eindt
d~netpr d~infnr
e~name1
     INTO TABLE t_ekko FROM ekko AS a
           INNER JOIN ekpo AS b
                ON a~ebeln = b~ebeln
           INNER JOIN eket AS c
                ON b~ebeln = c~ebeln
               AND b~ebelp = c~ebelp
           INNER JOIN eine AS d
                ON b~INFNR = d~INFNR
           INNER JOIN lfa1 AS e
                ON a~lifnr = e~lifnr
                  WHERE a~ekgrp IN s_ekgrp
                    AND b~matkl IN s_matkl
                    and b~elikz = space.  "&amp;lt;- Right HEre
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 19:17:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147573#M453170</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-04-13T19:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147574#M453171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this select statement is taking much longer time in the production system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you tell me any alternative way to do this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 20:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147574#M453171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T20:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147575#M453172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SELECT statement that I've provided is taking too long?  In my system it is running good. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 20:36:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147575#M453172</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-04-13T20:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147576#M453173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked in the production system rich... It is having lot of records...so it is taking so much of time may be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any alternate option to change this select statement so that i can optimise the performance in production system also&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 20:50:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147576#M453173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T20:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147577#M453174</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;Please check using secondary indexes and include the following statement&lt;/P&gt;&lt;P&gt;%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")' in your select query and try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 21:07:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147577#M453174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T21:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147578#M453175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;srinivasa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in indexes 1 those fiels r not in the first position&lt;/P&gt;&lt;P&gt;those r in the 4th position in the both the tables so even though i add it, its not useful i think rite&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 21:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-query/m-p/2147578#M453175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T21:21:26Z</dc:date>
    </item>
  </channel>
</rss>

