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

hash table

Former Member
0 Likes
634

hi ,

will it possible to append values to hash table.

thanks in advance

ganesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

You will not be able to use the APPEND statement. Instead you can use the INSERT statement.

INSERT <wa> INTO <itab>.

5 REPLIES 5
Read only

Former Member
0 Likes
550

hi,,

ou cannot use index operation in HASHED table.

Use INSERT <WA> INTO TABLE <HAS_ITAB>.

This is the most appropriate type for any table where the main operation is key access.

You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key.

Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.

siva

Read only

Former Member
0 Likes
551

You will not be able to use the APPEND statement. Instead you can use the INSERT statement.

INSERT <wa> INTO <itab>.

Read only

Former Member
0 Likes
550

Hi Ganesh,

Hashed tables can only be accessed via the primary key. The response time is constant, regardless of the number of table entries, since access proceeds via a hash algorithm.. The hash algorithm is determined internally. The key of a hashed table must be unique. You can neither implicitly nor explicitly access hash tables through indexes.

<b>Index operations cannot be used for hashed tables.</b> For index tables(Standard and sorted), index operations are faster than key operations.

Hashed tables are useful for reading a single data record via the table key, since the resulting access time is independent of the number of table entries. The location of the data record to be read is determined using the hash function. The time required is independent of the number of table entries.

INSERT for a standard table or hashed table using the key has the same effect as an APPEND statement. For hashed tables, however, the address of the data row to be entered must also be calculated. For inserts in sorted tables, the sort sequence must be strictly observed, which means the access costs grow with increasing table size.

Read only

Former Member
0 Likes
550

Hi Ganesh,

Please check the blog,

/people/harry.dietz/blog/2005/10/28/performance-improvement-hints-3-internal-table--fill-and-read

Hope this helps.

Regards,

Hema.

    • Reward points if it is useful.

Read only

Former Member
0 Likes
550

Hi Ganesh,

You can use the INSERT & COLLECT statements for appending values in a hash table. You cannot use a APPEND statement as it could be used only for indexed tables.

For more details refer the following link:

<a href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb362c358411d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb362c358411d1829f0000e829fbfe/frameset.htm</a>

Regards,

Chetan.

PS:Reward points if this helps.