<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138349#M113845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it can be simplified: performance may suffer if field1 and field2 are not indexes on the tables.&lt;/P&gt;&lt;P&gt;.............&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;FROM ZTABLE INTO TABLE I_TAB1&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = 01&lt;/P&gt;&lt;P&gt;AND FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD3 &lt;/P&gt;&lt;P&gt;FROM DFKKCR INTO TABLE I_TAB2&lt;/P&gt;&lt;P&gt;for all entries in i_tab1&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = 'TEXT'.&lt;/P&gt;&lt;P&gt;AND FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;AND FIELD3 = I_TAB1-FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DPAYH select is redundant since all it will retrun is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;a table of entries with field1 = 'TEXT' and field2 = 'P'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*SELECT FIELD1 FIELD2 &lt;/P&gt;&lt;P&gt;*FROM DPAYH INTO TABLE I_TAB3&lt;/P&gt;&lt;P&gt;*WHERE FIELD1 = I_TAB2-FIELD1&lt;/P&gt;&lt;P&gt;*AND FIELD2 = I_TAB2-FIELD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DPAYP select also redundant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*SELECT FIELD1 FIELD2&lt;/P&gt;&lt;P&gt;*FROM DPAYP INTO TABLE I_TAB4&lt;/P&gt;&lt;P&gt;*WHERE FIELD1 = I_TAB3-FIELD1&lt;/P&gt;&lt;P&gt;*AND FIELD2 = I_TAB3-FIELD2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jan 2006 01:07:20 GMT</pubDate>
    <dc:creator>former_member186741</dc:creator>
    <dc:date>2006-01-13T01:07:20Z</dc:date>
    <item>
      <title>Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138345#M113841</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 am retrieving data from three tables using several loops .All the three tables contains &lt;/P&gt;&lt;P&gt;millions of records. Is there anyway to rewrite this logic so that I can increase the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;    FROM ZTABLE INTO TABLE I_TAB1&lt;/P&gt;&lt;P&gt;    WHERE FIELD1 = 01&lt;/P&gt;&lt;P&gt;    AND   FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT I_TAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;        FROM DFKKCR INTO TABLE I_TAB2&lt;/P&gt;&lt;P&gt;        WHERE FIELD1 = 'TEXT'.&lt;/P&gt;&lt;P&gt;        AND   FIELD2 = I_TAB1-FIELD2&lt;/P&gt;&lt;P&gt;        AND   FIELD3 = I_TAB1-FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          LOOP AT I_TAB2.&lt;/P&gt;&lt;P&gt;          SELECT FIELD1 FIELD2 &lt;/P&gt;&lt;P&gt;          FROM DPAYH INTO TABLE I_TAB3&lt;/P&gt;&lt;P&gt;          WHERE  FIELD1 = I_TAB2-FIELD1&lt;/P&gt;&lt;P&gt;          AND    FIELD2 = I_TAB2-FIELD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             LOOP AT I_TAB3.&lt;/P&gt;&lt;P&gt;             SELECT FIELD1 FIELD2&lt;/P&gt;&lt;P&gt;             FROM DPAYP INTO TABLE I_TAB4&lt;/P&gt;&lt;P&gt;             WHERE  FIELD1 = I_TAB3-FIELD1&lt;/P&gt;&lt;P&gt;             AND    FIELD2 = I_TAB3-FIELD2.&lt;/P&gt;&lt;P&gt;             ENDLOOP.&lt;/P&gt;&lt;P&gt;          ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2006 00:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138345#M113841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-13T00:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138346#M113842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try using the FOR ALL ENTRIES extension of the SELECT statement.&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 Jan 2006 00:37:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138346#M113842</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-01-13T00:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138347#M113843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;FROM ZTABLE INTO TABLE I_TAB1&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = 01&lt;/P&gt;&lt;P&gt;AND FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;FROM DFKKCR INTO TABLE I_TAB2&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN I_TAB1&lt;/P&gt;&lt;P&gt;WHERE FIELD2 = I_TAB1-FIELD2 AND&lt;/P&gt;&lt;P&gt;      FIELD3 = I_TAB1-FIELD3 AND&lt;/P&gt;&lt;P&gt;      FIELD1 = 'TEXT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2 &lt;/P&gt;&lt;P&gt;FROM DPAYH INTO TABLE I_TAB3&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN I_TAB2&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = I_TAB2-FIELD1&lt;/P&gt;&lt;P&gt;AND FIELD2 = I_TAB2-FIELD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2&lt;/P&gt;&lt;P&gt;FROM DPAYP INTO TABLE I_TAB4&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN I_TAB3&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = I_TAB3-FIELD1&lt;/P&gt;&lt;P&gt;AND FIELD2 = I_TAB3-FIELD2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2006 00:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138347#M113843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-13T00:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138348#M113844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;



select field1 field2 field3
          from ztable into table i_tab1
               where field1 = 01
                 and field2 = 'P'.

&amp;lt;b&amp;gt;check not i_tab1[] is initial.&amp;lt;/b&amp;gt;
select field1 field2 field3
         from dfkkcr into table i_tab2
            for all entries in itab1
              where field2 = i_tab1-field2
                and field3 = i_tab1-field3
                and field1 = 'TEXT'.

&amp;lt;b&amp;gt;check not i_tab2[] is initial.&amp;lt;/b&amp;gt;
select field1 field2
           from dpayh into table i_tab3
               for all entries in i_itab2
              where field1 = i_tab2-field1
                and field2 = i_tab2-field2.

&amp;lt;b&amp;gt;check not i_tab3[] is initial.&amp;lt;/b&amp;gt;
select field1 field2
       from dpayp into table i_tab4
          for all entries in i_itab3
           where field1 = i_tab3-field1
             and field2 = i_tab3-field2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that you check that the previous internal table has data.&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 Jan 2006 00:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138348#M113844</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-01-13T00:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138349#M113845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it can be simplified: performance may suffer if field1 and field2 are not indexes on the tables.&lt;/P&gt;&lt;P&gt;.............&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2 FIELD3 &lt;/P&gt;&lt;P&gt;FROM ZTABLE INTO TABLE I_TAB1&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = 01&lt;/P&gt;&lt;P&gt;AND FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD3 &lt;/P&gt;&lt;P&gt;FROM DFKKCR INTO TABLE I_TAB2&lt;/P&gt;&lt;P&gt;for all entries in i_tab1&lt;/P&gt;&lt;P&gt;WHERE FIELD1 = 'TEXT'.&lt;/P&gt;&lt;P&gt;AND FIELD2 = 'P'&lt;/P&gt;&lt;P&gt;AND FIELD3 = I_TAB1-FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DPAYH select is redundant since all it will retrun is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;a table of entries with field1 = 'TEXT' and field2 = 'P'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*SELECT FIELD1 FIELD2 &lt;/P&gt;&lt;P&gt;*FROM DPAYH INTO TABLE I_TAB3&lt;/P&gt;&lt;P&gt;*WHERE FIELD1 = I_TAB2-FIELD1&lt;/P&gt;&lt;P&gt;*AND FIELD2 = I_TAB2-FIELD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DPAYP select also redundant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*SELECT FIELD1 FIELD2&lt;/P&gt;&lt;P&gt;*FROM DPAYP INTO TABLE I_TAB4&lt;/P&gt;&lt;P&gt;*WHERE FIELD1 = I_TAB3-FIELD1&lt;/P&gt;&lt;P&gt;*AND FIELD2 = I_TAB3-FIELD2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2006 01:07:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138349#M113845</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-01-13T01:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138350#M113846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Friends. I did use some of your logic.&lt;/P&gt;&lt;P&gt;I am closing this thread and awarding the points.&lt;/P&gt;&lt;P&gt;Thanks for everyone for sharing the ideas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2006 19:19:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/1138350#M113846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-19T19:19:02Z</dc:date>
    </item>
  </channel>
</rss>

