ABAP Keyword Documentation → ABAP  Reference → Processing Internal Data → Attributes of Data Objects → DESCRIBE
DESCRIBE TABLE
Other versions: 7.31  7.40  7.54
Syntax
DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].
Extras
2. ... LINES lin
3. ... OCCURS n
Effect
This statement determines some properties of internal table itab
and assigns
them to the variables specified. The various additions enable you to determine the table type, the number of rows currently filled, and the initial memory requirement.
In addition, system fields sytfill
and sytleng
are filled with the current number of table rows and the length of a table row in bytes.
Notes

For more detailed information about an internal table, use the
RTTS methods of the
DESCRIBE TABLE
statement. 
If an addition is not specified, the
DESCRIBE TABLE
statement sets system fieldssytfill
andsytleng
only.
Addition 1
... KIND knd
Effect
The table type of internal table itab
is determined and a corresponding onedigit
identification is assigned to data object knd
, for which a characterlike data type is expected. The identifications are "T" for
standard tables, "S" for sorted tables, and "H" for
hashed tables. These values
are also defined as constants sydes_kindstandard
, sydes_kindsorted
, and sydes_kindhashed
in
type group SYDES.
Addition 2
... LINES lin
Effect
The current number of table rows for internal table itab
is determined and
assigned to data object lin
for which data type i
is expected.
Note
The current number of rows of an internal table can also be determined using
predefined
function lines
, which can be used at suitable
operand positions.
Addition 3
... OCCURS n
Effect
The initial memory requirement defined using the INITIAL
SIZE addition or obsolete addition OCCURS
when the internal table is created is determined and assigned to data object n
, for which data type i
is expected.
Example
Sorting (in descending order) of a generically typed internal table in a subprogram. Since sorted tables must not be sorted in a descending order, the table type is checked to avoid an exception that cannot be handled.
FORM sort_descending CHANGING itab TYPE ANY TABLE.
DATA tabkind TYPE c LENGTH 1.
DESCRIBE TABLE itab KIND tabkind.
IF tabkind = sydes_kindstandard OR
tabkind = sydes_kindhashed.
SORT itab DESCENDING.
ELSEIF tabkind = sydes_kindsorted.
MESSAGE '...' TYPE 'E'.
ELSE.
MESSAGE '...' TYPE 'E'.
ENDIF.
ENDFORM.