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

Headerline

Former Member
0 Likes
514

Hi

can anybody send me how and explain about with Header Line and Without Header Line?

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
486

Hi,

Please check this information from other thread.

The header line is a built in structure to your internal table. So if you say:

Data: itab like mara occurs 0 with header line.

then when you loop at the table

loop at itab.

endloop.

you can reference itab-matnr etc.

If you don't use a header line you have to declare a structure to move the values into when reading from the table like:

data itab type table of mara.

data wtab type mara.

loop at itab into wtab.

endloop.

and then you reference wtab instead of itab directly.

If you want to see it in action declare both types of table in a test program then debug and look at both your different tables and you'll see the one with a header line has a hat in the first column of the debugger referencing the values of the loop that are currently being pointed at.

Regards,

Ferry Lianto

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
487

Hi,

Please check this information from other thread.

The header line is a built in structure to your internal table. So if you say:

Data: itab like mara occurs 0 with header line.

then when you loop at the table

loop at itab.

endloop.

you can reference itab-matnr etc.

If you don't use a header line you have to declare a structure to move the values into when reading from the table like:

data itab type table of mara.

data wtab type mara.

loop at itab into wtab.

endloop.

and then you reference wtab instead of itab directly.

If you want to see it in action declare both types of table in a test program then debug and look at both your different tables and you'll see the one with a header line has a hat in the first column of the debugger referencing the values of the loop that are currently being pointed at.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
485

Suresh,

If you declare a internal table with header line, it has the body along with header. If you declare an internal table with out header line, then only the body of the internal table will be created and you have to explicitly create a work area.

A work area will have the same type of the internal table and in order to process records in an internal table you have to move them in to a work area record by record using a loop statement for ex.

Hope this helps.

Rgds,

Naren

Read only

Former Member
0 Likes
485

Hi,

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.

Regards

Sudheer