ABAPDESCRIBE_TABLE - DESCRIBE TABLE

Addresses (Business Address Services)   General Material Data  
This documentation is copyright by SAP AG.

DESCRIBE TABLE

Short Reference



Syntax

DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].

Additions

1. ... KIND knd

2. ... LINES lin

3. ... OCCURS n

Effect

This statement determines some properties of internal table itab and assigns them to the variablesspecified. 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 sy-tfill and sy-tleng 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 theRTTS methods of the DESCRIBE TABLE statement.
  • If an addition is not specified, the DESCRIBE TABLE statement sets system fields sy-tfill and sy-tleng only.


Addition 1

... KIND knd

Effect

The table type of internal table itab is determined and a corresponding one-digit identification is assigned to data object knd, for which a character-like data type is expected. The identifications are "T" forstandard tables, "S" for sorted tables, and "H" forhashedtables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed intype 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 usingpredefinedfunction lines, which can be used at suitableoperand positions.

Addition 3

... OCCURS n

Effect

The initial memory requirement defined using the INITIALSIZE addition or obsolete addition OCCURSwhen 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. Sincesortedtables 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_kind-standard OR
     tabkind = sydes_kind-hashed.
    SORT itab DESCENDING.
  ELSEIF tabkind = sydes_kind-sorted.
    MESSAGE '...' TYPE 'E'.
  ELSE.
    MESSAGE '...' TYPE 'E'.
  ENDIF.
ENDFORM.


TXBHW - Original Tax Base Amount in Local Currency   ABAP Short Reference  
This documentation is copyright by SAP AG.


Length: 4862 Date: 20120522 Time: 051515     triton ( 167 ms )