You are on page 1of 2

Internal Tables With Header Line

You access internal tables record by record. You must use a work area as an interface for transferring data to and from the table. When you read data from an internal table, the contents of a specified table record or line overwrites the contents of the work area. Then, you can reference the contents of the work area in your program. When you write data to an internal table, you must first enter the data in the work area from with the system can transfer the data to the internal table.

To avoid inconsistencies, it is beneficial if the work area has the same data type as the records or lines of the internal table. A safe procedure for creating work areas which are compatible with internal tables is to use the same data type for declaring both the internal table and the work area. In ABAP/4, you can distinguish between two kinds of internal tables:
y y

Internal tables WITH header lines Internal tables WITHOUT header lines

A header line is similar to a work area for a database table. A work area is used as temporary storage for one entry of a database table. In a similar way, a header line is used to hold one line of an internal table. An internal table with header line is a tuple from a work area (header line) and the bulk of the table itself. Both are addressed using the same name, the interpretation of the name is context-sensitive. Hence it would stand for the header line in a MOVE statement, but would stand for the bulk of the table in a SEARCH statement. When you create an internal table WITH a header line, a work area is created automatically with the same data type as the rows of the internal table. The header line and the internal table have the same name. Then, the system uses this work area implicitly. In ABAP/4 statements for accessing internal tables, you can specify the work area to be used. For internal tables with header lines, you can leave out this specification. Then, the system uses the table work area implicitly

You might also like