2007 Jul 16 5:47 PM
WHAT IS INTERNAL TABLE WITH HEADER LINE. WHAT IS THE USE OF IT IN PROGRAMS?
2007 Jul 16 5:50 PM
Hi,
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:
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.
Regards
Sudheer
2007 Jul 16 5:53 PM
Hi
When you declare the internal table with header line: then when you fetch the records from DB table, first record will enter into Header line(work area) and then it is moved/appended into the body of the internal table.
Then again the second record will enter header line and again it is moved down into the body
like this we can enter multiple records into the body of the internal table
so for multiple records processing this is useful in programs
<b>Reward points for useful Answers</b>
Regards
Anji