Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sorted and hashed internal table

Former Member
0 Likes
848

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

5 REPLIES 5
Read only

Former Member
0 Likes
746

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

Read only

Former Member
0 Likes
746

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

Read only

0 Likes
746

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

Read only

0 Likes
746

Hi PJ,

Thanks for everything.

Regards,

Kiran

Read only

rainer_hbenthal
Active Contributor
0 Likes
746

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.