How to create hashed tables?and its purpose

Answer Posted / buddula15

Hashed Table:
You can imagine a hashed table as a set, whose elements you
can address using their unique key. Unlike standard and
sorted tables, you cannot access hash tables using an index.
All entries in the table must have a unique key.Hashed table
is useful when your have to work with very big internal
table and to read it with "READ TABLE WITH KEY ..." .

Sample code for Hashed table Creation :
types:
begin of typ_pernr,
pernr like pa0001-pernr,
ename like pa0001-ename,
end of typ_pernr.

data:
ls_pernr type typ_pernr,
lt_pernr type hashed table of typ_pernr with unique key
pernr.
...
select pernr ename into table lt_pernr from pa0001.
...
loop at itab.
read table lt_pernr with table key pernr = itab-pernr
into ls_pernr.
write: ls_pernr-ename, itab-data.
endloop.

Is This Answer Correct ?    19 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The loop-endloop on extract datasets can be used without any kind of errors. State true or false. : abap modularization

640


What is the difference between field-group header and other field groups?

565


What is direct input method ?

1478


What are the attributes of the data in data dictionary? : abap data dictionary

608


What are the basic objects of the data dictionary?

574






There is a situation where there is a field "MATERIAL DESCRIPTION" in say 20 display only transaction. You want that whenever user opens any of these transaction, this particular field is masked with ****. But table does not holds ****. It holds the actual value. What are different ways of doing it? Which is the best way.

936


What is roll area?

575


How do we handle multiple line items in BDC's.

6394


Explain enhancements

877


What is the maximum number of match code id's that can be defined for one match code object ?

541


What are subroutines? : abap modularization

630


what are the main technical differences between oracle and sap? it would be more helpful to me if get this answer...

1536


What are the buffering options in abap?

568


What are the 3 types of function modules in sap?

615


What is alv programming in abap? When is this grid used in abap? : abap hr

683