Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Declarations →  Declaration Statements →  Data Types and Data Objects →  Declaring Data Types →  TYPES 


Short Reference

Other versions: 7.31 | 7.40 | 7.54


TYPES dtype TYPE dbtab|view 
                 lob_handle_type FOR lob_handle_columns
                [ lob_handle_type FOR lob_handle_columns
                 ...                                   ].


Derives an LOB handle structure as a work area for working with streaming and locators in Open SQL. dbtab expects a database table defined in ABAP Dictionary or a database view defined for view in ABAP Dictionary.

The columns lob_handle_columns, when specified, are used to determine LOBs from dbtab. The statement creates a deep structure which is constructed exactly the same for all columns not included in the specified columns as it is for a regular TYPE reference to dbtab. For the LOBs included in the specified columns, a component with the same name is created as a LOB handle component. The static type of the LOB handle components is a class or an interface which is determined by the specified type lob_handle_type, and is assigned to the respective specified column.

The combinations of the additions specified under lob_handle_columns and lob_handle_type are determined using the following rules:

  • An LOB handle structure can be derived for either reading or writing Open SQL statements only.
  • A structure for writes can only contain the specified types WRITER and LOCATOR.
  • The definition of the LOB handle components must not contain contradictions, which means that columns must not be assigned to unsuitable types or a column cannot be assigned to multiple types.
  • The definition of LOB handle components must not contain redundancies. Each specified

    ... lob_handle_type FOR lob_handle_columns ...

    must create a set of LOB handle components that do not overlap with another specified set of LOB handle components.
  • The definition of the LOB handle components must be specified with as few components as possible. If the same set of LOB handle components can be specified once rather than using multiple input, the more comprehensive option must be used.

Apart from the rules listed under lob_handle_columns and lob_handle_type, there are also the following general restrictions:

  • At least one column must be specified.
  • The types specified for the first three specified column for LOB handle components for reads and the first two columns for LOB handle components for writes cannot be the same.
  • In each case there can only be one column specified ALL ... COLUMNS, in which BLOB or CLOB are specified.
  • The specified columns ALL BLOB|CLOB COLUMNS include all BLOBs or CLOBs. If they are specified, an individual BLOB or CLOB cannot also be specified in a specified column COLUMNS ... for the same static type.
  • The specified columns ALL OTHER COLUMNS include all columns that are not specified individually. ALL OTHER BLOB COLUMNS or ALL OTHER CLOB COLUMNS cannot be specified at the same time.
  • The specified columns ALL COLUMNS include all LOBs and can therefore only be specified on their own.


  • LOB handle structures can also be defined using the corresponding typing of components between BEGIN OF and END OF.
  • LOB handle structures can also be derived in ABAP Dictionary. The display of database tables or views containing LOBs includes a function for this.
  • If dbtab does not contain any LOBs that match the specified columns, no LOB handle components are created and the statement creates a normal work area.
  • If LOBs are added to dbtab that match the specified columns ALL [OTHER] ..., LOB handle components are also created for these.


TYPES - lob_handle_type

TYPES - lob_handle_columns

Deriving LOB Handle Structures - Example