04-07-2010 8:46 AM
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.
04-07-2010 8:54 AM
while loop .. endloop, you have to use "loop at it_mytable into wa_mywork".
Regards
Vinod
04-07-2010 8:50 AM
At what point are you getting this error? Are you getting it while looping at the internal table it_mytable?
04-07-2010 8:53 AM
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
04-07-2010 8:54 AM
while loop .. endloop, you have to use "loop at it_mytable into wa_mywork".
Regards
Vinod
04-07-2010 8:54 AM
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.
04-07-2010 8:57 AM
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
04-07-2010 8:59 AM
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.
04-07-2010 9:01 AM
hi Karl,
you write like this
DATA: it_mytable TYPE standard TABLE OF Z_TABLEA,
wa_mywork LIKE LINE OF it_mytable.
Regards,
Tarun