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

Experimenting with hashed table.

aris_hidalgo
Contributor
0 Likes
974

Hello experts,

I am currently experementing with using hashed table for my report and this is my first time to try this. Below is my code:

DATA: it_iloa type hashed TABLE OF t_iloa

WITH unique KEY iloan.

Now here is my problem, Originally I am reading it_iloa using its header line. Now, how can I define my hashed table to have a work area/header line?

Again, thanks guys and have a nice day!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
945

Max

DATA: it_iloa type hashed TABLE OF t_iloa

WITH unique KEY iloan with header line.

Max

6 REPLIES 6
Read only

Former Member
0 Likes
946

Max

DATA: it_iloa type hashed TABLE OF t_iloa

WITH unique KEY iloan with header line.

Max

Read only

0 Likes
945

ex----

data : gt_but100 like hashed table of but100

with unique key MANDT PARTNER RLTYP DFVAL

with header line.

Read only

0 Likes
945

Hi Max,

There is an error saying that 'the table key is completely displayed. Use the addition "WITH TABLE KEY" so that internal optimization can take place'.

I think the read statement gives the error. Below is the read statement:

READ TABLE it_iloa WITH KEY iloan = it_equz-iloan.

IF sy-subrc = 0.

MOVE it_iloa-tplnr TO it_finaltab-funcloc.

ENDIF.

Thanks!

Read only

0 Likes
945

you can use hash tables using work areas as well.

DATA : WA_DATA LIKE xxxxx

<b>HASHED table will not differ in anyway id doing any operations on the table as compared to a standard table. The difference lies in when you have a READ statement the system internally uses a HASH key which will improve the performance.</b>

use like thta..

<b> ex...

read table i_droplist

with table key gpart = p_gpart

vkont = p_vkont.</b>

Read only

0 Likes
945

Hi,

The SORTED table / HASH table are best used along with a LEY definition of the table, meaning you will declare a key for the internal table.

So, while declare the table add the WITH UNIQUE KEY column1.

This will create a HASH index on the column1 and when you are reading the table, make sure you have column1 in the where clause so that HASH index is used and the performance is improved.

However, unless the table has got huge data you will not be able to see the difference.

Regards,

Ravi

Read only

0 Likes
945

Hi

Instead of

READ TABLE it_iloa WITH KEY iloan = it_equz-iloan.

use

READ TABLE it_iloa WITH TABLE KEY iloan = it_equz-iloan.

Max