Typing addition - complete_type

Syntax

... { TYPE {[LINE OF] complete_type}
         | {REF TO type} }
  | { LIKE {[LINE OF] dobj}
         | {REF TO dobj} } ...

Effect

To completely type a formal parameter or a field symbol, you can specify any non-generic type complete_type after TYPE or any data object dobj visible at this position after LIKE. complete_type can be a non-generic data type from the ABAP Dictionary, a non-generic public data type of a global class, a non-generic local program type that has already been defined with TYPES, or a non-generic, built-in ABAP type ( d, f, i, string, t, xstring). dobj is a data object that has already been declared and its bound data type is adopted. If complete_type or the data type of dobj is table-like, you can use LINE OF to refer to the appropriate row type.

REF TO types the formal parameter or field symbol as a reference variable. In this case, the same rules apply as for the definition of reference types in TYPES. Typings with TYPE REF TO data or TYPE REF TO object are also considered as complete typings.

When you assign an actual parameter or a memory area to completely typed formal parameters or field symbols, the specified data type must match the typing exactly (see Typing Check). Completely typed formal parameters and field symbols can be used in the same operand positions as data objects of the corresponding data type.

Note

Example

In the following example, field symbol is completely typed with structured data type spfli from the ABAP Dictionary, and can therefore be used like a structure of that data type.

FIELD-SYMBOLS TYPE spfli.
...
-carrid = ...