You can define internal tables either with (WITH HEADER LINE addition) or without header lines.
An internal table with header line consists of a work area (header line) and the actual table body. You address both objects
using the same name. The way in which the system interprets the name depends on the context. For example, the MOVE statement applies to the header line, but the SEARCH statement applies to the body of the table.
To avoid confusion, you are recommended to use internal tables without header lines. This is particularly important when you use nested tables. However, internal tables with header line do offer a shorter syntax in several statements
( APPEND, INSERT, MODIFY, COLLECT, DELETE, READ, LOOP ).
Within ABAP Objects, you can only use internal tables without a header line. You can always address the body of an internal table
Example
DATA itab1 TYPE TABLE OF i WITH HEADER LINE.
DATA itab2 TYPE TABLE OF i WITH HEADER LINE.
itab1 = itab2.
" Only header lines will be copied
itab1[] = itab2[].
" Copies table body
No comments:
Post a Comment