SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Accesses → Open SQL → Open SQL - Read Accesses → SELECT → SELECT - INTO →SELECT - LOB Handles
In the statement SELECT , LOB handles can be created as reader streams and as locators.
Prerequisites
An LOB from the result set can be assigned to an LOB handle component of a work area, or to an individual reference variable for an LOB handle. The static type of all LOB handle components must contain the interface IF_ABAP_DB_LOB_HANDLE and match the corresponding database table component, that means they must be less specific or the same as one of the following system classes for streaming or locators:
The stream type or locator type must match the data type of the LOBs.
Rules
If an LOB from the result set of a selection is assigned to an LOB handle component of a work area or to an individual reference variable for an LOB handle, either
and after the execution of the SELECT statement the reference variable points to the object. The class used is determined using the data type of the result set column and the static type of the target variable, or using the addition CREATING if required. The LOB to be read can be evaluated or forwarded using LOB handle methods.
A LOB handle created in this way, that is a reader stream or a locator, exists until it:
Reader streams, but not locators, are also closed implicitly by the statement ENDSELECT .
Accessing a closed LOB handle leads to a runtime error.
Special properties of open reader streams and locators:
Restrictions
The following restrictions apply:
Note
Always close a LOB handle as soon as possible using its method CLOSE. Also refer to Streaming and Locators.
Examples