ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL → 

Open SQL - Work Areas in Statements

If in the Open SQL statements

work areas wa or internal tables itab are specified as the target or source areas, the following prequisites apply to the work area or row type of the internal table; if the prerequisites are ignored, a syntax error or an exception will occur.

Work Areas without Reference Variables for LOB Handles

The following rules apply to work areas that do not contain reference variables for LOB Handles. The first two points are minimum prerequisites that were replaced in Unicode programs or in the handling of strings in database tables through stricter requirements:

Note

The work area or row structure of the internal table should always be built like the database structure. If you work in the Open SQL statement with a single database table or one view, a data object built the same way can be declared with reference to the relevant structure in the ABAP Dictionary. If you work with more than one database table (in the SELECT statement), a data object built the same way can be built as nested structure, which contains, as substructures, the structures of the single database tables or views in the sequence in which they are listed in the statement. No structure should be used in which all components lie on one level, as possible alignment gaps between the single database tables or views are not taken into account.

LOB Handle Structures

If a work area is an LOB handle structure, that is, it contains at least one reference variable for LOB handles, it must be structured exactly like the structure of the database table and all components except for the LOB handle components must be compatible with the corresponding components of the database table. The static type of each LOB handle component must contain the IF_ABAP_DB_LOB_HANDLE interface and match both the current statement and the data type of the assigned LOB.

Note

In the FETCH statement, no LOB handle structures can currently be specified.