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

Why do we use events and actions in web dynpro?

772


Explain what are the events used for logical database?

713


What is an abap dictionary? : abap data dictionary

787


I just wanted to know that when I am recruiting somebody, I am generating his personal no also. Then I want to give him training also. Now I just want to create 2 scenarios to clear my doubts? : sap abap hr

772


What is screen flow logic? What are the sections in it?

820


Define structure in abap data dictionary?

793


What is the meaning of sap r/3?

834


Fallback class

1973


What is an update task?

803


Explain what are the various types of selection screen event?

799


What is value table? : abap data dictionary

843


What are logical databases? : abap hr

882


Explain what are interactive reports?

814


when are objects are passed from task to the change request?

1882


What is the difference between dialog program and a report?

828