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

internal table

Former Member
0 Likes
962

if we create internal table of any standard DDIC table like 'mara' then we use with header line statement,WHY?

9 REPLIES 9
Read only

Former Member
0 Likes
873

you can create a itab of std table type without header line also..

e.g. itab type standard table mara.

Read only

Former Member
0 Likes
873

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

Read only

Former Member
0 Likes
873

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.

Read only

Former Member
0 Likes
873

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

Read only

h_senden2
Active Contributor
0 Likes
873

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

Read only

Former Member
0 Likes
873

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.

Read only

Former Member
0 Likes
873

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

Read only

Former Member
0 Likes
873

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

Read only

Former Member
0 Likes
873

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.