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
515

Hi.....to everybody.....

What is the difference between WITH and WITHOUT HEADER LINE..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
498

hi

good

While adding or retrieving records to / from internal table we have to keep the record temporarily.

The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.

Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

data: wa_itab like itab. " explicit work area for itab

data: itab1 like itab occurs 10. " table is without header line.

The header line is a field string with the same structure as a row of the body, but it can only hold a single row.

It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.

thanks

mrutyun^

4 REPLIES 4
Read only

Former Member
0 Likes
499

hi

good

While adding or retrieving records to / from internal table we have to keep the record temporarily.

The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.

Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

data: wa_itab like itab. " explicit work area for itab

data: itab1 like itab occurs 10. " table is without header line.

The header line is a field string with the same structure as a row of the body, but it can only hold a single row.

It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.

thanks

mrutyun^

Read only

Former Member
0 Likes
498

Hi Nagesh,

with header line creates an internal table including worarea.

loop at itab.

endloop.

is possible.

without header line creates only the table.

loop at itab into your_workarea.

endloop.

is obligatory. Can't code 'loop at itab' without header line.

Kind regards

Henner

Read only

Former Member
0 Likes
498

Hi Nagesh,

WITH HEADER LINE doesnt need explicit work area where as WITH OUT HEADER LINE does need an explicit work area to perform operations on internal tables.

Thanks,

Vinay

Read only

Former Member
0 Likes
498

this all sounds like it would be positive to have a header line.

However, there is a lot of confusion between tables and the header lines with the same name, such that most proogramming guidlines recommend to use explicit work areas with names different from the table.

Siegfried