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

Using Hashed Tables

Former Member
0 Likes
774

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
Read only

Former Member
0 Likes
746

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
Read only

Former Member
0 Likes
747

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

Read only

0 Likes
746

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.

Read only

0 Likes
746

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

Read only

Former Member
0 Likes
746

Hi Try to Check the Other part of code.

for me it works fine,

Regards

Rajesh

Read only

0 Likes
746

Carlos,

I also get a clean activation of your code.

What version of R/3 are you running?

Read only

Former Member
0 Likes
746

Hi,

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

You can declare as table right.