SAP SELECT CREATING ABAP Statements Get Example source ABAP code based on a different SAP table
ABAP Statement
• CREATING SELECT INTO
• FOR COLUMNS SELECT INTO
• LOCATOR FOR SELECT INTO
• READER FOR SELECT INTO
• ALL OTHER COLUMNS SELECT INTO
• ALL BLOB COLUMNS SELECT INTO
• ALL CLOB COLUMNS SELECT INTO
SELECT>, CREATING> Short Reference > ABAP_SYNTAX ... CREATING ${ READER$|LOCATOR FOR ${ COLUMNS blob1 blob2 ... clob1 clob2 ... $} $| ${ ALL $[OTHER$] $[BLOB$|CLOB$] COLUMNS $} $[READER$|LOCATOR FOR ...$] $}> $| ${ (crea_syntax) $} ...> ABAP Addition 1 ... READER$|LOCATOR> 2 ... $[ALL $[OTHER$] $[BLOB$|CLOB$]$] COLUMNS $[blob1 blob2 ... clob1 clob2 ...$]> 3 ... (crea_syntax)> What does it do? The addition CREATING> must be specified after INTO>> or APPENDING>> when a reference variable for a LOB handle> is assigned to a LOB> of the result set as a target field and the static type> of this reference variable is one of the following three LOB interfaces>: IF_ABAP_DB_LOB_HANDLE>> IF_ABAP_DB_CLOB_HANDLE>> IF_ABAP_DB_BLOB_HANDLE>> The specifications after CREATING> determine the class from which the associated LOB handles are created. For all other possible static types, the class can be determined from the static type and the LOB type. CREATING> cannot be specified in this case. The CREATING> addition can be specified either statically or dynamically. In the static variant, the class and columns are determined using additions. In the dynamic variant, the syntax of the static variants is specified in crea_syntax>. The syntax and the rules for the additions after CREATING> correspond to the type and columns specified for the derivation of LOB handle structures with TYPES>>. Unlike the statement TYPES>>, the type specified> is limited here to READER> and LOCATOR>, and only components that are typed with a LOB interface are respected. The types specified for the first two specifications after CREATING> must be different. Latest notes: The addition CREATING> cannot be used in combination with SQL expressions that return LOBs>. It can only be used with LOB fields directly. NON_V5_HINTS ABAP_HINT_END ABAP Addition What does it do? These additions determine the LOB handle class for each of the columns specified after it. READER> creates reader streams> for all of the columns specified. LOCATOR> creates locators> for all of the columns specified after it. The assignment to the classes is the same as the type specified> in the derivation of a LOB handle structure using TYPES>>, except that here it is the dynamic type> that is determined and not the static type. ABAP_EXAMPLE_VX5 After a row is read, the dynamic type of reader> is CL_ABAP_DB_X_READER>. ABEXA 00600 ABAP_EXAMPLE_END ABAP Addition $[blob1 blob2 ... clob1 clob2 ...$]> What does it do? These additions assign the previous type specifications to the columns of the result set. The meaning of the additions is the same as the columns specified> in the derivation of an LOB handle structure using TYPES> >. The difference is that the set of columns used consists exactly of those columns from the result set that were assigned to a reference variable whose static type is an LOB interface >: Individual columns for which this is not the case must not be specified. The specification of ALL ... COLUMNS> only respects such columns. The combination options for columns specified with one another and with types specified are the same as for TYPES >>. Specifically, the column specified as ALL OTHER ...> must be the last column specified. Latest notes: The specification of ALL ... COLUMNS> also respects columns which are added by later enhancements to the data sources. The actual names must be used for the columns specified as blob1>, blob2>, clob1>, clob2>, .... The alias names defined using AS>> are ignored. Columns of the type GEOM_EWKB>> are not supported as BLOBs>. NON_V5_HINTS The columns cannot be specified using path expressions>. ABAP_HINT_END ABAP_EXAMPLE_VX5 Like the previous example, but the column PICTURE> is selected automatically here. ABEXA 00601 ABAP_EXAMPLE_END ABAP Addition What does it do? As an alternative to static variants, a data object crea_syntax> can be specified in parentheses which contains the syntax of the static additions or is initial when executing the statement. The same applies to crea_syntax> as to column_syntax> when specifying columns dynamically in the SELECT> list>. If the content of crea_syntax> is initial, the addition CREATING> is ignored. ABAP_EXAMPLE_VX5 Like the previous example, but the items after CREATING> are specified dynamically here. ABEXA 00602 ABAP_EXAMPLE_END Return to menu