<?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: Normalise the select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304440#M1534683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rohit kaikala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure whether it will increase the performance but try once :&lt;/P&gt;&lt;P&gt;Add LOEKZ,EKORG,BSTYP in your internal table and using DELETE command delete them. Just try if it can increase the performance.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT a~ebeln a~bedat
a~ihrez a~reswk
a~unsez
b~ebelp b~matnr
b~werks b~lgort
b~matkl b~menge
FROM ekko AS a INNER JOIN ekpo AS b
ON a~ebeln EQ b~ebeln
INTO CORRESPONDING FIELDS OF TABLE sto_tab
WHERE a~ebeln IN s_ebeln
AND a~bsart IN ('ZUB1' ,'ZUB2')
AND a~reswk EQ p_reswk
AND b~matnr IN s_matnr
AND b~werks IN s_werks
AND b~lgort EQ p_lgort
AND b~elikz NE 'X'.
"Here you DELETE itab as required like 
DELETE STO_TAB WHERE LOEKZ IS NOT INITIAL.
DELETE STO_TAB WHERE BSTYP NE 'F'.
DELETE STO_TAB WHERE EKORG NE '6000'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Rock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Sep 2010 05:12:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-21T05:12:15Z</dc:date>
    <item>
      <title>Normalise the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304439#M1534682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a select statement which is taking more than 10min to execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a&lt;SUB&gt;ebeln a&lt;/SUB&gt;bedat&lt;/P&gt;&lt;P&gt;         a&lt;SUB&gt;ihrez a&lt;/SUB&gt;reswk&lt;/P&gt;&lt;P&gt;         a~unsez&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;ebelp b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;werks b&lt;/SUB&gt;lgort&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;matkl b&lt;/SUB&gt;menge&lt;/P&gt;&lt;P&gt;         FROM ekko AS a INNER JOIN ekpo AS b&lt;/P&gt;&lt;P&gt;         ON a&lt;SUB&gt;ebeln EQ b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;        INTO CORRESPONDING FIELDS OF TABLE sto_tab&lt;/P&gt;&lt;P&gt;        WHERE a~ebeln IN s_ebeln&lt;/P&gt;&lt;P&gt;        AND a~bstyp EQ 'F'&lt;/P&gt;&lt;P&gt;        AND a~bsart IN ('ZUB1' ,'ZUB2')&lt;/P&gt;&lt;P&gt;        AND a~loekz EQ ' '&lt;/P&gt;&lt;P&gt;        AND a~ekorg EQ '6000'&lt;/P&gt;&lt;P&gt;        AND a~reswk EQ p_reswk&lt;/P&gt;&lt;P&gt;        AND b~loekz EQ ' '&lt;/P&gt;&lt;P&gt;        AND b~matnr IN s_matnr&lt;/P&gt;&lt;P&gt;        AND b~werks IN s_werks&lt;/P&gt;&lt;P&gt;        AND b~lgort EQ p_lgort&lt;/P&gt;&lt;P&gt;        AND b~elikz NE 'X'&lt;/P&gt;&lt;P&gt;        AND b~bstyp EQ 'F'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me some suggestions to get more faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rohith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 04:58:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304439#M1534682</guid>
      <dc:creator>rohit_kaikala</dc:creator>
      <dc:date>2010-09-21T04:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Normalise the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304440#M1534683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rohit kaikala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure whether it will increase the performance but try once :&lt;/P&gt;&lt;P&gt;Add LOEKZ,EKORG,BSTYP in your internal table and using DELETE command delete them. Just try if it can increase the performance.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT a~ebeln a~bedat
a~ihrez a~reswk
a~unsez
b~ebelp b~matnr
b~werks b~lgort
b~matkl b~menge
FROM ekko AS a INNER JOIN ekpo AS b
ON a~ebeln EQ b~ebeln
INTO CORRESPONDING FIELDS OF TABLE sto_tab
WHERE a~ebeln IN s_ebeln
AND a~bsart IN ('ZUB1' ,'ZUB2')
AND a~reswk EQ p_reswk
AND b~matnr IN s_matnr
AND b~werks IN s_werks
AND b~lgort EQ p_lgort
AND b~elikz NE 'X'.
"Here you DELETE itab as required like 
DELETE STO_TAB WHERE LOEKZ IS NOT INITIAL.
DELETE STO_TAB WHERE BSTYP NE 'F'.
DELETE STO_TAB WHERE EKORG NE '6000'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Rock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304440#M1534683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Normalise the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304441#M1534684</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;Remove the into corresponding fields statement and also use fields in same sequence as in table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use the primary index in where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:47:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304441#M1534684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T07:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Normalise the select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304442#M1534685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message - Please see &lt;SPAN __jive_macro_name="thread" id="1283414"&gt;&lt;/SPAN&gt; before posting - post locked

Rob&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 13:00:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/normalise-the-select-statement/m-p/7304442#M1534685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T13:00:49Z</dc:date>
    </item>
  </channel>
</rss>

