<?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 Tuning. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805286#M915246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.Why we need performance tunning?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ans : The main purpose of performance tuning is to improve the over all performance of the SAP ERP system.Since SAP is a huge a package and involves three layers so we should try to improve the performance tuning as much as possible.The important things is we have to minimise the databse interaction as much as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.How to develop this performance tunning?&lt;/P&gt;&lt;P&gt;Ans : You have to keep in mind while developing any object how much it impove u r performance for an example if u r using for all entries u have to delete all duplicates and sort etc so if u follow like that then the end result will be a good product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.What is the pre requisites of performance tunning?&lt;/P&gt;&lt;P&gt;You have to go through all the standard performance tuning concepts and some that we learn from our own experience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.What is the main feature of this performance tunning?.&lt;/P&gt;&lt;P&gt;SAP has a tcode SE30 and ST05 through which you can test the performance of any object including database interaction through ST05 so these tcodes just provide u if there are any backlogs so that u can tune those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfomance Tuning makes the programs faster and more efficient.&lt;/P&gt;&lt;P&gt;Check ou the WIKI about PERFORMANCE TUNING. It has a lot of tricks &amp;amp; tips regarding performance in ABAP development:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance%2btuning" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance%2btuning&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, it consists in avoid some mistakes, and make it more "Clean"&lt;/P&gt;&lt;P&gt;Check these out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance Tuning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap&lt;/A&gt;&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/performance.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/performance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap&lt;/A&gt;&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You need to consider below points to improve the performance of any program you write. Any one can write the program, but &lt;/P&gt;&lt;P&gt;credit goes to one who writes efficiently. Performance plays key role for reports, BDCs.&lt;/P&gt;&lt;P&gt;&amp;#149; For all entries&lt;/P&gt;&lt;P&gt;&amp;#149; Nested selects&lt;/P&gt;&lt;P&gt;&amp;#149; Select using JOINS&lt;/P&gt;&lt;P&gt;&amp;#149; Use the selection criteria&lt;/P&gt;&lt;P&gt;&amp;#149; Use the aggregated functions&lt;/P&gt;&lt;P&gt;&amp;#149; Select with view&lt;/P&gt;&lt;P&gt;&amp;#149; Select with index support&lt;/P&gt;&lt;P&gt;&amp;#149; Select &amp;#133; Into table&lt;/P&gt;&lt;P&gt;&amp;#149; Select with selection list&lt;/P&gt;&lt;P&gt;&amp;#149; Key access to multiple lines&lt;/P&gt;&lt;P&gt;&amp;#149; Copying internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Modifying a set of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Deleting a sequence of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Linear search vs. binary&lt;/P&gt;&lt;P&gt;&amp;#149; Comparison of internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Modify selected components&lt;/P&gt;&lt;P&gt;&amp;#149; Appending two internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Deleting a set of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Tools available in SAP to pin-point a performance problem&lt;/P&gt;&lt;P&gt;&amp;#149; Optimizing the load of the database&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;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 entries in the driver table &lt;/P&gt;&lt;P&gt;is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.&lt;/P&gt;&lt;P&gt;&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;&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;&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;&lt;/P&gt;&lt;P&gt;Nested selects&lt;/P&gt;&lt;P&gt;The plus:&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;Select using JOINS&lt;/P&gt;&lt;P&gt;The plus&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;Use the aggregated functions&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;IF L1 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 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;&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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;&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 &lt;/P&gt;&lt;P&gt;using these staments the buffer will be bypassed. These staments are:&lt;/P&gt;&lt;P&gt;&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 SELECR clause.&lt;/P&gt;&lt;P&gt;&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 &lt;/P&gt;&lt;P&gt;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;&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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;+ 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;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5003374"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5003374"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5120333"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5126051"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2008 03:21:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-12T03:21:01Z</dc:date>
    <item>
      <title>Performance Tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805284#M915244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In BASIS,&lt;/P&gt;&lt;P&gt;tell me the details about performance tuning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 May 2008 08:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805284#M915244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-10T08:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805285#M915245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its better if you post ur question in Basis portal, where you can get the response quickly. Anyhow for performance tuning first you have to go to TXcode - SE30 where you have to give ur PRogram name or Txcode name created for ur program if exists, then excute once and then click on Analysis button where you can get the performance of the program if it is showing DB % more then ur program is said to be not Gud.&lt;/P&gt;&lt;P&gt;And for analysis of ur Program go to TCode ST05 where u can activate the Trace and see the select statements where it is showing inconsistences and then finally deactivate the TRACES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got ur answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 03:16:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805285#M915245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T03:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805286#M915246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.Why we need performance tunning?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ans : The main purpose of performance tuning is to improve the over all performance of the SAP ERP system.Since SAP is a huge a package and involves three layers so we should try to improve the performance tuning as much as possible.The important things is we have to minimise the databse interaction as much as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.How to develop this performance tunning?&lt;/P&gt;&lt;P&gt;Ans : You have to keep in mind while developing any object how much it impove u r performance for an example if u r using for all entries u have to delete all duplicates and sort etc so if u follow like that then the end result will be a good product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.What is the pre requisites of performance tunning?&lt;/P&gt;&lt;P&gt;You have to go through all the standard performance tuning concepts and some that we learn from our own experience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.What is the main feature of this performance tunning?.&lt;/P&gt;&lt;P&gt;SAP has a tcode SE30 and ST05 through which you can test the performance of any object including database interaction through ST05 so these tcodes just provide u if there are any backlogs so that u can tune those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfomance Tuning makes the programs faster and more efficient.&lt;/P&gt;&lt;P&gt;Check ou the WIKI about PERFORMANCE TUNING. It has a lot of tricks &amp;amp; tips regarding performance in ABAP development:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance%2btuning" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance%2btuning&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, it consists in avoid some mistakes, and make it more "Clean"&lt;/P&gt;&lt;P&gt;Check these out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance Tuning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap&lt;/A&gt;&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/performance.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/performance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap&lt;/A&gt;&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You need to consider below points to improve the performance of any program you write. Any one can write the program, but &lt;/P&gt;&lt;P&gt;credit goes to one who writes efficiently. Performance plays key role for reports, BDCs.&lt;/P&gt;&lt;P&gt;&amp;#149; For all entries&lt;/P&gt;&lt;P&gt;&amp;#149; Nested selects&lt;/P&gt;&lt;P&gt;&amp;#149; Select using JOINS&lt;/P&gt;&lt;P&gt;&amp;#149; Use the selection criteria&lt;/P&gt;&lt;P&gt;&amp;#149; Use the aggregated functions&lt;/P&gt;&lt;P&gt;&amp;#149; Select with view&lt;/P&gt;&lt;P&gt;&amp;#149; Select with index support&lt;/P&gt;&lt;P&gt;&amp;#149; Select &amp;#133; Into table&lt;/P&gt;&lt;P&gt;&amp;#149; Select with selection list&lt;/P&gt;&lt;P&gt;&amp;#149; Key access to multiple lines&lt;/P&gt;&lt;P&gt;&amp;#149; Copying internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Modifying a set of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Deleting a sequence of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Linear search vs. binary&lt;/P&gt;&lt;P&gt;&amp;#149; Comparison of internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Modify selected components&lt;/P&gt;&lt;P&gt;&amp;#149; Appending two internal tables&lt;/P&gt;&lt;P&gt;&amp;#149; Deleting a set of lines&lt;/P&gt;&lt;P&gt;&amp;#149; Tools available in SAP to pin-point a performance problem&lt;/P&gt;&lt;P&gt;&amp;#149; Optimizing the load of the database&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;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 entries in the driver table &lt;/P&gt;&lt;P&gt;is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.&lt;/P&gt;&lt;P&gt;&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;&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;&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;&lt;/P&gt;&lt;P&gt;Nested selects&lt;/P&gt;&lt;P&gt;The plus:&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;Select using JOINS&lt;/P&gt;&lt;P&gt;The plus&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;Use the aggregated functions&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/P&gt;&lt;P&gt;IF L1 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 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;&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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;&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 &lt;/P&gt;&lt;P&gt;using these staments the buffer will be bypassed. These staments are:&lt;/P&gt;&lt;P&gt;&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 SELECR clause.&lt;/P&gt;&lt;P&gt;&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 &lt;/P&gt;&lt;P&gt;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;&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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;+ 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;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5003374"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5003374"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5120333"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5126051"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 03:21:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/3805286#M915246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T03:21:01Z</dc:date>
    </item>
  </channel>
</rss>

