<?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/2576578#M588838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Check out this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZHASHED                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZHASHED                                                     .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES  : BEGIN OF EMP,&lt;/P&gt;&lt;P&gt;            ID(3),&lt;/P&gt;&lt;P&gt;            NAME(10),&lt;/P&gt;&lt;P&gt;            SAL TYPE I,&lt;/P&gt;&lt;P&gt;         END OF EMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : TAB TYPE HASHED TABLE OF EMP WITH UNIQUE KEY ID.&lt;/P&gt;&lt;P&gt;DATA: WA LIKE LINE OF TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 1.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 2.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 3.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TAB WHERE ID = 2.&lt;/P&gt;&lt;P&gt;WRITE:/ SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB INTO WA.&lt;/P&gt;&lt;P&gt;  WRITE:/ WA-ID, WA-NAME, WA-SAL.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2007 12:00:07 GMT</pubDate>
    <dc:creator>varma_narayana</dc:creator>
    <dc:date>2007-07-27T12:00:07Z</dc:date>
    <item>
      <title>hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576577#M588837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to delete a record from a hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know tht we can do  with table key.Buti m having some 4 keys.&lt;/P&gt;&lt;P&gt;so i cant delete with table key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if two key values are satisfied i want to delete tht record how to implement where condition in hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 11:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576577#M588837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T11:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576578#M588838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Check out this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZHASHED                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZHASHED                                                     .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES  : BEGIN OF EMP,&lt;/P&gt;&lt;P&gt;            ID(3),&lt;/P&gt;&lt;P&gt;            NAME(10),&lt;/P&gt;&lt;P&gt;            SAL TYPE I,&lt;/P&gt;&lt;P&gt;         END OF EMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : TAB TYPE HASHED TABLE OF EMP WITH UNIQUE KEY ID.&lt;/P&gt;&lt;P&gt;DATA: WA LIKE LINE OF TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 1.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 2.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID = 3.&lt;/P&gt;&lt;P&gt;WA-NAME = 'A'.&lt;/P&gt;&lt;P&gt;WA-SAL = 10000.&lt;/P&gt;&lt;P&gt;INSERT WA INTO TABLE TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TAB WHERE ID = 2.&lt;/P&gt;&lt;P&gt;WRITE:/ SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB INTO WA.&lt;/P&gt;&lt;P&gt;  WRITE:/ WA-ID, WA-NAME, WA-SAL.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:00:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576578#M588838</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-07-27T12:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576579#M588839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&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;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:02:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576579#M588839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T12:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576580#M588840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i cant give the value statically since mine is field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to delete a record from hashed table dynamically with where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:04:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576580#M588840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T12:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: hashed table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576581#M588841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can delete the rows in the hashed table by using the table key. Kindly refer to the code sample given below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab_line,&lt;/P&gt;&lt;P&gt;col1 TYPE i,&lt;/P&gt;&lt;P&gt;col2 TYPE i,&lt;/P&gt;&lt;P&gt;END OF itab_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE HASHED TABLE OF itab_line WITH UNIQUE KEY col1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;itab_line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;itab_line-col2 = sy-index * 2.&lt;/P&gt;&lt;P&gt;INSERT itab_line INTO TABLE itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DELETE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab WHERE col1 = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO itab_line.&lt;/P&gt;&lt;P&gt;WRITE: / itab_line-col1, itab_line-col2.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;If it helps kindly assign the points...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table/m-p/2576581#M588841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T12:12:05Z</dc:date>
    </item>
  </channel>
</rss>

