<?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: problem with select statement in production in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282268#M1219053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what means "unsuccessful" in this context?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2009 16:44:05 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2009-03-17T16:44:05Z</dc:date>
    <item>
      <title>problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282267#M1219052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guruz,&lt;/P&gt;&lt;P&gt;select statement  sucess in development is unsuccessful in production.plz advise:(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT vbuk~vbeln&lt;/P&gt;&lt;P&gt;         likp~vstel&lt;/P&gt;&lt;P&gt;         likp~kunag&lt;/P&gt;&lt;P&gt;         likp~wadat&lt;/P&gt;&lt;P&gt;         likp~erdat&lt;/P&gt;&lt;P&gt;         lips~lgort&lt;/P&gt;&lt;P&gt;         lips~posnr&lt;/P&gt;&lt;P&gt;         lips~matkl&lt;/P&gt;&lt;P&gt;         vbfa~vbeln&lt;/P&gt;&lt;P&gt;         vbpa~kunnr&lt;/P&gt;&lt;P&gt;         ltak~bdatu&lt;/P&gt;&lt;P&gt;  FROM ( vbuk&lt;/P&gt;&lt;P&gt;         INNER JOIN likp&lt;/P&gt;&lt;P&gt;         ON vbuk&lt;SUB&gt;vbeln = likp&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         INNER JOIN lips&lt;/P&gt;&lt;P&gt;         ON likp&lt;SUB&gt;vbeln = lips&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         INNER JOIN vbfa&lt;/P&gt;&lt;P&gt;         ON lips&lt;SUB&gt;vbeln = vbfa&lt;/SUB&gt;vbelv&lt;/P&gt;&lt;P&gt;         INNER JOIN vbpa&lt;/P&gt;&lt;P&gt;         ON vbfa&lt;SUB&gt;vbelv = vbpa&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         INNER JOIN ltak&lt;/P&gt;&lt;P&gt;         ON ltak&lt;SUB&gt;tanum = vbfa&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;         INTO TABLE gt_deliveries&lt;/P&gt;&lt;P&gt;         WHERE vbuk~lvstk = 'B'&lt;/P&gt;&lt;P&gt;         AND   vbuk~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;         AND   likp~vstel IN s_vstel&lt;/P&gt;&lt;P&gt;         AND   lips~lgort IN s_lgort&lt;/P&gt;&lt;P&gt;         AND   vbpa~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;         AND   ltak~bdatu IN s_bdatu&lt;/P&gt;&lt;P&gt;         AND   vbpa~parvw = '1C'&lt;/P&gt;&lt;P&gt;         AND   vbfa~posnn = '1'&lt;/P&gt;&lt;P&gt;         AND   vbfa~vbtyp_n = 'Q'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BrightSide on Mar 17, 2009 4:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 16:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282267#M1219052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T16:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282268#M1219053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what means "unsuccessful" in this context?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 16:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282268#M1219053</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-17T16:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282269#M1219054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbuk~vbeln
likp~vstel
likp~kunag
likp~wadat
likp~erdat
lips~lgort
lips~posnr
lips~matkl
vbfa~vbeln
vbpa~kunnr
ltak~bdatu
FROM ( vbuk
INNER JOIN likp
ON vbuk~vbeln = likp~vbeln
INNER JOIN lips
ON likp~vbeln = lips~vbeln
INNER JOIN vbfa
ON lips~vbeln = vbfa~vbelv
INNER JOIN vbpa
ON vbfa~vbelv = vbpa~vbeln
INNER JOIN ltak
ON ltak~tanum = vbfa~vbeln )
INTO TABLE gt_deliveries
WHERE vbuk~lvstk = 'B'
AND vbuk~vbeln IN s_vbeln
AND likp~vstel IN s_vstel
AND lips~lgort IN s_lgort
AND vbpa~kunnr IN s_kunnr
AND ltak~bdatu IN s_bdatu
AND vbpa~parvw = '1C'
AND vbfa~posnn = '1'
AND vbfa~vbtyp_n = 'Q'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you select there are five joins which will degrade performance (I.e Timeout and Dump)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Try to create secondary index at the database levels.&lt;/P&gt;&lt;P&gt;2) Split it into two of three Select statements and later on merger into internal table.&lt;/P&gt;&lt;P&gt;3) Create Database View for all the tables and fields you require in the select query( As views are Buffered Load on the database would be reduced).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Check matching records are there in Production system.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;get some test data from Production system and check the avaiablility.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 16:47:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282269#M1219054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T16:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282270#M1219055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it means sy-subrc ne  0. when it should be '0' for the delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BrightSide on Mar 17, 2009 4:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 16:48:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282270#M1219055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T16:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282271#M1219056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BrightSide,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Will it be possible to keep it simple, may be smaller Joins &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2) If the Joins are written correctly then there must not be data in system which matched the selecion criteria, Pls try to execute JOIN manually, I mean perorm the same steps in SE16.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure to what extend it will cause Porformance Issue but its certainly a code complexity issue for developer. Pls go for simplfication if applcation is not Performance critical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shital&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 18:15:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282271#M1219056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T18:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282272#M1219057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well, ive tried it manually and its fine , In production this is not getting no data back when it should be  and  got performance  issue  aswell...I wonder why when its all fine in development ..why it is so bad in production? &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BrightSide on Mar 17, 2009 8:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 20:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282272#M1219057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T20:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282273#M1219058</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;Production server holds the real time data which are 100 times more than what we have in development system and they are more secured in terms of time ...&lt;/P&gt;&lt;P&gt;so due to this if its taking more of time to retrieve the data from the database it might go for timeout error...&lt;/P&gt;&lt;P&gt;so the best way to code would be splitting up all the five joins into five different select queries and then merging the required data in one single internal table which will increase the performance as well and also will get you the proper data you require....&lt;/P&gt;&lt;P&gt;Hope you get what I meant....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 21:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282273#M1219058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T21:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282274#M1219059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brightside,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder could it be happen....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;( vbuk&lt;/P&gt;&lt;P&gt;INNER JOIN likp&lt;/P&gt;&lt;P&gt;ON vbuk&lt;SUB&gt;vbeln = likp&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a piece of your code,,,, I think that Likp&lt;SUB&gt;vbeln is not equal as Vbuk&lt;/SUB&gt;vbeln...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and when you want to join these both VBUK's and LIKP and VBFA.... with such a huge 5 join conditions, it will be a big problem in production after 2 years, As I am a direct witness of this, and My role and resposibility is now the same, to make performance better,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My client has a huge database,, you really dont trust if I say that.... When I enter LIKP&lt;SUB&gt;VBELN in VBFA&lt;/SUB&gt;VBELV..... In SE11,,,, and I always going to short dump due to request Timed out... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since data base is 40 Million Records... for each table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worst com worst,,, we need to use Some more matching fields for retriving the data...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a Piece of code How to use LIKP, LIPS &amp;amp; VBUK, VBEP, VBPA without help of VBFA....! &lt;/P&gt;&lt;P&gt;Also it contaings Secondary indexes,,,!&lt;/P&gt;&lt;P&gt;&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 A&lt;SUB&gt;VBELN A&lt;/SUB&gt;POSNR A&lt;SUB&gt;VSTEL B&lt;/SUB&gt;BMENG  D~LAND1 INTO&lt;/P&gt;&lt;P&gt;  (VBELN, POSNR, SPOINTL , LFOI1 , SOCONTL)&lt;/P&gt;&lt;P&gt;  FROM VBAP AS A&lt;/P&gt;&lt;P&gt;  INNER JOIN VBEP AS B&lt;/P&gt;&lt;P&gt;  ON A&lt;SUB&gt;VBELN = B&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;  AND A&lt;SUB&gt;POSNR = B&lt;/SUB&gt;POSNR&lt;/P&gt;&lt;P&gt;  INNER JOIN VBPA AS D&lt;/P&gt;&lt;P&gt;  ON A&lt;SUB&gt;VBELN = D&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;  INNER JOIN VBUP AS U&lt;/P&gt;&lt;P&gt;  ON A&lt;SUB&gt;VBELN = U&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;  AND A&lt;SUB&gt;POSNR = U&lt;/SUB&gt;POSNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  INNER JOIN VBUP&lt;/P&gt;&lt;P&gt;  ON VBUP&lt;SUB&gt;VBELN = A&lt;/SUB&gt;VBELN AND&lt;/P&gt;&lt;P&gt;     VBUP&lt;SUB&gt;POSNR = A&lt;/SUB&gt;POSNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  INNER JOIN LIPS&lt;/P&gt;&lt;P&gt;    ON LIPS&lt;SUB&gt;VGBEL = A&lt;/SUB&gt;VBELN AND&lt;/P&gt;&lt;P&gt;       LIPS&lt;SUB&gt;VGPOS = A&lt;/SUB&gt;POSNR&lt;/P&gt;&lt;P&gt;  INNER JOIN LIKP&lt;/P&gt;&lt;P&gt;    ON LIKP&lt;SUB&gt;VBELN = LIPS&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHERE A~MATNR = P_MATNR&lt;/P&gt;&lt;P&gt;  AND  LIKP~LDDAT = P_ITAB9_DATE&lt;/P&gt;&lt;P&gt;  AND D~PARVW = 'WE' &lt;/P&gt;&lt;P&gt;  AND  ( A&lt;SUB&gt;VSTEL = 'M9RT' OR A&lt;/SUB&gt;VSTEL = 'M9IT' OR A&lt;SUB&gt;VSTEL = 'M9FC' OR A&lt;/SUB&gt;VSTEL = 'M9IC' )&lt;/P&gt;&lt;P&gt;  AND  A~ABGRU = SPACE&lt;/P&gt;&lt;P&gt;  AND VBUP~LFSTA &amp;lt;&amp;gt; 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I Suggest you is Before transfering to PRD itself try to make a best performance statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it should solve some part of your Issue...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Dileep .C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 02:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282274#M1219059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T02:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282275#M1219060</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;I have given sample query.First two tables you can use joins.Later with joins and for all entries &lt;/P&gt;&lt;P&gt;you can link other tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; SELECT * FROM MSEG AS A INNER JOIN MKPF AS B ON A~MBLNR EQ B~MBLNR
AND A~MJAHR EQ B~MJAHR INTO CORRESPONDING FIELDS OF TABLE IT_MSEG 
FOR ALL ENTRIES IN IT_FINAL WHERE A~MATNR EQ IT_FINAL-matnr and a~ebeln eq it_final-ebeln
AND A~LIFNR EQ IT_FINAL-LIFNR AND A~WERKS EQ IT_FINAL-WERKS
AND A~BWART IN ('542') AND A~SHKZG EQ 'S' AND B~BUDAT IN S_BUDAT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance you can avoid *.Please check performance of this query also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bathri..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 03:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282275#M1219060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T03:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282276#M1219061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it means sy-subrc ne 0. when it should be '0' for the delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is an effect of the data available not of the statement!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;funny layout, did not know ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 11:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282276#M1219061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T11:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282277#M1219062</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;Consider to analyse what was sent to database on production (using ST05) and HOW the users are using your SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see "problem" in performance if of of your parameters are filled and, of course S_VBELN have less than 100 equal values. BUUUUUTTTTT you are not in control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you not take control of this parameters / ranges look what can reach the database (user filled no parameter):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE vbuk~lvstk = 'B'  "user filled no parameter result in a select everything
  AND vbpa~parvw = '1C' " the restrictions on Open SQL disappear on Native SQL
  AND vbfa~posnn = '1'
  AND vbfa~vbtyp_n = 'Q'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can't guarantee this, if better to divide the access using a business strategy for that.&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;Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 14:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282277#M1219062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T14:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement in production</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282278#M1219063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something wrong  with data in development system so couldnt figure that out in development, Anywayz I cant use that joins nomore coz the data in production is different.&lt;/P&gt;&lt;P&gt;Thanks  you lot for Replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BrightSide on Mar 18, 2009 3:34 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BrightSide on Mar 18, 2009 3:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 15:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement-in-production/m-p/5282278#M1219063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T15:34:18Z</dc:date>
    </item>
  </channel>
</rss>

