<?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: Performance issue when querying CDPOS table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-when-querying-cdpos-table/m-p/6325315#M1395184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manjunath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you fine tune the first select query like, you can fetch only the fields you are passing in the second select query instead of fetching all fields using SELECT * , so do like SELECT F1 F2.....into T_CDHDR. This aslo means that  you should define internal table T_CDHDR with the selected fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the load on the second select query is reduced to a certain extent. Also put a condition like if T_CDHDR[] is not initial the n only proceed with SELECT FOR ALL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try converting the data in the T_CDHDR to ranges if possible as I have seen there are some constant values you are passing in the WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please set to resolved if it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhii...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Nov 2009 17:39:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-12T17:39:55Z</dc:date>
    <item>
      <title>Performance issue when querying CDPOS table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-when-querying-cdpos-table/m-p/6325314#M1395183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have written a sample code where in the selection screen i would entering date range,for that range,i need PL changes which have taken place.but if i enter date range for 3-4 months it takes lot of time to execute.Any idea how to overcome the performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTESTM1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: MARA,&lt;/P&gt;&lt;P&gt;        zwcoo_repository.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      T_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_ardate FOR zwcoo_repository-start_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&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 * FROM CDHDR&lt;/P&gt;&lt;P&gt;          INTO TABLE T_CDHDR&lt;/P&gt;&lt;P&gt;          WHERE OBJECTCLAS = 'MATERIAL'&lt;/P&gt;&lt;P&gt;          AND UDATE IN s_ardate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT VALUE_OLD VALUE_NEW&lt;/P&gt;&lt;P&gt;FROM CDPOS INTO TABLE T_CDPOS&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN T_CDHDR&lt;/P&gt;&lt;P&gt;WHERE OBJECTCLAS = 'MATERIAL' AND&lt;/P&gt;&lt;P&gt;OBJECTID = T_CDHDR-OBJECTID AND&lt;/P&gt;&lt;P&gt;CHANGENR = T_CDHDR-CHANGENR AND&lt;/P&gt;&lt;P&gt;TABNAME = 'MARA' AND&lt;/P&gt;&lt;P&gt;FNAME = 'SPART' AND&lt;/P&gt;&lt;P&gt;CHNGIND = 'U'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT T_CDPOS.&lt;/P&gt;&lt;P&gt; WRITE:/ T_CDPOS-OBJECTID.&lt;/P&gt;&lt;P&gt; WRITE:/ T_CDPOS-VALUE_OLD.&lt;/P&gt;&lt;P&gt; WRITE:/ T_CDPOS-VALUE_NEW.&lt;/P&gt;&lt;P&gt; WRITE:/ T_CDHDR-UDATE.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2009 17:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-when-querying-cdpos-table/m-p/6325314#M1395183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-12T17:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue when querying CDPOS table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-when-querying-cdpos-table/m-p/6325315#M1395184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manjunath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you fine tune the first select query like, you can fetch only the fields you are passing in the second select query instead of fetching all fields using SELECT * , so do like SELECT F1 F2.....into T_CDHDR. This aslo means that  you should define internal table T_CDHDR with the selected fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the load on the second select query is reduced to a certain extent. Also put a condition like if T_CDHDR[] is not initial the n only proceed with SELECT FOR ALL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try converting the data in the T_CDHDR to ranges if possible as I have seen there are some constant values you are passing in the WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please set to resolved if it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhii...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2009 17:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-when-querying-cdpos-table/m-p/6325315#M1395184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-12T17:39:55Z</dc:date>
    </item>
  </channel>
</rss>

