<?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: Hash Algorithm in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287296#M786440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhanu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might want to fill only the hash table, sort it, and loop over it.  ( and not use the standard table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to stay with your solution with two tables: in my opinion the access to a hash table always uses a hash algorithm. If there is a mismatch between the two internal tables, the read access to the hash table will result in not finding the record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Rolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2008 12:15:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-11T12:15:23Z</dc:date>
    <item>
      <title>Hash Algorithm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287295#M786439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have internal table1 - itab1 type standard internal table.&lt;/P&gt;&lt;P&gt;and internal table2 - itab2 type hashed internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in itab1 and itab2 the common field is fld1 and this is the unique key in itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i am sorting itab1 by fld1.&lt;/P&gt;&lt;P&gt;then reading itab2 with key fld1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the system should use hash algorithm to search the records.&lt;/P&gt;&lt;P&gt;but my question is, is there any place in the debugging mode or any tool provided by SAP, where i can see that the system uses really hash technique or sequential search. this is because, if there is mismatch between key of two tables, then the system will make a sequential search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if any body knows this, please revert back soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 11:27:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287295#M786439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T11:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Algorithm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287296#M786440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhanu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might want to fill only the hash table, sort it, and loop over it.  ( and not use the standard table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to stay with your solution with two tables: in my opinion the access to a hash table always uses a hash algorithm. If there is a mismatch between the two internal tables, the read access to the hash table will result in not finding the record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Rolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 12:15:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287296#M786440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Algorithm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287297#M786441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rolf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will briefly explain you what I am upto. I have two internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB1, - hashed table:contains 1500000 records&lt;/P&gt;&lt;P&gt;FIELD1: KUNNR,&lt;/P&gt;&lt;P&gt;FIELD2: ZFIELD(custom field),&lt;/P&gt;&lt;P&gt;END ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB2, - standard table: contains 200000 records&lt;/P&gt;&lt;P&gt;FIELD1: KUNNR - KEY FIELD&lt;/P&gt;&lt;P&gt;FIELD2: VKBUR,&lt;/P&gt;&lt;P&gt;FIELD3: ZFIELD(custom field) - the same field in ITAB1&lt;/P&gt;&lt;P&gt;END ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my code roughly goes like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB2 BY KUNNR.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2 ASSIGNING &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;READ TABLE ITAB1 WITH KEY KUNNR = &amp;lt;FS&amp;gt;-KUNNR ASSIGNING &amp;lt;SS&amp;gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;&amp;lt;FS&amp;gt;-ZFIELD = &amp;lt;SS&amp;gt;-ZFIELD.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question was is there any navigation in debugging mode / any SAP provided tool, where I can see whether the system makes hash technique to read records from ITAB1 or sequential search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example when you go to st05, query shows, where the SELECT statement made sequential search, where it made direct read or where it made access using index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same way I want to see search technique for a READ statement on an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 12:40:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287297#M786441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T12:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Algorithm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287298#M786442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not know how to check the algorithm, without debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative is to compare with the binary search method: copy your program, change the hash table to a standard table, sort, and use read statement using binary search. ( or better: use a sorted table ). Then compare the speed to the original progam. For a large number of records you should see a difference..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Rolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287298#M786442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Algorithm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287299#M786443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont really understand the problem:&lt;/P&gt;&lt;P&gt;a hashed table always uses the hashed algorithm to access a record, there is no other way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sort a hashed table is possible, but it does not make much sense in respect of performance, but of course for display purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your sort of itab2 in front of the loop will also not help, it will only cost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2 in wa2.&lt;/P&gt;&lt;P&gt;  read iatb1 with key k1 = wa2-k1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with itab2 standard table&lt;/P&gt;&lt;P&gt;and itab1 hashed table with k1 unique key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is perfectly o.k., there is no further check necessary!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hash-algorithm/m-p/3287299#M786443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:32:47Z</dc:date>
    </item>
  </channel>
</rss>

