sapdev logo background
sapdev logo sapdev logo
Comments

ABAP TYPES LOB HANDLE Statement syntax, information and example SAP source code



Return to Statement index



TYPES - LOB HANDLE

Short Reference

ABAP Syntax_7 TYPES dtype TYPE dbtab lob_handle_type FOR lob_handle_columns
[ lob_handle_type
FOR lob_handle_columns
... ].

What does it do? Derivation of an
LOB handle structure as work area for working with streaming and locators in
Open SQL . For dbtab , you must specify a database table which is defined in the ABAP dictionary, or a view that is defined in the ABAP Dictionary.
The column specifications
lob_handle_columns are used to determine
LOB s from dbtab . The statement creates a deep structure which is constructed exactly the same for all columns which are not included in the column specification as it is for a normal TYPE reference to dbtab . For the LOB s included in the column specifications, 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 type specification
lob_handle_type , and is assigned to the respective column specification.
The combination possibilities of the additions specified at lob_handle_columns and lob_handle_type , is determined using the following rules:
An LOB handle structure can be derived for either read-only , or for write-only Open SQL statements.
  • A structure for read accesses can only contain the type specifications READER , LOCATOR , and LOB HANDLE .

  • A structure for write accesses can only contain the type specifications WRITER and LOCATOR .

  • The definition of the LOB handle components must not contain contradictions, 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 specification of

    ... lob_handle_type FOR lob_handle_columns ...

    must create a set of LOB handle components which do not overlap with the LOB handle component set of another specification.
    The definition of LOB handle components must have a minimum number of specifications. If a specification can create the same set of LOB handle components as multiple specifications, the more extensive specification 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 specification must be made.
    The type specification for the first three column specifications for LOB handle component read accesses and the first two columns for LOB handle component write accesses can not be the same.
    In each case there can only be one
    column specification ALL ... COLUMNS , in which BLOB or CLOB are specified.
    The column specifications ALL BLOB|CLOB COLUMNS include all BLOB s or CLOB s. When they are specified, you cannot also specify an individual BLOB or
    CLOB in a column specification COLUMNS ... for the same static type .
    The column specification ALL OTHER COLUMNS includes all columns that are not specified individually. ALL OTHER BLOB COLUMNS and ALL OTHER CLOB COLUMNS cannot be specified at the same time.
    The ALL COLUMNS column specification includes all LOB s and can therefore only be specified on its own.

    Latest notes: LOB handle structures can also be defined using the corresponding specification of components between
    BEGIN OF and END OF .
    LOB handle structures can also be derived in the ABAP Dictionary. A function is provided for this purpose when database tables or views that contain LOB s are displayed.
    If dbtab does not contain any LOB s that match the column specifications, no LOB handle components are created and the statement creates a normal work area.
    If dbtab is enhanced later by LOB s which match the column specifications ALL [OTHER] ... , then LOB handle components are also created for these.
    Example ABAP Coding Refer to Deriving LOB handle structures .
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    TYPES_KEYDEF
    TYPES_LOB_HANDLE_COLUMNS




    comments powered by Disqus