ABAP Keyword Documentation →  ABAP − Reference →  Obsolete Language Elements →  Obsolete Declarations →  Internal Tables → 

Internal Tables with Header Line

Outside classes - if an internal table is not a component of a structure or a row in another internal table - it is still possible to create an internal table with a header line.

Declaration of Header Lines

Header lines of internal tables are created

Properties of Header Lines

A header line is a work area whose

If a header line exists, therefore, an ABAP program includes two data objects with the same name (the actual internal table and the header line). The internal table and header line are accessed as follows:

To force access to the table body in any operand position when a header line exists, square brackets can be specified directly after the name of an internal table in all operand positions (for example, itab[]). This does not apply, however, when specifying the internal table in a table expression.

Notes

Use

The use of header lines is highly error-prone, due to the repeated use of one name for two data objects. If at all possible, avoid creating and using header lines (even outside of classes).

Notes

Example

The following example shows a typical instance of handling internal tables with header lines: An internal table with header line (here the table parameter of a function module) is initialized using CLEAR, but the [] is not appended to the name. In this case, only the header line is deleted, which is not usually noticed until runtime.

FUNCTION work_with_tables.
*"---------------------------------
*"*"Local Interface
*"  TABLES
*"      table STRUCTURE  structure
*"----------------------------------

  CLEAR table.

  ...

ENDFUNCTION.