<?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/2410904#M537730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont need join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jul 2007 06:46:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-05T06:46:03Z</dc:date>
    <item>
      <title>Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410902#M537728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have req like this&lt;/P&gt;&lt;P&gt;select ebeln from ekko&lt;/P&gt;&lt;P&gt;select belnr wrbtr from ekbe for all entries in i_ekko&lt;/P&gt;&lt;P&gt;select inco1 from likp for all entries in i_ekbe&lt;/P&gt;&lt;P&gt;select matnr werks from lips for all entries in i_likp&lt;/P&gt;&lt;P&gt;select werks stwan from marc for all entries in i_lips&lt;/P&gt;&lt;P&gt;select vhcex from vlcveh for all entries in i_lips&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to pass all these data to i_final table&lt;/P&gt;&lt;P&gt;what is the best way in performance wise.&lt;/P&gt;&lt;P&gt;inputs will be higly apprciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:38:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410902#M537728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410903#M537729</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;Where is possible I suggest to use join(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look on transaction SE30 for performance  tips&amp;amp; tricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bogdan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:41:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410903#M537729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410904#M537730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont need join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:46:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410904#M537730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410905#M537731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Open your program in se38,&lt;/P&gt;&lt;P&gt;Goto Program-&amp;gt;Check-&amp;gt;Extended program check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From that you can analyse.&lt;/P&gt;&lt;P&gt;Reward if helpfull.&lt;/P&gt;&lt;P&gt;Rakesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410905#M537731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410906#M537732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;First get data from EKKO,EKBE,EKPO with a Join -ITAB&lt;/P&gt;&lt;P&gt;then for all entries JOIN LIKP and LIPS tables  -ITAB1&lt;/P&gt;&lt;P&gt;then separate selects to MARC and VLCVEH  -ITAB3 and   ITAB4&lt;/P&gt;&lt;P&gt;then loop at ITAB.&lt;/P&gt;&lt;P&gt;   read ITAB1 with key..&lt;/P&gt;&lt;P&gt;   read ITAB3 with key..&lt;/P&gt;&lt;P&gt;   read ITAB4 with key..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append I_FINAl&lt;/P&gt;&lt;P&gt;clear i_FINAL.&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;1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;2 Avoid for all entries in JOINS &lt;/P&gt;&lt;P&gt;3 Try to avoid joins and use FOR ALL ENTRIES. &lt;/P&gt;&lt;P&gt;4 Try to restrict the joins to 1 level only ie only for 2 tables &lt;/P&gt;&lt;P&gt;5 Avoid using Select *. &lt;/P&gt;&lt;P&gt;6 Avoid having multiple Selects from the same table in the same object. &lt;/P&gt;&lt;P&gt;7 Try to minimize the number of variables to save memory. &lt;/P&gt;&lt;P&gt;8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any) &lt;/P&gt;&lt;P&gt;9 Avoid creation of index as far as possible &lt;/P&gt;&lt;P&gt;10 Avoid operators like &amp;lt;&amp;gt;, &amp;gt; , &amp;lt; &amp;amp; like % in where clause conditions &lt;/P&gt;&lt;P&gt;11 Avoid select/select single statements in loops. &lt;/P&gt;&lt;P&gt;12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH. &lt;/P&gt;&lt;P&gt;13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,) &lt;/P&gt;&lt;P&gt;14 Avoid using ORDER BY in selects &lt;/P&gt;&lt;P&gt;15 Avoid Nested Selects &lt;/P&gt;&lt;P&gt;16 Avoid Nested Loops of Internal Tables &lt;/P&gt;&lt;P&gt;17 Try to use FIELD SYMBOLS. &lt;/P&gt;&lt;P&gt;18 Try to avoid into Corresponding Fields of &lt;/P&gt;&lt;P&gt;19 Avoid using Select Distinct, Use DELETE ADJACENT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:48:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410906#M537732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410907#M537733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1.      Unused/Dead code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid leaving unused code in the program. Either comment out or delete the unused situation. Use program --&amp;gt; check --&amp;gt; extended program to check for the variables, which are not used statically.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.      Subroutine Usage &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For good modularization, the decision of whether or not to execute a subroutine should be made before the subroutine is called. For example:   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is better:&lt;/P&gt;&lt;P&gt;IF f1 NE 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM sub1. &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;FORM sub1.&lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDFORM.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM sub1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM sub1.&lt;/P&gt;&lt;P&gt;  IF f1 NE 0.&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;ENDFORM.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.      Usage of IF statements &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When coding IF tests, nest the testing conditions so that the outer conditions are those which are most likely to fail. For logical expressions with AND , place the mostly likely false first and for the OR, place the mostly likely true first.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example - nested IF's: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF (least likely to be true). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF (less likely to be true). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IF (most likely to be true).&lt;/P&gt;&lt;P&gt;     ENDIF.&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;Example - IF...ELSEIF...ENDIF : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF (most likely to be true). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSEIF (less likely to be true). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSEIF (least likely to be true). &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;Example - AND: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   IF (least likely to be true) AND &lt;/P&gt;&lt;P&gt;      (most likely to be true). &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;Example - OR: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF (most likely to be true) OR&lt;/P&gt;&lt;P&gt;      (least likely to be true).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.      CASE vs. nested Ifs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When testing fields "equal to" something, one can use either the nested IF or the CASE statement. The CASE is better for two reasons. It is easier to read and after about five nested IFs the performance of the CASE is more efficient.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.      MOVE statements &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When records a and b have the exact same structure, it is more efficient to MOVE a TO b than to  MOVE-CORRESPONDING a TO b. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MOVE BSEG TO *BSEG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is better than &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MOVE-CORRESPONDING BSEG TO *BSEG.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.      SELECT and SELECT SINGLE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using the SELECT statement, study the key and always provide as much of the left-most part of the key as possible. If the entire key can be qualified, code a SELECT SINGLE not just a SELECT.   If you are only interested in the first row or there is only one row to be returned, using SELECT SINGLE can increase performance by up to three times.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.      Small internal tables vs. complete internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general it is better to minimize the number of fields declared in an internal table.  While it may be convenient to declare an internal table using the LIKE command, in most cases, programs will not use all fields in the SAP standard table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  t_mara like mara occurs 0 with header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of t_mara occurs 0, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;        ...&lt;/P&gt;&lt;P&gt;        end of t_mara.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8.      Row-level processing and SELECT SINGLE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar to the processing of a SELECT-ENDSELECT loop, when calling multiple SELECT-SINGLE commands on a non-buffered table (check Data Dictionary -&amp;gt; Technical Info), you should do the following to improve performance: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o       Use the SELECT into &amp;lt;itab&amp;gt; to buffer the necessary rows in an internal table, then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o       sort the rows by the key fields, then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o       use a READ TABLE WITH KEY ... BINARY SEARCH in place of the SELECT SINGLE command. Note that this only make sense when the table you are buffering is not too large (this decision must be made on a case by case basis).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9.      READing single records of internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When reading a single record in an internal table, the READ TABLE WITH KEY is not a direct READ.  This means that if the data is not sorted according to the key, the system must sequentially read the table.   Therefore, you should: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o       SORT the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o       use READ TABLE WITH KEY BINARY SEARCH for better performance.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10.  SORTing internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When SORTing internal tables, specify the fields to SORTed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY FLD1 FLD2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; is more efficient than&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11.  Number of entries in an internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find out how many entries are in an internal table use DESCRIBE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE ITAB LINES CNTLNS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; is more efficient than&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CNTLNS = CNTLNS + 1.&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;12.  Performance diagnosis &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To diagnose performance problems, it is recommended to use the SAP transaction SE30, ABAP/4 Runtime Analysis. The utility allows statistical analysis of transactions and programs.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13.  Nested SELECTs versus table views &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since releASE 4.0, OPEN SQL allows both inner and outer table joins.  A nested SELECT loop may be used to accomplish the same concept.  However, the performance of nested SELECT loops is very poor in comparison to a join.  Hence, to improve performance by a factor of 25x and reduce network load, you should either create a view in the data dictionary then use this view to select data, or code the select using a join.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14.  If nested SELECTs must be used &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned previously, performance can be dramatically improved by using views instead of nested SELECTs, however, if this is not possible, then the following example of using an internal table in a nested SELECT can also improve performance by a factor of 5x:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this:&lt;/P&gt;&lt;P&gt;form select_good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: t_vbak like vbak occurs 0 with header line.&lt;/P&gt;&lt;P&gt;  data: t_vbap like vbap occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from vbak into table t_vbak up to 200 rows.&lt;/P&gt;&lt;P&gt;  select * from vbap &lt;/P&gt;&lt;P&gt;          for all entries in t_vbak&lt;/P&gt;&lt;P&gt;          where vbeln = t_vbak-vbeln.&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;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of this:&lt;/P&gt;&lt;P&gt;form select_bad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select * from vbak up to 200 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from vbap where vbeln = vbak-vbeln.&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; endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although using "SELECT...FOR ALL ENTRIES IN..." is generally very fast, you should be aware of the three pitfalls of using it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, SAP automatically removes any duplicates from the rest of the retrieved records.  Therefore, if you wish to ensure that no qualifying records are discarded, the field list of the inner SELECT must be designed to ensure the retrieved records will contain no duplicates (normally, this would mean including in the list of retrieved fields all of those fields that comprise that table's primary key).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly,  if you were able to code "SELECT ... FROM &amp;lt;database table&amp;gt; FOR ALL ENTRIES IN TABLE &amp;lt;itab&amp;gt;" and the internal table &amp;lt;itab&amp;gt; is empty, then all rows from &amp;lt;database table&amp;gt; will be retrieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thirdly, if the internal table supplying the selection criteria (i.e. internal table &amp;lt;itab&amp;gt; in the example "...FOR ALL ENTRIES IN TABLE &amp;lt;itab&amp;gt; ") contains a large number of entries, performance degradation may occur. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;15.  SELECT * versus SELECTing individual fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, use a SELECT statement specifying a list of fields instead of a SELECT * to reduce network traffic and improve performance.  For tables with only a few fields the improvements may be minor, but many SAP tables contain more than 50 fields when the program needs only a few.  In the latter case, the performace gains can be substantial.  For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln auart vbtyp from table vbak&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  into (vbak-vbeln, vbak-auart, vbak-vbtyp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  where ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from vbak where ...  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16.  Avoid unnecessary statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a few cases where one command is better than two.  For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append &amp;lt;tab_wa&amp;gt; to &amp;lt;tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tab&amp;gt; = &amp;lt;tab_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append &amp;lt;tab&amp;gt; (modify &amp;lt;tab&amp;gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also, use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not &amp;lt;tab&amp;gt;[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe table &amp;lt;tab&amp;gt; lines &amp;lt;line_counter&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;line_counter&amp;gt; &amp;gt; 0.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;17.  Copying or appending internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tab2&amp;gt;[] = &amp;lt;tab1&amp;gt;[].  (if &amp;lt;tab2&amp;gt; is empty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at &amp;lt;tab1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append &amp;lt;tab1&amp;gt; to &amp;lt;tab2&amp;gt;.&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;However, if &amp;lt;tab2&amp;gt; is not empty and should not be overwritten, then use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of &amp;lt;tab1&amp;gt; [from index1] [to index2] to &amp;lt;tab2&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410907#M537733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410908#M537734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;the best case to do is &lt;/P&gt;&lt;P&gt;use READ statement with key on your primary keys&lt;/P&gt;&lt;P&gt;  some what like this &lt;/P&gt;&lt;P&gt;loop at itab into w.&lt;/P&gt;&lt;P&gt;    w_index = sy-tabix.&lt;/P&gt;&lt;P&gt;    read table itab into wa_bkpf with key primary key= wa_-primary key.&lt;/P&gt;&lt;P&gt;            modify iternal tabel from wa index w_index transporting feilds of other intrnal table.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;   thnkx&lt;/P&gt;&lt;P&gt;bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 06:59:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance/m-p/2410908#M537734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T06:59:04Z</dc:date>
    </item>
  </channel>
</rss>

