<?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: optimising the below code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477166#M1060202</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;Following points you can consider while performance tuning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Remove SELECT ... ENDSELECT.&lt;/P&gt;&lt;P&gt;2. Remove ORDER BY from SELECT query. Instead use SORT after SELECT query.&lt;/P&gt;&lt;P&gt;3. For dependent data use SELECT query with FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;4. Use combination of LOOP and READ statements.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your code, these points are sufficient for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kunjal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2008 10:40:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-12T10:40:31Z</dc:date>
    <item>
      <title>optimising the below code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477163#M1060199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; How to optimise this code as it giving performance problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ZZFIELDS WHERE SAP_OBJECT = ZZTOA-SAP_OBJECT AND&lt;/P&gt;&lt;P&gt;                                 AR_OBJECT  = ZZTOA-AR_OBJECT&lt;/P&gt;&lt;P&gt;                           ORDER BY FID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      HITCOUNT = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF DEBUG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;        ULINE.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Verarbeitung ist unterschiedlich, je nachdem ob die Daten aus&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    einer ArchiveLink Tabelle kommen, aus der Anwendungstabelle oder&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    einer Subtabelle&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CASE ZZFIELDS-SUBTAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Daten stammen aus der ArchiveLink Tabelle (z.B. toa01)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        WHEN 'ARCHLINK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF DEBUG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;            WRITE: / ZZFIELDS-FID, 'Suche nach Feld'(014),&lt;/P&gt;&lt;P&gt;                     ZZFIELDS-FNAME COLOR COL_TOTAL,&lt;/P&gt;&lt;P&gt;                     'in Tabelle'(015), ZZTOA-TABNAME COLOR COL_TOTAL.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CONCATENATE 'ZZTOA-' ZZFIELDS-FNAME INTO TEMPSTRING.&lt;/P&gt;&lt;P&gt;          FIELD-SYMBOLS  TO BUFFER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          PERFORM INSERT_DATA USING 'ARCHLINK'&lt;/P&gt;&lt;P&gt;                                    BUFFER&lt;/P&gt;&lt;P&gt;                                    BUFFER&lt;/P&gt;&lt;P&gt;                                    '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Daten stammen direkt aus der Anwendungstabelle&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        WHEN ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF DEBUG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;            WRITE: / ZZFIELDS-FID, 'Suche nach Feld'(014),&lt;/P&gt;&lt;P&gt;                     ZZFIELDS-FNAME COLOR COL_TOTAL,&lt;/P&gt;&lt;P&gt;                     'in Tabelle'(015), SAP_TABELLE COLOR COL_TOTAL.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Daten holen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          PERFORM GET_DATA TABLES   QUERYTAB&lt;/P&gt;&lt;P&gt;                           USING    SAP_TABELLE&lt;/P&gt;&lt;P&gt;                                    ZZFIELDS-FNAME&lt;/P&gt;&lt;P&gt;                           CHANGING RC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Fehler, wenn kein Eintrag gefunden&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          IF RC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;            IF SY-BATCH = 'X'.&lt;/P&gt;&lt;P&gt;              MESSAGE I020&lt;/P&gt;&lt;P&gt;                      WITH ZZTOA-OBJECT_ID.&lt;/P&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;P&gt;              FORMAT COLOR COL_NEGATIVE.&lt;/P&gt;&lt;P&gt;              WRITE: / 'Das Objekt '(016), ZZTOA-OBJECT_ID,&lt;/P&gt;&lt;P&gt;                   'wurde nicht in der Datenbanktabelle gefunden'(017).&lt;/P&gt;&lt;P&gt;              FORMAT COLOR OFF.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;            ERROR = 3.&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Daten stammen aus einer Subtabelle&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        WHEN OTHERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF DEBUG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;            WRITE: / ZZFIELDS-FID, 'Suche nach Feld'(014),&lt;/P&gt;&lt;P&gt;                     ZZFIELDS-FNAME COLOR COL_TOTAL,&lt;/P&gt;&lt;P&gt;                    'in Tabelle'(015), ZZFIELDS-SUBTAB COLOR COL_TOTAL.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Querystring für Zugriff auf Subtabelle zusammensetzen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          PERFORM GET_QUERY_SUBTAB TABLES   QUERYTAB2&lt;/P&gt;&lt;P&gt;                                   CHANGING RC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Wenn die Where-Bedingung erfolgreich zusammengesetzt wurde,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        koennen wir die Werte holen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          IF RC = 0.&lt;/P&gt;&lt;P&gt;            PERFORM GET_DATA TABLES   QUERYTAB2&lt;/P&gt;&lt;P&gt;                             USING    ZZFIELDS-SUBTAB&lt;/P&gt;&lt;P&gt;                                      ZZFIELDS-FNAME&lt;/P&gt;&lt;P&gt;                             CHANGING RC.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Wenn in der Subtabelle nichts gefunden wurde, oder nicht&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        auf die Subtabelle zugegriffen werden kann, können wir&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        entweder stoppen oder weitermachen (mit leerem Feld)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          IF RC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;            IF FORCE_SUB = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              IF DEBUG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;                WRITE: / ZZFIELDS-FID,&lt;/P&gt;&lt;P&gt;                         'Es wurden keine Werte gefunden'(018).&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              PERFORM INSERT_DATA USING ZZFIELDS-SUBTAB&lt;/P&gt;&lt;P&gt;                                        ''&lt;/P&gt;&lt;P&gt;                                        ''&lt;/P&gt;&lt;P&gt;                                        '1'.&lt;/P&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              IF SY-BATCH = 'X'.&lt;/P&gt;&lt;P&gt;                MESSAGE I013 WITH ZZFIELDS-SUBTAB.&lt;/P&gt;&lt;P&gt;              ELSE.&lt;/P&gt;&lt;P&gt;                FORMAT COLOR COL_NEGATIVE.&lt;/P&gt;&lt;P&gt;                WRITE: / 'Für Beleg '(019), ZZTOA-OBJECT_ID,&lt;/P&gt;&lt;P&gt;                      'wurde in der Datenbanktabelle'(020),&lt;/P&gt;&lt;P&gt;                       ZZFIELDS-SUBTAB,&lt;/P&gt;&lt;P&gt;                      'kein passender Eintrag gefunden'(021).&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;              FORMAT COLOR OFF.&lt;/P&gt;&lt;P&gt;              ERROR = 5.&lt;/P&gt;&lt;P&gt;              EXIT.&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;      ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Wenn Fehler gesetzt wurde, können wir abbrechen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      IF ERROR &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDSELECT.    " ZZFIELDS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Babu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 10:01:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477163#M1060199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T10:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: optimising the below code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477164#M1060200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rambabu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 points to mention here :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Select ... Endselect --&amp;gt; Always acts like a loop . &lt;/P&gt;&lt;P&gt;2. In your code you have used Select * .. Instead you can mention the required fields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover , If there is a Sy-Subrc check after the Select statement , the further processing will not happen unnecessarily if the select fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chitra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 10:08:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477164#M1060200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T10:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: optimising the below code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477165#M1060201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without the code of forms GET_DATA, GET_QUERY_SUBTAB and INSERT_DATA we cannot help you &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 10:11:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477165#M1060201</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-09-12T10:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: optimising the below code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477166#M1060202</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;Following points you can consider while performance tuning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Remove SELECT ... ENDSELECT.&lt;/P&gt;&lt;P&gt;2. Remove ORDER BY from SELECT query. Instead use SORT after SELECT query.&lt;/P&gt;&lt;P&gt;3. For dependent data use SELECT query with FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;4. Use combination of LOOP and READ statements.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your code, these points are sufficient for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kunjal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 10:40:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477166#M1060202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T10:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: optimising the below code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477167#M1060203</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;Following points you can consider while performance tuning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Remove SELECT ... ENDSELECT.&lt;/P&gt;&lt;P&gt;2. Remove ORDER BY from SELECT query. Instead use SORT after SELECT query.&lt;/P&gt;&lt;P&gt;3. For dependent data use SELECT query with FOR ALL ENTRIES. Only when the first table has entries, in other case you'll get a dump&lt;/P&gt;&lt;P&gt;4. Use sort tables with index. The reading is more faster&lt;/P&gt;&lt;P&gt;5. The tables must have the minimum size posible. Define your own tables with the fields needed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your code, these points are sufficient for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jorge&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 12:57:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optimising-the-below-code/m-p/4477167#M1060203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T12:57:59Z</dc:date>
    </item>
  </channel>
</rss>

