‎2007 Oct 19 10:23 AM
if we create internal table of any standard DDIC table like 'mara' then we use with header line statement,WHY?
‎2007 Oct 19 10:25 AM
you can create a itab of std table type without header line also..
e.g. itab type standard table mara.
‎2007 Oct 19 10:26 AM
HI,
if we declare like
data: itab like mara .
this is not a table ... just a work area or a structure..
data: itab like mara occurs 0 with header line.
this is atable with header line.
using with header line or with out header line will depend on the developer
and also company standards....
usually the internal table without header line will give you good performance
regards,
Venkatesh
‎2007 Oct 19 10:27 AM
u can define with header line or with out header line and then seperately create the work area for it. it depends on the requirement of the internal table.
‎2007 Oct 19 10:27 AM
either way u can do.
data itab type standard table of mara with header line.
data : itab type standard table of mara,
wa_itab type mara.
second method is advisable, header line is an old concept
‎2007 Oct 19 10:28 AM
with or without header line, you always need a work area to deal with the record contents.
For internal tables with header line, you will use the header line.
For the other tables, you will define a new workarea (DATA:wa_line like line of itab) for that purpose.
regards,
Hans
‎2007 Oct 19 10:28 AM
The WITH HEADER LINE addition is obsolete; you should no longer use it. Also see the keyword documentation.
The optional addition WITH HEADER LINE declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (itab[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
‎2007 Oct 19 10:32 AM
Hi Abhishek,
You can always create an itab of std table type without header line also. And this reduces performance problems also.
e.g. itab type standard table vblen.
or
types: begin of ty_itab,
**- fields type table-fieldname,
end of ty_itab.
data : itab type standard table of ty_itab.
Reward If useful.
Regards,
Chitra
‎2007 Oct 19 12:18 PM
hi abhishek,
there is no such thing to create an intenal table with header.
you can create an internal table without a header also.
data : itab type mara occurs 0.
data : wa type mara.
you need occurs specifically.
n declare a work area type ztable.
regars,
sohi
‎2007 Oct 19 1:05 PM
When using with header line option, you are saved from declaring work area for this internal table, (or the other way to say this is, a work area with the name same as internal table name is created),
so you can read the line of table/ loop into table without using into/assigning option, itab name will contain respective entry which you had read last.