<?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 Program is too much time for Execution in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710266#M628258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have made a zreport.&lt;/P&gt;&lt;P&gt;When i m running it, it is taking too much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i do in the coding so that the execution time will decreace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me some idea....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2007 09:46:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-13T09:46:01Z</dc:date>
    <item>
      <title>Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710266#M628258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have made a zreport.&lt;/P&gt;&lt;P&gt;When i m running it, it is taking too much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i do in the coding so that the execution time will decreace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me some idea....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 09:46:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710266#M628258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T09:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710267#M628259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Write better code !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to run SE30/ABAP trace. Get total time, get hitlist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to improve the top 10 in the hit list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710267#M628259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T10:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710268#M628260</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;please post u r code for studying or simply follw this steps....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all entries&lt;/P&gt;&lt;P&gt;The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of  &lt;/P&gt;&lt;P&gt;entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the  &lt;/P&gt;&lt;P&gt;length of the WHERE clause.  &lt;/P&gt;&lt;P&gt;The plus &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Large amount of data  &lt;/P&gt;&lt;P&gt;Mixing processing and reading of data  &lt;/P&gt;&lt;P&gt;Fast internal reprocessing of data  &lt;/P&gt;&lt;P&gt;Fast  &lt;/P&gt;&lt;P&gt;The Minus &lt;/P&gt;&lt;P&gt;Difficult to program/understand  &lt;/P&gt;&lt;P&gt;Memory could be critical (use FREE or PACKAGE size)  &lt;/P&gt;&lt;P&gt;Some steps that might make FOR ALL ENTRIES more efficient: &lt;/P&gt;&lt;P&gt;Removing duplicates from the the driver table  &lt;/P&gt;&lt;P&gt;Sorting the driver table  &lt;/P&gt;&lt;P&gt;If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement: &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_tab &lt;/P&gt;&lt;P&gt;  WHERE mykey &amp;gt;= i_tab-low and &lt;/P&gt;&lt;P&gt;        mykey &amp;lt;= i_tab-high.&lt;/P&gt;&lt;P&gt;Nested selects&lt;/P&gt;&lt;P&gt;The plus: &lt;/P&gt;&lt;P&gt;Small amount of data  &lt;/P&gt;&lt;P&gt;Mixing processing and reading of data  &lt;/P&gt;&lt;P&gt;Easy to code - and understand  &lt;/P&gt;&lt;P&gt;The minus: &lt;/P&gt;&lt;P&gt;Large amount of data  &lt;/P&gt;&lt;P&gt;when mixed processing isn&amp;#146;t needed  &lt;/P&gt;&lt;P&gt;Performance killer no. 1 &lt;/P&gt;&lt;P&gt;Select using JOINS&lt;/P&gt;&lt;P&gt;The plus &lt;/P&gt;&lt;P&gt;Very large amount of data  &lt;/P&gt;&lt;P&gt;Similar to Nested selects - when the accesses are planned by the programmer  &lt;/P&gt;&lt;P&gt;In some cases the fastest  &lt;/P&gt;&lt;P&gt;Not so memory critical  &lt;/P&gt;&lt;P&gt;The minus &lt;/P&gt;&lt;P&gt;Very difficult to program/understand  &lt;/P&gt;&lt;P&gt;Mixing processing and reading of data not possible  &lt;/P&gt;&lt;P&gt;Use the selection criteria &lt;/P&gt;&lt;P&gt;SELECT * FROM SBOOK.                    &lt;/P&gt;&lt;P&gt;  CHECK: SBOOK-CARRID = 'LH' AND        &lt;/P&gt;&lt;P&gt;                  SBOOK-CONNID = '0400'.         &lt;/P&gt;&lt;P&gt;ENDSELECT.                              &lt;/P&gt;&lt;P&gt;SELECT * FROM SBOOK                      &lt;/P&gt;&lt;P&gt;  WHERE CARRID = 'LH' AND                &lt;/P&gt;&lt;P&gt;        CONNID = '0400'.                 &lt;/P&gt;&lt;P&gt;ENDSELECT.                               &lt;/P&gt;&lt;P&gt;Use the aggregated functions &lt;/P&gt;&lt;P&gt;C4A = '000'.               &lt;/P&gt;&lt;P&gt;SELECT * FROM T100         &lt;/P&gt;&lt;P&gt;  WHERE SPRSL = 'D' AND    &lt;/P&gt;&lt;P&gt;        ARBGB = '00'.      &lt;/P&gt;&lt;P&gt;  CHECK: T100-MSGNR &amp;gt; C4A. &lt;/P&gt;&lt;P&gt;  C4A = T100-MSGNR.        &lt;/P&gt;&lt;P&gt;ENDSELECT.                 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MAX( MSGNR ) FROM T100 INTO C4A  &lt;/P&gt;&lt;P&gt; WHERE SPRSL = 'D' AND                 &lt;/P&gt;&lt;P&gt;       ARBGB = '00'.                   &lt;/P&gt;&lt;P&gt;Select with view&lt;/P&gt;&lt;P&gt;SELECT * FROM DD01L                     &lt;/P&gt;&lt;P&gt;  WHERE DOMNAME LIKE 'CHAR%'            &lt;/P&gt;&lt;P&gt;        AND AS4LOCAL = 'A'.             &lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM DD01T            &lt;/P&gt;&lt;P&gt;    WHERE   DOMNAME    = DD01L-DOMNAME  &lt;/P&gt;&lt;P&gt;        AND AS4LOCAL   = 'A'            &lt;/P&gt;&lt;P&gt;        AND AS4VERS    = DD01L-AS4VERS  &lt;/P&gt;&lt;P&gt;        AND DDLANGUAGE = SY-LANGU.      &lt;/P&gt;&lt;P&gt;ENDSELECT.                              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM DD01V                     &lt;/P&gt;&lt;P&gt; WHERE DOMNAME LIKE 'CHAR%'            &lt;/P&gt;&lt;P&gt;       AND DDLANGUAGE = SY-LANGU.      &lt;/P&gt;&lt;P&gt;ENDSELECT.                              &lt;/P&gt;&lt;P&gt;Select with index support&lt;/P&gt;&lt;P&gt;SELECT * FROM T100             &lt;/P&gt;&lt;P&gt; WHERE     ARBGB = '00'       &lt;/P&gt;&lt;P&gt;       AND MSGNR = '999'.     &lt;/P&gt;&lt;P&gt;ENDSELECT.                     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM T002.              &lt;/P&gt;&lt;P&gt;  SELECT * FROM T100             &lt;/P&gt;&lt;P&gt;    WHERE     SPRSL = T002-SPRAS &lt;/P&gt;&lt;P&gt;          AND ARBGB = '00'       &lt;/P&gt;&lt;P&gt;          AND MSGNR = '999'.     &lt;/P&gt;&lt;P&gt;  ENDSELECT.                     &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;Select &amp;#133; Into table&lt;/P&gt;&lt;P&gt;REFRESH X006.                  &lt;/P&gt;&lt;P&gt;SELECT * FROM T006 INTO X006.  &lt;/P&gt;&lt;P&gt;  APPEND X006.                 &lt;/P&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM T006 INTO TABLE X006.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select with selection list&lt;/P&gt;&lt;P&gt;SELECT * FROM DD01L               &lt;/P&gt;&lt;P&gt;  WHERE DOMNAME LIKE 'CHAR%'      &lt;/P&gt;&lt;P&gt;        AND AS4LOCAL = 'A'.       &lt;/P&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DOMNAME FROM DD01L     &lt;/P&gt;&lt;P&gt; INTO DD01L-DOMNAME          &lt;/P&gt;&lt;P&gt; WHERE DOMNAME LIKE 'CHAR%'  &lt;/P&gt;&lt;P&gt;       AND AS4LOCAL = 'A'.   &lt;/P&gt;&lt;P&gt;ENDSELECT&lt;/P&gt;&lt;P&gt;Key access to multiple lines&lt;/P&gt;&lt;P&gt;LOOP AT TAB.           &lt;/P&gt;&lt;P&gt; CHECK TAB-K = KVAL.  &lt;/P&gt;&lt;P&gt; " ...                &lt;/P&gt;&lt;P&gt;ENDLOOP.               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB WHERE K = KVAL.      &lt;/P&gt;&lt;P&gt;  " ...                          &lt;/P&gt;&lt;P&gt;ENDLOOP.                         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copying internal tables&lt;/P&gt;&lt;P&gt;REFRESH TAB_DEST.               &lt;/P&gt;&lt;P&gt;LOOP AT TAB_SRC INTO TAB_DEST.  &lt;/P&gt;&lt;P&gt;  APPEND TAB_DEST.              &lt;/P&gt;&lt;P&gt;ENDLOOP.                        &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAB_DEST[] = TAB_SRC[].&lt;/P&gt;&lt;P&gt;Modifying a set of lines&lt;/P&gt;&lt;P&gt;LOOP AT TAB.              &lt;/P&gt;&lt;P&gt;  IF TAB-FLAG IS INITIAL. &lt;/P&gt;&lt;P&gt;    TAB-FLAG = 'X'.       &lt;/P&gt;&lt;P&gt;  ENDIF.                  &lt;/P&gt;&lt;P&gt;  MODIFY TAB.             &lt;/P&gt;&lt;P&gt;ENDLOOP.                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAB-FLAG = 'X'.                   &lt;/P&gt;&lt;P&gt;MODIFY TAB TRANSPORTING FLAG      &lt;/P&gt;&lt;P&gt;           WHERE FLAG IS INITIAL. &lt;/P&gt;&lt;P&gt;Deleting a sequence of lines&lt;/P&gt;&lt;P&gt;DO 101 TIMES.                &lt;/P&gt;&lt;P&gt;  DELETE TAB_DEST INDEX 450. &lt;/P&gt;&lt;P&gt;ENDDO.                       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TAB_DEST FROM 450 TO 550.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linear search vs. binary&lt;/P&gt;&lt;P&gt;READ TABLE TAB WITH KEY K = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE TAB WITH KEY K = 'X' BINARY SEARCH.&lt;/P&gt;&lt;P&gt;Comparison of internal tables&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE: TAB1 LINES L1,       &lt;/P&gt;&lt;P&gt;                TAB2 LINES L2.       &lt;/P&gt;&lt;P&gt;                                     &lt;/P&gt;&lt;P&gt;IF L1 &amp;lt;&amp;gt; L2.                         &lt;/P&gt;&lt;P&gt;  TAB_DIFFERENT = 'X'.               &lt;/P&gt;&lt;P&gt;ELSE.                                &lt;/P&gt;&lt;P&gt;  TAB_DIFFERENT = SPACE.             &lt;/P&gt;&lt;P&gt;  LOOP AT TAB1.                      &lt;/P&gt;&lt;P&gt;    READ TABLE TAB2 INDEX SY-TABIX.  &lt;/P&gt;&lt;P&gt;    IF TAB1 &amp;lt;&amp;gt; TAB2.                 &lt;/P&gt;&lt;P&gt;      TAB_DIFFERENT = 'X'. EXIT.     &lt;/P&gt;&lt;P&gt;    ENDIF.                           &lt;/P&gt;&lt;P&gt;  ENDLOOP.                           &lt;/P&gt;&lt;P&gt;ENDIF.                               &lt;/P&gt;&lt;P&gt;                                     &lt;/P&gt;&lt;P&gt;IF TAB_DIFFERENT = SPACE.            &lt;/P&gt;&lt;P&gt;  " ...                              &lt;/P&gt;&lt;P&gt;ENDIF.                               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF TAB1[] = TAB2[].   &lt;/P&gt;&lt;P&gt; " ...               &lt;/P&gt;&lt;P&gt;ENDIF.                &lt;/P&gt;&lt;P&gt;Modify selected components&lt;/P&gt;&lt;P&gt;LOOP AT TAB.            &lt;/P&gt;&lt;P&gt; TAB-DATE = SY-DATUM.  &lt;/P&gt;&lt;P&gt; MODIFY TAB.           &lt;/P&gt;&lt;P&gt;ENDLOOP.                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-DATE = SY-DATUM.                     &lt;/P&gt;&lt;P&gt;LOOP AT TAB.                            &lt;/P&gt;&lt;P&gt; MODIFY TAB FROM WA TRANSPORTING DATE. &lt;/P&gt;&lt;P&gt;ENDLOOP.                                &lt;/P&gt;&lt;P&gt;Appending two internal tables&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SRC.               &lt;/P&gt;&lt;P&gt;  APPEND TAB_SRC TO TAB_DEST.  &lt;/P&gt;&lt;P&gt;ENDLOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND LINES OF TAB_SRC TO TAB_DEST.&lt;/P&gt;&lt;P&gt;Deleting a set of lines&lt;/P&gt;&lt;P&gt;LOOP AT TAB_DEST WHERE K = KVAL.  &lt;/P&gt;&lt;P&gt;  DELETE TAB_DEST.                &lt;/P&gt;&lt;P&gt;ENDLOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TAB_DEST WHERE K = KVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tools available in SAP to pin-point a performance problem&lt;/P&gt;&lt;P&gt;The runtime analysis (SE30)&lt;/P&gt;&lt;P&gt;SQL Trace (ST05)&lt;/P&gt;&lt;P&gt;Tips and Tricks tool &lt;/P&gt;&lt;P&gt;The performance database&lt;/P&gt;&lt;P&gt;Optimizing the load of the database&lt;/P&gt;&lt;P&gt;Using table buffering&lt;/P&gt;&lt;P&gt;Using buffered tables improves the performance considerably. Note that in some cases a stament can not be used with a buffered table, so when using these staments the buffer will be bypassed. These staments are: &lt;/P&gt;&lt;P&gt;Select DISTINCT  &lt;/P&gt;&lt;P&gt;ORDER BY / GROUP BY / HAVING clause  &lt;/P&gt;&lt;P&gt;Any WHERE clasuse that contains a subquery or IS NULL expression  &lt;/P&gt;&lt;P&gt;JOIN s  &lt;/P&gt;&lt;P&gt;A SELECT... FOR UPDATE  &lt;/P&gt;&lt;P&gt;If you wnat to explicitly bypass the bufer, use the BYPASS BUFFER addition to the SELECT clause. &lt;/P&gt;&lt;P&gt;Use the ABAP SORT Clause Instead of ORDER BY&lt;/P&gt;&lt;P&gt;The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The datbase server will usually be the bottleneck, so sometimes it is better to move thje sort from the datsbase server to the application server. &lt;/P&gt;&lt;P&gt;If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT stament to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the datbase server sort it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid ther SELECT DISTINCT Statement&lt;/P&gt;&lt;P&gt;As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplciate rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points to all helpful answers &lt;/P&gt;&lt;P&gt;kiran.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:29:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710268#M628260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T10:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710269#M628261</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 THINK IN UR PROGRAMING UR USEING MANY LOOPS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK DO ONE THING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GOTO SE38 -&amp;gt; OPEN UR PROGRAM -&amp;gt; MENU BAR PROGRAM-&amp;gt; CHECK -&amp;gt; CODE INSPECTOR / EXTENDED PROGRAMING CHECK &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE THIS &lt;/P&gt;&lt;P&gt;IT WILL SHOW ALL THE PERFORMANCE RELATED ERRORS THERE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT WILL SHOW ALL THE ERORS AND WARNING S &lt;/P&gt;&lt;P&gt;IF TRY TO MAKE THESE POINTS AS ZERO THEN UR PROGRAM WILL EXECUTE FINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RERD IF USEFULL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:52:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710269#M628261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T10:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710270#M628262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;fallow my tips these are related to performance maximum of the time performance of the program will depends on the declaration of the &amp;lt;b&amp;gt;internal tables and writing select statements.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;for this use the fallowing tips :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal Tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are considered to be the true work horse of ABAP. They can have a big impact on processing and performance when programmed incorrectly. Use the quick checklist below to help guide you when coding internal table(itab) processing.&lt;/P&gt;&lt;P&gt;Internal Table Quick Checklist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Loop at itab must always use a work area or assign to a field symbol&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use parallel cursor technique for nested loops.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use the TRANSPORTING clause with READ and MODIFY wherever possible to tranport only the fields necessary&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use TRANSPORTING No FIELDS clause when checking only for existence of a record&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read by INDEX is the fastest access option for a single READ. Use standard table if you are accessing mainly by index. Consider this where possible but use caution as it does not apply to all programming situations.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Specify full key on a table read whenever possible. Use &amp;#145;WITH TABLE KEY&amp;#146; clause when full key is specified&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Tables should be passed to FORMS with the "USING" clause.  The "TABLES" clause is considered obsolete. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal tables should be passed to FORMS by Reference for performance reasons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      i.e. do not use USING Value(..)&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do not use Occurs 0 or With Header Line unless it is a SAP function that requires it.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Hashed tables are a good performance approach over standard tables whenever random record accesses are required for a large internal table using the fully qualified key.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;When sorting internal tables, always use "SORT BY Key1...n", never just "SORT" on it's own  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Standard Tables require a Sort by, Delete adjacent Duplicates, and READ itab with KEY...Binary Search&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Keep "SORT itab BY" statement as close as possible to the READ itab with KEY...Binary Search.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Delete Adjacent Duplicates should always be explicit by using the COMPARING clause, even if there is only one field in the itab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Standard Tables should be sorted by sorting keys to take advantage of Binary Search. However, if you sort by one key and Read with a different set, you could miss data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT STATMENTS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; As a programmer it is your job to always PROTECT the database. Avoid extensive DB I/O's and use memory over DB I/O's to process and filter data. Remember, in a SAP system, there is one Database while there can be multiple Application Servers, so be kind to your only Database. Let the application servers do the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following quick check list will help you to keep database performance considerations at the forefront of your coding practices. These suggestions will undoubtedly contribute to better performing programs and overall system performance. Integrating these considerations into your daily routine will directly reflect your technical knowledge as a performance programmer.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SQL Quick Checklist&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select Statements within Loop processing is not recommended. Preferred approach is to select data into an itab and then read the itab to access specific records&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do not use Nested Selects, Selects within Loops. or SELECT...ENDSELECT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do not use Select * unless at least 70% of fields are needed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select only the fields you require.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do not use INTO CORRESPONDING&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do not do Order By on non key fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Force optimizer to use the index where possible&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If primary index can not be used, look for alternate indexes or alternate index tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Avoid Use of LIKE in the Where clause on index fields. It will force a non index read.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Avoid Use of NOT conditions in the Where clause on index fields. It will force a non index read.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select Single MUST have the primary key fully specified in the WHERE clause. Otherwise use Select.. Up to 1 Rows.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Avoid DISTINCT see performance standards for usage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Consider filtering on the appserver rather than in a WHERE statement&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SAP Recommendation on Joins - try not to exceed a 3 Table Join&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;When using "Select.. For all Entries". The following 4 rules MUST be followed:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          o Check to make sure driver itab is not empty&lt;/P&gt;&lt;P&gt;          o Always SORT the itab (driver table) by keys. Specify all keys used in the Where clause&lt;/P&gt;&lt;P&gt;          o DELETE Adjacent Duplicates Comparing the keys that were sorted.&lt;/P&gt;&lt;P&gt;          o All Primary Key Fields must be in the Select List&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward points to all helpful answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 11:04:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710270#M628262</guid>
      <dc:creator>suredarreddy_pulimamidi</dc:creator>
      <dc:date>2007-08-13T11:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Program is too much time for Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710271#M628263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Definitely &amp;#145;Select*&amp;#146; statement makes the performance issue so that you can choose the following ways which it better for performance issues.&lt;/P&gt;&lt;P&gt;- Write the select statement with required field names instead of all fields (*) which avoids the performance issue.&lt;/P&gt;&lt;P&gt;- Along with selected field names you may also take care in where condition: you should use only key fields in the where conditions and also maintain the sequence of key fields which they occurred in table if possible.&lt;/P&gt;&lt;P&gt;- Suppose if you use the non-key fields in where condition it makes lot of performance issues and there is no options to use key-fields then you have to create the secondary index for those non-key fields.&lt;/P&gt;&lt;P&gt;-use binary search concept.&lt;/P&gt;&lt;P&gt;-make proper cleare statement after no long use of internal tables&lt;/P&gt;&lt;P&gt;-avoid the joins concept and use the for all entries syntax etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope these points will be useful to you avoid the performance issues.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 12:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-is-too-much-time-for-execution/m-p/2710271#M628263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T12:40:35Z</dc:date>
    </item>
  </channel>
</rss>

