TABLES

TABLES Syntax Diagram

Effect

Creates a structure in the program with the same name as the database table, view or structure dbtab. This is the table work area. dbtab must be declared in the ABAP Dictionary( Development->Dictionary). The names and sequence of the fields in the table work area dbtab correspond exactly to the names and sequence of the field in the declaration of the database table or view in the ABAP Dictionary. The type (see DATA) and length of the fields are determined from the data types in the ABAP Dictionary as follows:

Dict data typep ABAP Datentyp

ACCP -> N(6)

CHAR n -> C(n)

CLNT -> C(3)

CUKY -> C(5)

CURR n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

DEC n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

DATS -> D

FLTP -> F

INT1 -> no corresponding type

INT2 -> no corresponding type

INT4 -> I

LCHR n -> C(n)

LRAW n -> X(n)

LANG -> C(1)

NUMC n -> N(n)

PREC -> X(2)

QUAN n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

RAW n -> X(n)

TIMS -> T

UNIT n -> C(n)

VARC n -> C(n)

The fields in the table work area have the initial values corresponding to their ABAP data type (see DATA). For the ABAP Dictionary data types INT1 and INT2, the system creates integer fields with the lengths 1 and 2 respectively.

The length of the table work area is not simple the sum of the lengths of the individual fields. The structure may contain nameless "holes" to accommodate the alignment requirements of certain fields (see alignment).

Example

TABLES SPFLI. 
 
SELECT * FROM SPFLI. 
  WRITE: / SPFLI-CARRID, SPFLI-CONNID. 
ENDSELECT.

You can display the structure of the table work area by double-clicking the table name in the ABAP Editor.

Related

DATA, TYPES