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 prerequisites apply to the work area or row type of the internal table; if the prerequisites are ignored, a syntax error occurs or an exception is raised.

Work Areas without Reference Variables for LOB Handles

The following rules apply to work areas that do not contain reference variables for LOB Handles:

Note

The work area or row structure of the internal table should always be built like the database structure. If a single data source is used in the Open SQL statement, a data object built in the same way can be declared with reference to the relevant structure in ABAP Dictionary. If more than one data source is used (in the statement SELECT), a data object built in the same way can be built as a nested structure, which contains, as substructures, the structures of the single data sources in the order specified in the statement. No structure should be used, in which all components are on one level, because potential alignment gaps between the single data sources are ignored.

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 data source and all components except for the LOB handle components must be compatible with the corresponding components of the data source. 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 statement FETCH, no LOB handle structures can currently be specified.