<?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: Sorted internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200185#M762698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually performance of  internal table completely depends on the type of data you are handling.&lt;/P&gt;&lt;P&gt;Sorted internal table does improve the performance but mind you sorting the data itself also takes time. So, it all depends on what is your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the difference between the types of internal table and when they can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to &lt;/P&gt;&lt;P&gt;the number of table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of &lt;/P&gt;&lt;P&gt;table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and &lt;/P&gt;&lt;P&gt;using internal tables that are similar to database tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourabh Verma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2007 13:34:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-18T13:34:22Z</dc:date>
    <item>
      <title>Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200180#M762693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;           will the sorted internal tables help in performance?If yes how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rakesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:02:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200180#M762693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T13:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200181#M762694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading from a sorted standard table is quicker than a non-sorted standard table, if you use the BINARY SEARCH addition.  Reading from a sorted table is quicker than reading from a standard table.  How?  Because it permits the use of algorithms which take advantage of the sort order to do faster reads.  If the table is not sorted in anyway, then the only thing to do is go from the beginning, a record at a time, until you reach a match.  Which is fine if your record is near the beginning, but very bad if it is at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that sorts your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200181#M762694</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2007-12-18T13:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200182#M762695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rakesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERTstatement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHEREcondition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The use of field symbols takes this performance concept one step further.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this is helpful, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Dec 18, 2007 6:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:09:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200182#M762695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T13:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200183#M762696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorting an internal table woul help read an internal table very quickly, which would contribute to the performance of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200183#M762696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T13:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200184#M762697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  Yes sorted internal table help in performance because it use &lt;STRONG&gt;Binary search&lt;/STRONG&gt; for read the internal table  and for checking also ,          &lt;STRONG&gt;Binary Search&lt;/STRONG&gt; is Faster than any Search techinques, in performance wise it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plzzz   Reward if useful,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mahi&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200184#M762697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T13:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200185#M762698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually performance of  internal table completely depends on the type of data you are handling.&lt;/P&gt;&lt;P&gt;Sorted internal table does improve the performance but mind you sorting the data itself also takes time. So, it all depends on what is your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the difference between the types of internal table and when they can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to &lt;/P&gt;&lt;P&gt;the number of table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of &lt;/P&gt;&lt;P&gt;table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and &lt;/P&gt;&lt;P&gt;using internal tables that are similar to database tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourabh Verma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 13:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-internal-table/m-p/3200185#M762698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T13:34:22Z</dc:date>
    </item>
  </channel>
</rss>

