2007 Aug 09 1:05 PM
Hi Experts,
Pls explain Hash Algorithm with one example
Thanks In Advance,
Ur's
Harsha.
if you want a internal table which allows faster reading then you should go for hashed table , but the disadvantage is that you cannot use index to read the hashed itab.
you have to use keys.
sample declratin of hashed table.
data:cc_text TYPE HASHED TABLE OF /bi0/tcostcenter WITH UNIQUE KEY co_area costcenter langu .
to read entries from the hashed table.
READ TABLE cc_text INTO wa_cc_text WITH KEY
co_area = coarea
costcenter = cctr
langu = sy-langu .
Hash table access time dosent increase based on the number of records, its constant.
check out the ABAP key work documentation for different types of internal table and their usages.
> How Hash Algorithm and Logarithmic Algorithm works
> to fetch the data ?
Fetching part is the same as standard internal table, only when you work with the internal table, than it's different.
> What the basic things we have to keep in mined when
> we select the Internal table ?
Eg Performance.
> Any rule for selecting the internal table which
> should be followed ?
Standard table is quite easy to use, but you might loose performance with it. Most of the time hash table is the fastest.
Using standard table and sort it is a good choice, when you access in READ TABLE via BINARY SEARCH.
Check 'ABAP for Power Users' SAP tutorial in SDN, it very good explains this topic in detail.
Regards,
Pavan
2007 Aug 09 1:48 PM
Hi Harsha,
check these out (general information):
<a href="http://en.wikipedia.org/wiki/Hash_function">Hash function</a>
<a href="http://en.wikipedia.org/wiki/Hash_table">Hash table</a>
<a href="http://en.wikipedia.org/wiki/Hash_list">Hash list</a>
<a href="http://en.wikipedia.org/wiki/Hash_tree">Hash tree</a>
Regards,
Sukhee
2019 Sep 24 7:34 AM
2007 Aug 09 1:54 PM
if you want a internal table which allows faster reading then you should go for hashed table , but the disadvantage is that you cannot use index to read the hashed itab.
you have to use keys.
sample declratin of hashed table.
data:cc_text TYPE HASHED TABLE OF /bi0/tcostcenter WITH UNIQUE KEY co_area costcenter langu .
to read entries from the hashed table.
READ TABLE cc_text INTO wa_cc_text WITH KEY
co_area = coarea
costcenter = cctr
langu = sy-langu .
Hash table access time dosent increase based on the number of records, its constant.
check out the ABAP key work documentation for different types of internal table and their usages.
> How Hash Algorithm and Logarithmic Algorithm works
> to fetch the data ?
Fetching part is the same as standard internal table, only when you work with the internal table, than it's different.
> What the basic things we have to keep in mined when
> we select the Internal table ?
Eg Performance.
> Any rule for selecting the internal table which
> should be followed ?
Standard table is quite easy to use, but you might loose performance with it. Most of the time hash table is the fastest.
Using standard table and sort it is a good choice, when you access in READ TABLE via BINARY SEARCH.
Check 'ABAP for Power Users' SAP tutorial in SDN, it very good explains this topic in detail.
Regards,
Pavan
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |