<?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: hashed table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571400#M587108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is use of using HASHED TABLE? &lt;/P&gt;&lt;P&gt;&lt;/P&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;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*&lt;STRONG&gt;reward for useful answers&lt;/STRONG&gt;*&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2007 13:02:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-25T13:02:48Z</dc:date>
    <item>
      <title>hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571396#M587104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i m not able  to create a internal name for an hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m getting the following error.&lt;/P&gt;&lt;P&gt;"%_HASHED_TABLE" is a generic type. A type reference is possible only for field symbols and formal parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to create an internal table like an hashed table.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thans in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 02:56:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571396#M587104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T02:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571397#M587105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first create a structure as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of it_struct,&lt;/P&gt;&lt;P&gt;          mblnr like mseg-mblnr,&lt;/P&gt;&lt;P&gt;          matnr like mseg-matnr,&lt;/P&gt;&lt;P&gt;       end of it_struct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 like hashed table of it_struct with unique key mblnr with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note use insert to add records to the hashed itab.&lt;/P&gt;&lt;P&gt;while using read statement on it specify the unique key...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:06:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571397#M587105</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-07-25T03:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571398#M587106</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;Hashed tables&lt;/P&gt;&lt;P&gt;This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. &lt;/P&gt;&lt;P&gt;The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always &lt;/P&gt;&lt;P&gt;have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for &lt;/P&gt;&lt;P&gt;processing large amounts of data.&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;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;DATA ITAB TYPE HASHED TABLE OF SPFLI&lt;/P&gt;&lt;P&gt;WITH UNIQUE KEY CARRID CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table object ITAB has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a &lt;/P&gt;&lt;P&gt;unique key with the key fields CARRID and CONNID. The internal table ITAB can be regarded as an internal template for the database table &lt;/P&gt;&lt;P&gt;SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:19:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571398#M587106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T03:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571399#M587107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i m having a generic hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to create a work area. is there any way to access tht table without field symbols..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 12:57:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571399#M587107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T12:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571400#M587108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is use of using HASHED TABLE? &lt;/P&gt;&lt;P&gt;&lt;/P&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;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*&lt;STRONG&gt;reward for useful answers&lt;/STRONG&gt;*&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 13:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2571400#M587108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T13:02:48Z</dc:date>
    </item>
  </channel>
</rss>

