Application Development 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: 

HASHED tables

former_member206396
Active Participant
0 Kudos

hi all,

how to use Hashed tables ?

syntax of hashed table creation?

syntax of read stmt of Hashed table?

if possible same things for SOrted table?

could any one help me out?

thanking you.,

ramu

2 REPLIES 2

Former Member
0 Kudos

The table type determines how ABAP accesses individual table rows. Based on the table type, internal tables can be subdivided into the following three categories:

<b>Sorted tables</b> are always stored sorted by the key. Also for sorted tables, a logical index is set up internally. The data can be accessed using the table index or the key. If the data is accessed using the key, the response time depends logarithmically on the number of table entries since the data is accessed through a binary search. The key of sorted tables can be unique or non-unique. When you define the table, you must specify whether the key is UNIQUE or NON-UNIQUE.

Standard tables and sorted tables are also commonly referred to as index tables.

In <b>hash tables</b>, no logical index is set up internally. Hash tables can only be accessed by specifying the key. The response time in this case is constant irrespective of the number of table entries since the data is accessed through a hash algorithm. The key of hash tables must be unique. When you define the table, you must specify the key as UNIQUE.

The <b>READ TABLE</b> syntax is same as the standard but the response time differs depending on the type.

<b>STANDARD TABLE:</b>

The system searches from the start of the table. The response time is in linear relation to the number of table entries.

<b>SORTED TABLE:</b>

The response time is in logarithmic relation to the number of table entries.

<b>HASHED TABLE:</b>

The response time is constant.

<b>Table Creation</b>

DATA : INT_FINAL_PRD type HASHED table of TY_FINAL_PRD initial size 0

WITH UNIQUE KEY RECTYPE RECKEY kunnr TEMPB MATNR ARKTX CARQTY.