Basic form

TABLES dbtab.


Makes the database table , view or structure dbtab known to the program. These objects are created by selecting Development -> ABAP/4 Dictionary . This transaction automatically defines an identical field string - the table work area - in the program. The names and the sequence of the fields of the table work area dbtab correspond exactly to the names and the sequence of the fields when declaring the database table or view in the ABAP/4 Dictionary . The ABAP/4 data type (see DATA ) and the length of the fields are derived from the data types in the ABAP/4 Dictionary as follows:
Dict. data typeABAP/4 data type
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]
INT1 -> No correspondence
INT2 -> No correspondence
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)
UNIT n -> C(n)
VARC n -> C(n)

The fields of the table work area are set to the initial values for their ABAP/4 data types (see DATA ). For the ABAP/4 Dictionary data types INT1 and INT2 , whole number fields of length 1 or 2 are created with the initial value 0 in the table work area.
The length of the table work area is not just the sum of the lengths of the individual fields. Depending on how different fields have to be aligned (Alignment ), the structure can contain nameless "holes".




You can display the structure of the table work area in the ABAP/4 Editor by double-clicking on the table name.
The divisions for determining ABAP/4 field lengths are whole number divisions without rounding. The field of the table work area can accept numbers which contain one digit more than the ABAP/4 Dictionary data type allows. Such a situation results in a runtime error when writing to the database.
The table work area always has a global validity area. Even if the TABLES statement is specified in a FORM or FUNCTION , the work area is known when the subroutine has been defined. However, changes to the work area in a subroutine remain local to the FORM or FUNCTION . Therefore, it is advisable to specify the TABLES statement globally. You can keep changes to the table work area local to the subroutine with LOCAL .
Related DATA , TYPES

SAP AG 1996