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 - Streaming and Locators →Open SQL - Locators
Open SQL supports locators for LOBs in database tables.
System Classes for Locators
The associated system classes for the two types of LOBs are:
The instances of the classes above belong to the LOB handles and implement the corresponding interfaces. Usage in Open SQL involves reference variables which point to the relevant LOB handles.
Important Methods
Locators contain the following methods which are implemented as kernel methods. This means that access to LOBs is completed by the ABAP runtime environment.
Methods in Both Locator Types
Methods from the IF_ABAP_CLOSE_RESOURCE interface:
Methods in Character-Like Locators
Methods in Binary Locators
Creating Locators for LOBs
A locator that is bound to an LOB, that is, an instance of the class CL_ABAP_DB_C_LOCATOR or CL_ABAP_DB_X_LOCATOR, can only be created if, in the INTO clause of the SELECT statement, an LOB from the result set is assigned to a reference variable for a locator.
Refer to SELECT - LOB Handles.
Note
The creation of locators is not possible in changing Open SQL statements. However, locators which were created in a read statement can be used to make changes.
Closing Locators
Due to high resource consumption, locators must always be closed as soon as possible using their CLOSE method. Especially when creating locators in SELECT loops, consider that locators are not closed implicitly using ENDSELECT, unlike read streams, and must be closed explicitly. Furthermore, locators are closed implicitly at the end of a database LUW.