<?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: Need help for performance tuning select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748698#M1459733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select on CDPOS looks very fishy to me. Your WHERE clause only has CHANGENR and FNAME, and since CDPOS is a cluster table (i.e. no indexes apart from the primary), this will trigger a full serial scan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might try this one, specifying at least the full primary key from the CDHDR record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM cdhdr
  WHERE objectclas = 'DEBI' 
    AND udate = sy-datum
    AND ( tcode = 'VD02' or tcode = 'XD02' ).

 IF sy-subrc = 0.
    SELECT SINGLE * FROM cdpos INTO wa_cdpos WHERE
                     objectclas = cdhdr-objectclas AND
                     objectid = cdhdr-objectid AND
                     changenr = cdhdr-changenr AND 
                     ( fname = 'AUFSD' OR fname = 'LIFSD' or fname = 'FAKSD' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code you comes from inside a SELECT loop. It might be better to collect the CDHDR records in an internal table and then use FOR ALL ENTRIES in the CDPOS select (or use a join). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Apr 2010 14:13:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-14T14:13:04Z</dc:date>
    <item>
      <title>Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748695#M1459730</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;can anybody check the coding how to speed up the performance ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bottleneck seems to ne in the selection from cdpos and cdhdr,&lt;/P&gt;&lt;P&gt;but this are large tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM cdhdr WHERE objectclas = 'DEBI'  AND tcode = 'VD02' AND udate = sy-datum&lt;/P&gt;&lt;P&gt;                    OR objectclas = 'DEBI'  AND tcode = 'XD02' AND udate = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    changenr = cdhdr-changenr.&lt;/P&gt;&lt;P&gt;    objectid = cdhdr-objectid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE * FROM cdpos INTO wa_cdpos WHERE changenr = changenr AND fname = 'AUFSD'&lt;/P&gt;&lt;P&gt;                      OR changenr = changenr AND fname = 'LIFSD'&lt;/P&gt;&lt;P&gt;                      OR changenr = changenr AND fname = 'FAKSD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '01' OR&lt;/P&gt;&lt;P&gt;       wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR&lt;/P&gt;&lt;P&gt;       wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '02' OR&lt;/P&gt;&lt;P&gt;       wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '03' OR&lt;/P&gt;&lt;P&gt;       wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR&lt;/P&gt;&lt;P&gt;       wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'SL'.&lt;/P&gt;&lt;P&gt;      APPEND wa_cdpos TO it_cdpos.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      objectid = cdpos-objectid.&lt;/P&gt;&lt;P&gt;      fname = cdpos-fname.&lt;/P&gt;&lt;P&gt;      chngind = cdpos-chngind.&lt;/P&gt;&lt;P&gt;      value_new = cdpos-value_new.&lt;/P&gt;&lt;P&gt;      value_old = cdpos-value_old.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      kundennummer = cdpos-objectid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     PERFORM email.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&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;BR Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 09:20:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748695#M1459730</guid>
      <dc:creator>gerd_hotz</dc:creator>
      <dc:date>2010-04-14T09:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748696#M1459731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be careful with the AND and OR conditions without using brackets. I suggest you surround the AND conditions with brackets to be on the safe side and avoid unexpected results caused by "implicit bracketing".&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABENLOGEXP_BOOLE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABENLOGEXP_BOOLE.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 09:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748696#M1459731</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-04-14T09:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748697#M1459732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the Standard function modules for extracting Change History.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_HEADERS&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_POSITIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 11:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748697#M1459732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-14T11:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748698#M1459733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select on CDPOS looks very fishy to me. Your WHERE clause only has CHANGENR and FNAME, and since CDPOS is a cluster table (i.e. no indexes apart from the primary), this will trigger a full serial scan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might try this one, specifying at least the full primary key from the CDHDR record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM cdhdr
  WHERE objectclas = 'DEBI' 
    AND udate = sy-datum
    AND ( tcode = 'VD02' or tcode = 'XD02' ).

 IF sy-subrc = 0.
    SELECT SINGLE * FROM cdpos INTO wa_cdpos WHERE
                     objectclas = cdhdr-objectclas AND
                     objectid = cdhdr-objectid AND
                     changenr = cdhdr-changenr AND 
                     ( fname = 'AUFSD' OR fname = 'LIFSD' or fname = 'FAKSD' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code you comes from inside a SELECT loop. It might be better to collect the CDHDR records in an internal table and then use FOR ALL ENTRIES in the CDPOS select (or use a join). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 14:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748698#M1459733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-14T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748699#M1459734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if there are standard interfaces then try to use them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should always try to write a complete WHERE-clause, and of course try to be simple&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '01' OR
wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR
wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '02' OR
wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = '03' OR
wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR
wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'SL'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the same as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AND cdpos-chngind = 'U' 
AND cdpos-value_new  IN ( '01' , '02', '03', 'VK', 'SL' )
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, that lines 2 and 5 are identical !!&lt;/P&gt;&lt;P&gt;wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR&lt;/P&gt;&lt;P&gt;wa_cdpos-chngind = 'U' AND wa_cdpos-value_new = 'VK' OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to convert the SELECT - SELECT SINGLE - ENDSELECT into a Join!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ich hätte auch eine Literaturempfehlung in Deutsch:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.dpunkt.de/buecher/3096.html" target="test_blank"&gt;http://www.dpunkt.de/buecher/3096.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 15:53:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748699#M1459734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-14T15:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748700#M1459735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My preference when accessing change history (or any other set of very large tables) is to try to make my select queries using the key fields and then process the output seperately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CDHDR contains a lot of entries and trying to access the TCODE and UDATE fields within the select query is slow. Similarly, the CDPOS table is also large and slow to search on fields other than the key ones. Instead try the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  lt_cdhdr type standard table of cdhdr with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols:&lt;/P&gt;&lt;P&gt;  &amp;lt;cdhdr&amp;gt; type cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;* get relevant CDHDR entries&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;  from cdhdr&lt;/P&gt;&lt;P&gt;  into lt_cdhdr&lt;/P&gt;&lt;P&gt;  where OBJECTCLAS = 'DEBI'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;* clean up extracted header lines&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;delete lt_cdhdr where udate &amp;lt;&amp;gt; sy-datum.&lt;/P&gt;&lt;P&gt;delete it_cdhdr where tcode &amp;lt;&amp;gt; 'VD02' and tcode &amp;lt;&amp;gt; 'XD02'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this leaves justthe header lines you want.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;* loop through headers and get associated details.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;loop at lt_cdhdr assigning &amp;lt;cdhdr&amp;gt;.&lt;/P&gt;&lt;P&gt;  select *&lt;/P&gt;&lt;P&gt;    from cdpos&lt;/P&gt;&lt;P&gt;    where objectclas = &amp;lt;cdhdr&amp;gt;-objectclas&lt;/P&gt;&lt;P&gt;         and objectid = &amp;lt;cdhdr&amp;gt;-objectid&lt;/P&gt;&lt;P&gt;         and changenr = &amp;lt;cdhdr&amp;gt;-changenr&lt;/P&gt;&lt;P&gt;         and fname in ('AUFSD','LIFSD','FAKSD').&lt;/P&gt;&lt;P&gt;    if cdpos-chngind = 'U' and cdpos-value_new in ( '01','02','03','SL','VK' ).&lt;/P&gt;&lt;P&gt;       &lt;STRONG&gt;PERFORM REQUIRED TASKS FOR SENDING EMAIL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;*      you wanted to select a single CDPOS per change header so now end this loop pass.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;       continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tested this particular section of code but it should work a lot quicker than what you had. I applied the same approach to a change history report on purchase orders and it ran a lot quicker than any other code I found on the web.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 11:58:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748700#M1459735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-15T11:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748701#M1459736</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;&lt;/P&gt;&lt;P&gt;the line&lt;/P&gt;&lt;P&gt;if cdpos-chngind = 'U' and cdpos-value_new in ( '01','02','03','SL','VK' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;always returns error: Comma without preceding colon (after IF ?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Has anaybody a working code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 12:52:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748701#M1459736</guid>
      <dc:creator>gerd_hotz</dc:creator>
      <dc:date>2010-04-15T12:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748702#M1459737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the following will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if cdpos-chngind = 'U' &lt;/P&gt;&lt;P&gt;         and ( cdpos-value_new =  '01' &lt;/P&gt;&lt;P&gt;              or cdpos-value_new =  '02' &lt;/P&gt;&lt;P&gt;              or cdpos-value_new =  '03' &lt;/P&gt;&lt;P&gt;              or cdpos-value_new =  'SL' &lt;/P&gt;&lt;P&gt;              or cdpos-value_new =  '01' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "IN" statement does work in select queries and I thought it also worked in "IF" statements but without testing in a program I can't  say for certain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 13:06:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748702#M1459737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-15T13:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748703#M1459738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; if cdpos-chngind = 'U' and cdpos-value_new in ( '01','02','03','SL','VK' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is no ABAP, I wrote AND and it should be added to the WHERE-condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 16:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748703#M1459738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-15T16:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748704#M1459739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my summary so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) use full primary key when selecting from CDPOS&lt;/P&gt;&lt;P&gt;2) make sure the WHERE-conditions are properly structured and work as expected&lt;/P&gt;&lt;P&gt;3) read Siegfried's book&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know how you are doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 16:21:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748704#M1459739</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-04-15T16:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for performance tuning select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748705#M1459740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated my coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM cdhdr WHERE objectclas = 'DEBI'  AND&lt;/P&gt;&lt;P&gt;                          tcode IN ('VD02' , 'XD02'  , 'VD03' , 'XD03') AND&lt;/P&gt;&lt;P&gt;                          udate = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    changenr = cdhdr-changenr.&lt;/P&gt;&lt;P&gt;    objectid = cdhdr-objectid.&lt;/P&gt;&lt;P&gt;    username = cdhdr-username.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE * FROM cdpos INTO wa_cdpos WHERE changenr = changenr AND&lt;/P&gt;&lt;P&gt;                                                   tabname = 'KNA1' AND&lt;/P&gt;&lt;P&gt;                                                   objectclas = 'DEBI' AND&lt;/P&gt;&lt;P&gt;                                                   chngind = 'U' AND&lt;/P&gt;&lt;P&gt;                                                   fname IN ('AUFSD' , 'LIFSD' , 'FAKSD' ) AND&lt;/P&gt;&lt;P&gt;                                                   value_new IN ('01' , 'VK' , '02' , '03' , 'SL' ).&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;and now its running fast !&lt;/P&gt;&lt;P&gt;Maybe with a join - selection it could be better, but its okay now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for help !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Apr 2010 08:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-performance-tuning-select-statement/m-p/6748705#M1459740</guid>
      <dc:creator>gerd_hotz</dc:creator>
      <dc:date>2010-04-16T08:55:12Z</dc:date>
    </item>
  </channel>
</rss>

