<?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: How to define a hashed table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238770#M141540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry that I have given the example of SORTED TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2006 07:11:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-21T07:11:48Z</dc:date>
    <item>
      <title>How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238764#M141534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know that how we can define a hash table in ABAB.&lt;/P&gt;&lt;P&gt;And what are the advantages of that table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 06:57:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238764#M141534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T06:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238765#M141535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hashed table is useful when your have to work with very big internal table and to read it with  &lt;/P&gt;&lt;P&gt;"READ TABLE WITH KEY ..."  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The time access is constant !  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition of a Hashed Table:  &lt;/P&gt;&lt;P&gt;"Defines the table as one that is managed with an internal hash procedure. You can imagine a hashed table as a set, whose elements you can address using their unique key. Unlike standard and sorted tables, you cannot access hash tables using an index. All entries in the table must have a unique key.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Access time using the key is constant, regardless of the number of table entries.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can only access a hashed table using the generic key operations or other generic operations (SORT, LOOP, and so on). Explicit or implicit index operations (such as LOOP ... FROM to INSERT itab within a LOOP) are not allowed."  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as your records has unique key(s), using hash table will give you a huge performance gain when dealing with large dataset. assuming in your case, 10000 record , and if the key is unique, use hash table.  The main use of hash tables is for looking up fixed information from a key. So if you have a report that has personnel number and you want to display their name, you could use a hash table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus:  &lt;/P&gt;&lt;P&gt;Code:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of typ_pernr,  &lt;/P&gt;&lt;P&gt;         pernr  like pa0001-pernr,  &lt;/P&gt;&lt;P&gt;         ename  like pa0001-ename,  &lt;/P&gt;&lt;P&gt;       end   of typ_pernr.  &lt;/P&gt;&lt;P&gt;data: ls_pernr  type typ_pernr,  &lt;/P&gt;&lt;P&gt;      lt_pernr  type  hashed table of typ_pernr  with unique key pernr.  &lt;/P&gt;&lt;P&gt;...  &lt;/P&gt;&lt;P&gt;  select pernr ename into table lt_pernr  from pa0001.  &lt;/P&gt;&lt;P&gt;...  &lt;/P&gt;&lt;P&gt;  loop at itab.  &lt;/P&gt;&lt;P&gt;    read table lt_pernr  with table key pernr  =  itab-pernr  &lt;/P&gt;&lt;P&gt;         into ls_pernr.  &lt;/P&gt;&lt;P&gt;    write: ls_pernr-ename, itab-data.  &lt;/P&gt;&lt;P&gt;  endloop.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls reward the points.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238765#M141535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238766#M141536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax for creation of Hashed Table is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: &amp;lt;tab_name&amp;gt; type hashed table of &amp;lt;line_type&amp;gt; [with &amp;lt;key&amp;gt;] [initial size &amp;lt;n&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An eg: as given in SAP help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COLUMN1 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN2 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN3 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed Tables&lt;/P&gt;&lt;P&gt;Here the access is through keys and not using index.The response time for key access remains constant, regardless of the number of table entries.&lt;/P&gt;&lt;P&gt;Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope ur query is answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:09:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238766#M141536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238767#M141537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Processing of a Hash table is independent of the number of records in the table. It is because of the unique Hash algorithm that is associated with Hash type of internal tables.&lt;/P&gt;&lt;P&gt;So if you want to process a huge data, Hash tables can come handy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more details and how to create visit following link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_470/helpdata/en/fc/eb3660358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_470/helpdata/en/fc/eb3660358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shashank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:10:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238767#M141537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238768#M141538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt; i hope the following link is helpful&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_erp2004/helpdata/en/fc/eb362c358411d1829f0000e829fbfe/frameset.htm"&amp;gt;operations for all types of tables&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;kinshuk saxena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238768#M141538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238769#M141539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;once you have data in your internal table, there is not much of a performance issue...unless of course it contains a huge number of entries...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m not aware of such a possibility that an internal table can behave as both sorted and hashed...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you go for a hashed table, the response time for your search will always be constant, regardless of the number of table entries....this is because the search uses a hash algorithm...u must specify the UNIQUE key for hashed tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just go thru this link for some more information...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/what-are-different-types-of-internal-tables-and-their-usage.htm" target="test_blank"&gt;http://www.sap-img.com/abap/what-are-different-types-of-internal-tables-and-their-usage.htm&lt;/A&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;read this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables are managed system-internally by a logical index. New rows are either attached to the table or added at certain positions. The table key or the index identify individual rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are managed by a logical index (like standard tables). The entries are listed in ascending order according to table key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables are managed by a hash algorithm. There is no logical index. The entries are not ordered in the memory. The position of a row is calculated by specifying a key using a hash function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables store records in a "sorted" fashion at all times. It is faster to search through a sorted table vs a standard table. But performance is dictated by the amount of records in the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A hashed table's performance in reads is NOT dependent on the number of records. However, it is intended for reads that will return only and only one record. It uses a "side-table" with a hash algorithm to store off the physical location of the record in the actual internal table. It is not NECESSARILY sorted/organized in an meaningful order (like a sorted table is). Please note that changes to a hashed tables records must be managed carefully. Review SAP's on-help in SE38/80 about managing hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF TY_ITAB,&lt;/P&gt;&lt;P&gt;FIELD1 TYPE I,&lt;/P&gt;&lt;P&gt;FIELD2 TYPE I,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END OF TY_ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF TY_ITAB WITH UNIQUE KEY FIELD1.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR  PROPER SYNTEX F1 HELP....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238769#M141539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a hashed table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238770#M141540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry that I have given the example of SORTED TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2006 07:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-define-a-hashed-table/m-p/1238770#M141540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-21T07:11:48Z</dc:date>
    </item>
  </channel>
</rss>

