06-02-2006 3:14 PM
1) I populate a hashed internal table :
data :
i_droplist type hashed table of t_droplist
with unique key gpart vkont,
select gpart
vkont
into table i_droplist
from zxis_0x_dun_drop
for all entries in i_jointab1
where gpart = i_jointab1-gpart
and vkont = i_jointab1-vkont.
2) read table i_droplist transporting no fields
with table key gpart = p_gpart
vkont = p_vkont.
Before reading the table is it needed to sort the hashed table on the key ?
I think it is not necessary but I am not sure ...
Thanks for your help,
Marie
06-02-2006 3:16 PM
Hi Marie,
It is not Mandatory to use Sort before Read for a hashed table.
Regards,
Santosh
Reward if it helps...
06-02-2006 3:16 PM
Hi Marie,
It is not Mandatory to use Sort before Read for a hashed table.
Regards,
Santosh
Reward if it helps...
06-02-2006 3:17 PM
Hi
No! You can't do it because the system sorts the records while loading them.
Max
06-02-2006 3:19 PM
Hi,
no need.
When you write to the hashed table it uses a hashing algorithm to identify where the record is stored (think if this as writing the location of a page in an index of a book). When you READ this table the system looks up this "index" and retrieves the record. Because of this the retrieval time is constant.
rgds,
latheesh
Message was edited by: Latheesh Kaduthara
06-02-2006 3:19 PM
06-02-2006 3:26 PM
DO NOT SORT IT !!!!
A hashed table is not sorted in any way. It is organized according to a "hash" algorithm, which is a mathematical calculation.
This "hashing" provides for maximize speed of data retrival when looking for a SINGLE, UNIQUE record!!
If you have multiple records in the internal table with the same key, a hash table is NOT the way to go. In that case, use a SORTED table.
But DO NOT sort a hashed table... you will probably find performance degradation AFTER a SORT is performed on one. SAP will "realize" that the hash algorithm has been borken... and SAP will start to read the int table sequentially.
06-02-2006 3:26 PM