<?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 Algorithms in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114047#M106943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for material (books or anything) describing the developement of effective algorithms in ABAP, and the measurement of the performance of the used concepts. I'm thinking about the possibility to write my Bachelor Thesis about an SAP related topic, and so I've began to sift through the material available.&lt;/P&gt;&lt;P&gt;Your hints are pretty welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2006 12:41:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-18T12:41:10Z</dc:date>
    <item>
      <title>Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114047#M106943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for material (books or anything) describing the developement of effective algorithms in ABAP, and the measurement of the performance of the used concepts. I'm thinking about the possibility to write my Bachelor Thesis about an SAP related topic, and so I've began to sift through the material available.&lt;/P&gt;&lt;P&gt;Your hints are pretty welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 12:41:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114047#M106943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T12:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114048#M106944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to SDN!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are few links, you can start with...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="45909"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 12:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114048#M106944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T12:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114049#M106945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; could you be specific as what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 12:54:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114049#M106945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T12:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114050#M106946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought, that one of the major advantages of ABAP is the integration of SQL within the language without using an interface to the database. The possiblity to use it is like SELECT * FROM ... which wont give the user a high performance. Are there any given concepts (maybe in written form) how to use efficient algorithms with maximun performace?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again thanks for your reply.&lt;/P&gt;&lt;P&gt;Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 13:11:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114050#M106946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114051#M106947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gerd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some good documentation in the  &amp;lt;a href="http://service.sap.com/performance"&amp;gt;SAP Markeplace alias performance&amp;lt;/a&amp;gt; in the media library. You need a markeplace user id for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SDN there is also some performance related documents from Teched 2004. Use keyword "performance teched". &lt;/P&gt;&lt;P&gt;Eg: 	Performance Analysis and Tuning of SAP NetWeaver.pdf, 	Performance Analysis in a Nutshell,  etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a book called &amp;lt;a href="http://www.sap-press.com/product.cfm?account=&amp;amp;product=H975"&amp;gt;Enhancing the Quality of ABAP Development&amp;lt;/a&amp;gt;, which contains a lot of useful performance tips.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 13:33:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114051#M106947</guid>
      <dc:creator>Peter_Inotai</dc:creator>
      <dc:date>2006-01-18T13:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114052#M106948</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;Here are some ABAP code performance tips:&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 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;The plus &lt;/P&gt;&lt;P&gt;&amp;#149;	Large amount of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Mixing processing and reading of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Fast internal reprocessing of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Fast &lt;/P&gt;&lt;P&gt;The Minus &lt;/P&gt;&lt;P&gt;&amp;#149;	Difficult to program/understand &lt;/P&gt;&lt;P&gt;&amp;#149;	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;&amp;#149;	Removing duplicates from the driver table &lt;/P&gt;&lt;P&gt;&amp;#149;	Sorting the driver table  &lt;/P&gt;&lt;P&gt;&amp;#149;	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;&amp;#149;	Small amount of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Mixing processing and reading of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Easy to code - and understand &lt;/P&gt;&lt;P&gt;The minus: &lt;/P&gt;&lt;P&gt;&amp;#149;	Large amount of data &lt;/P&gt;&lt;P&gt;&amp;#149;	when mixed processing isn&amp;#146;t needed &lt;/P&gt;&lt;P&gt;&amp;#149;	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;&amp;#149;	Very large amount of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Similar to Nested selects - when the accesses are planned by the programmer &lt;/P&gt;&lt;P&gt;&amp;#149;	In some cases the fastest &lt;/P&gt;&lt;P&gt;&amp;#149;	Not so memory critical &lt;/P&gt;&lt;P&gt;The minus &lt;/P&gt;&lt;P&gt;&amp;#149;	Very difficult to program/understand &lt;/P&gt;&lt;P&gt;&amp;#149;	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;&lt;/P&gt;&lt;P&gt;  CHECK: SBOOK-CARRID = 'LH' AND        &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  SBOOK-CONNID = '0400'.         &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;SELECT * FROM SBOOK                      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHERE CARRID = 'LH' AND                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CONNID = '0400'.                 &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;Use the aggregated functions&lt;/P&gt;&lt;P&gt;C4A = '000'.               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM T100         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHERE SPRSL = 'D' AND    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ARBGB = '00'.      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CHECK: T100-MSGNR &amp;gt; C4A. &lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt; WHERE SPRSL = 'D' AND                 &lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;  WHERE DOMNAME LIKE 'CHAR%'            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AND AS4LOCAL = 'A'.             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM DD01T            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHERE   DOMNAME    = DD01L-DOMNAME  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AND AS4LOCAL   = 'A'            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AND AS4VERS    = DD01L-AS4VERS  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AND DDLANGUAGE = SY-LANGU.      &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;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT * FROM DD01V                     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WHERE DOMNAME LIKE 'CHAR%'            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       AND DDLANGUAGE = SY-LANGU.      &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;Select with index support&lt;/P&gt;&lt;P&gt;SELECT * FROM T100             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WHERE     ARBGB = '00'       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       AND MSGNR = '999'.     &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;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT * FROM T002.              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM T100             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHERE     SPRSL = T002-SPRAS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          AND ARBGB = '00'       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          AND MSGNR = '999'.     &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;&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;&lt;/P&gt;&lt;P&gt;SELECT * FROM T006 INTO X006.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND X006.                 &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;&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; &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;&lt;/P&gt;&lt;P&gt;  WHERE DOMNAME LIKE 'CHAR%'      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AND AS4LOCAL = 'A'.       &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;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT DOMNAME FROM DD01L     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; INTO DD01L-DOMNAME          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WHERE DOMNAME LIKE 'CHAR%'  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       AND AS4LOCAL = 'A'.   &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;Key access to multiple lines&lt;/P&gt;&lt;P&gt;LOOP AT TAB.           &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CHECK TAB-K = KVAL.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;&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;  " ...                          &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; &lt;/P&gt;&lt;P&gt;Copying internal tables&lt;/P&gt;&lt;P&gt;REFRESH TAB_DEST.               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SRC INTO TAB_DEST.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND TAB_DEST.              &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; &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;&lt;/P&gt;&lt;P&gt;  IF TAB-FLAG IS INITIAL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TAB-FLAG = 'X'.       &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 TAB.             &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; &lt;/P&gt;&lt;P&gt;TAB-FLAG = 'X'.                   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY TAB TRANSPORTING FLAG      &lt;/P&gt;&lt;P&gt;&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; &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;&lt;/P&gt;&lt;P&gt;  DELETE TAB_DEST INDEX 450. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDO.                       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; &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;&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;&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;&lt;/P&gt;&lt;P&gt;IF L1 &amp;lt;&amp;gt; L2.                         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TAB_DIFFERENT = 'X'.               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TAB_DIFFERENT = SPACE.             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt; AT TAB1.                      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE TAB2 INDEX SY-TABIX.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF TAB1 &amp;lt;&amp;gt; TAB2.                 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      TAB_DIFFERENT = 'X'. EXIT.     &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;  ENDLOOP.                           &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;                                     &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;  " ...                              &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;&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; " ...               &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;&lt;/P&gt;&lt;P&gt; TAB-DATE = SY-DATUM.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODIFY TAB.           &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; &lt;/P&gt;&lt;P&gt;WA-DATE = SY-DATUM.                     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB.                            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODIFY TAB FROM WA TRANSPORTING DATE. &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;Appending two internal tables&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SRC.               &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND TAB_SRC TO TAB_DEST.  &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; &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;&lt;/P&gt;&lt;P&gt;  DELETE TAB_DEST.                &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; &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; &lt;/P&gt;&lt;P&gt;Tools available in SAP to pin-point a performance problem&lt;/P&gt;&lt;P&gt;&amp;#149;                The runtime analysis (SE30)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;                SQL Trace (ST05)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;                Tips and Tricks tool &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;                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 statement can not be used with a buffered table, so when using these statements the buffer will be bypassed. These statements are: &lt;/P&gt;&lt;P&gt;&amp;#149;	Select DISTINCT &lt;/P&gt;&lt;P&gt;&amp;#149;	ORDER BY / GROUP BY / HAVING clause &lt;/P&gt;&lt;P&gt;&amp;#149;	Any WHERE clause that contains a sub query or IS NULL expression &lt;/P&gt;&lt;P&gt;&amp;#149;	JOIN s &lt;/P&gt;&lt;P&gt;&amp;#149;	A SELECT... FOR UPDATE &lt;/P&gt;&lt;P&gt;If you wan t to explicitly bypass the buffer, 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 database server will usually be the bottleneck, so sometimes it is better to move the sort from the database 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 statement 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 database server sort it. &lt;/P&gt;&lt;P&gt;Avoid the 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 duplicate rows. &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;Sreedhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 14:05:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114052#M106948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T14:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithms in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114053#M106949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose someone should point out that using SELECT...ENDSELECT loops is absolutely the worst way to retrieve data from the database. To get and use the whole of SFLIGHT for use in a local programme you should use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: xsflight type hashed table of sflight
          with unique key carrid connid fldate.
field-symbols: &amp;lt;fs_xsflight&amp;gt; type sflight.

select * from sflight
       into table xsflight.

loop at xsflight assigning &amp;lt;fs_xsflight&amp;gt;.
*&amp;amp; do something useful here...
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A SELECT...ENDSELECT loop is rubbish because it leaves a cursor on the table in the database, and for every record you retrieve you have a round trip to the database and back. This is particularly slow if the database and the programme aren't running on the same server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2006 14:22:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithms-in-abap/m-p/1114053#M106949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-18T14:22:26Z</dc:date>
    </item>
  </channel>
</rss>

