‎2005 Oct 27 7:13 AM
Hi,
Can i have an internal table which is both hashed as well as sorted so that i can improve the performance of the operations on the internal table.
Thanks in advance,
Kiran
‎2005 Oct 27 7:16 AM
why would you like to sort a hashed table...its entries are never ordered ....
read this...
Standard tables are managed system-internally by a logical index. New rows are either attached to the table or added at certain positions. The table key or the index identify individual rows.
Sorted tables are managed by a logical index (like standard tables). The entries are listed in ascending order according to table key.
Hashed tables are managed by a hash algorithm. There is no logical index. The entries are not ordered in the memory. The position of a row is calculated by specifying a key using a hash function.
rgds,
PJ
‎2005 Oct 27 7:31 AM
Hi PJ,
The problem is, i want to access an internal table both by using the whole key and also using partial key. If i can create a table which can behave both as hash table and as sorted table, i can make the accesses to this table faster for the search criteria that i have.
Thanks & Regards,
Kiran
‎2005 Oct 27 7:45 AM
once you have data in your internal table, there is not much of a performance issue...unless of course it contains a huge number of entries...
i m not aware of such a possibility that an internal table can behave as both sorted and hashed...
if you go for a hashed table, the response time for your search will always be constant, regardless of the number of table entries....this is because the search uses a hash algorithm...u must specify the UNIQUE key for hashed tables.
just go thru this link for some more information...
http://www.sap-img.com/abap/what-are-different-types-of-internal-tables-and-their-usage.htm
rgds,
PJ
‎2005 Oct 27 8:10 AM
‎2005 Oct 27 11:17 AM
If you have a book, you can only put it in the red shelf or in the right author shelf, but never in both shelfs. If you want to do this you need two books.
Same with tables.