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: 

Using Hashed Tables

Former Member
0 Kudos

Hi, I have this type:

TYPES:
    BEGIN OF it_consu_notif_todos_model,
      matnr_p  LIKE  mseg-matnr,
      aufnr    LIKE  afpo-aufnr,
      rueck    LIKE  afru-rueck,
      rmzhl    LIKE  afru-rmzhl,      
    END OF it_consu_notif_todos_model.

DATA: it_consu_notif_todos TYPE HASHED TABLE OF it_consu_notif_todos_model WITH UNIQUE KEY matnr_p.

When I Activate the Program an error message told me that "IT_CONSU_NOTIF_TODOS" is a table without a header line.

I'll try to use "OCCURS 0 WITH HEADER LINE" in it_consu_notif_todos declaration but it doesn't support it using hashed tables..

Any suggest?

Thanks in advance,

CL

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I don't think your problem is in this definition. It may be where you are using it. You might not have defined any work area for this internal table, that is why you are getting this error.

LOOP AT it_consu_notif_todos

INTO myworkarea <-- this is what is probably missing

ENDLOOP.

Srinivas

6 REPLIES 6

Former Member
0 Kudos

I don't think your problem is in this definition. It may be where you are using it. You might not have defined any work area for this internal table, that is why you are getting this error.

LOOP AT it_consu_notif_todos

INTO myworkarea <-- this is what is probably missing

ENDLOOP.

Srinivas

0 Kudos

Do not use the <b>OCCURS 0</b> addition with tables defined using the form

DATA: <iTab> HASHED TABLE OF <type>.

use this instead

DATA: <iTab> HASHED TABLE OF <type> WITH HEADER LINE.

0 Kudos

Use like mentioned below -

TYPES:

BEGIN OF t_consu_notif_todos_model,

matnr_p LIKE mseg-matnr,

aufnr LIKE afpo-aufnr,

rueck LIKE afru-rueck,

rmzhl LIKE afru-rmzhl,

END OF t_consu_notif_todos_model.

types: t_consu_notif_todos TYPE HASHED TABLE OF

t_consu_notif_todos_model WITH UNIQUE KEY matnr_p.

data : it_consu_notif_todos type t_consu_notif_todos,

wa_consu_notif_todos type t_consu_notif_todos_model.

insert wa_consu_notif_todos into table it_consu_notif_todos.

loop at it_consu_notif_todos into wa_consu_notif_todos.

endloop.

Good luck

Hari

Former Member
0 Kudos

Hi Try to Check the Other part of code.

for me it works fine,

Regards

Rajesh

0 Kudos

Carlos,

I also get a clean activation of your code.

What version of R/3 are you running?

Former Member
0 Kudos

Hi,

Why do you want to declare it as Hashed table.Is there any reason??

You can declare as table right.