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: 

Internal Table and work area

Former Member
0 Kudos

Hi,

in BC400 it is written I shall do something like this


DATA: it_mytable TYPE TABLE OF Z_TABLEA,
wa_mywork LIKE LINE OF it_mytable.

Z_TABLEA is a table existing in the dictionary. I am getting now an error in the ABAP editor:


The internal table "it_mytable" has no header line - explicit 
specification of an output area with "INTO wa" or "ASSIGNING <fs>" is 
required.

Of course in the BC400 sample code they don't use table Z_TABLEA but some other table. Is there a difference between my table and the BC400 table? What is the difference and what do I have to do?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

while loop .. endloop, you have to use "loop at it_mytable into wa_mywork".

Regards

Vinod

7 REPLIES 7

Former Member
0 Kudos

At what point are you getting this error? Are you getting it while looping at the internal table it_mytable?

Rocky1
Active Participant
0 Kudos

Hi,

This error may be due to the following reason:

You are using internal table name(table without header line) instead of work area.

Soln: Create one work area and use instead of internal table name in slect query after INTO.

Thanks & Regards

Rocky

Former Member
0 Kudos

while loop .. endloop, you have to use "loop at it_mytable into wa_mywork".

Regards

Vinod

Former Member
0 Kudos

Hi ,

Incase of internal without header line , you need to use into workarea .

Or you have to declare the internal table with headerline explicitly.

Thanks.

Former Member
0 Kudos

hi karl ,

this error u are getting because u have created the internal table without the header line , to create the table with header line


DATA: it_mytable TYPE TABLE OF Z_TABLEA with header line.

if you are selecting or looping the table then either it should be move to wordarea or headerline if defined or field symbol.

its better to create work area insted of header line like u have done


DATA: it_mytable TYPE TABLE OF Z_TABLEA,
wa_mywork LIKE LINE OF it_mytable.

if you are getting the error in select u have to do it like this

select single field1 field2

into wa_mywork

from z_tablea

where your condition.

while looping

loop at it_mytable into wa_mywork.

endloop.

thanks and regards,

tanmaya

Former Member
0 Kudos

Hi...

Declare internal table with header line or declare workarea seperately of type Z_TABLEA.

like

data : it_mytable TYPE TABLE OF Z_TABLEA,

wa_mytable type Z_TABLEA.

(or)

data : it_mytable LIKE Z_TABLEA OCCURS 0 WITH HEADER LINE.

Regards,

Lokeswari.

Former Member
0 Kudos

hi Karl,

you write like this

DATA: it_mytable TYPE standard TABLE OF Z_TABLEA,

wa_mywork LIKE LINE OF it_mytable.

Regards,

Tarun