This statement is not allowed in classes and declares a data object
as a table work area whose data type is taken from the identically named structured data type
table_wa in ABAP Dictionary.
table_wa must be defined as a
flat structure in ABAP Dictionary. This means either database tables or
classic views can be specified for
Table work areas declared with
interface work areas and should only be declared in the global declaration section of a program for the following purpose:
TABLESis required for exchanging data between dynpro fields defined in a program dynpro by being taken from ABAP Dictionary, and the ABAP program. For the dynpro event PBO, the content of the table work area is passed to identically named dynpro fields; for PAI, the system takes the data from identically named dynpro fields.
In executable programs,
flat table work areas can be used to copy data that is provided for the event
GET table_wafrom an associated logical database.
TABLESis synonymous with the statement
NODESfor this purpose.
Table areas declared using
NODESbehave like common data declared using the addition
COMMON PART. They are shared by the programs of a program group. This feature should not be exploited due to the reasons outlined in Program Groups in External Procedure Calls.
Table work areas declared using
TABLEScan be declared in subroutines and function modules, however this is not recommended. A table work area declared in a procedure is not local but belongs to the context of a master program. The table work area is visible as soon as the master program is declared and exists for the duration of the master program. In contrast to normal program-global data, the content of the table work areas declared in subroutines and function modules is stored temporarily when these subroutines and function modules are called. Assignments that were made during runtime of the procedure are preserved until the procedure is completed. When the procedure is exited, the table work areas are filled with the contents they contained when the procedure was called. Table work areas declared in procedures behave like global data to which the statement
LOCALis applied in the procedure.
TABLESfor interface work areas for logical databases. This makes it clear that they are nodes of logical databases.
A CDS entity of a
CDS view cannot be specified after
TABLES. A CDS database view can, however, be specified.
TABLES *is completely obsolete.