Get Example source ABAP code based on a different SAP table
ID TYPE-HEADER-LINE • WITH HEADER LINE DATA - obsolete
DATA>, HEADER LINE> Short Reference >
ABAP_SYNTAX_OBS ... WITH HEADER LINE ...>
What does it do? This addition of the statements DATA TABLE OF>>, DATA RANGE OF>>, and the obsolete statement DATA OCCURS>>, which is forbidden in classes, declares a further data object alongside the internal table, known as the header line >. This object has exactly the same name as the internal table and has the line type of the internal table as its data type. A header line cannot be declared for internal tables with a table-like line type. This is possible for structured line types with table-like components, however. If the name of an internal table itab> is specified in an operand position of an ABAP statement, the statement determines whether the table body> or header line is used. As a rule, all table-specific statements such as SORT>> or LOOP>> use the internal table, whereas all other statements use the header line. Exceptions to this rule are listed under Internal Tables with Header Line>. To address the table body instead of the header line in statements, []> can be appended to the table name: ... itab[] ...> For internal tables without a header line, the table body is always used. An internal table with a header line cannot be a component of a structure or a line of another internal table.
Latest notes:
These statements for processing individual table lines have obsolete short forms> that use the header line as a work area implicitly. These short forms are allowed only outside of ABAP Objects.
If the name primary_key> is explicitly specified or a secondary key> is defined when the primary key> is being defined, the addition WITH HEADER LINE> can no longer be specified, even outside of classes. ABAP_HINT_END