Ansicht
Dokumentation

ABAPTYPES_REFERRING - TYPES REFERRING

ABAPTYPES_REFERRING - TYPES REFERRING

Vendor Master (General Section)   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

TYPES, TYPE, LIKE

Short Reference



TYPES dtype ${ ${TYPE $[LINE OF$] type$}
            $| ${LIKE $[LINE OF$] dobj$}  $}.

Addition:

... LINE OF ...

Effect

By specifying a data type type or a data object dobj, dtype inherits all properties of the specified data type or data object.

  • The following can be specified for type:

  • A non-generic public type of a global class allowed by the package check

  • A non-generic data type of the same program defined previously using TYPES

  • A data object that is visible at this point can be specified for dobj. If a field symbol or formal parameter is specified for dobj, this must be completely typed. The declared type is inherited. No data object must be bound when the statement is evaluated.

If a reference is made to a data type in the ABAP Dictionary, its elementary components are transformed to built-in ABAP types in accordance with the tables of built-in types in the ABAP Dictionary.

Notes

  • A data type that is defined by a TYPE reference to another data type is a copy of this data type (possibly in a different context and with a different name). If the original type is defined in the ABAP Dictionary, its semantic properties are preserved.
  • The data objects that can be referred to with LIKE also include the public attributes of global classes.
  • A data type that is declared by a direct TYPE or LIKE reference to a boxed component inherits its data type but is not a boxed component.
  • A data type that is declared by a TYPE or LIKE reference to an enumerated type has exactly the same meaning as the enumerated type itself. The value set defined for the enumerated type is not duplicated.

Example

Definition of a local type my_scarr with the properties of the dictionary type SCARR-CARRID. The field help and input help are available for the parameter para on the selection screen.

Addition

... LINE OF ...

Effect

The optional addition LINE OF can be used if type is a table type or if dobj is an internal table. This means that dtype inherits the properties of the line type of the internal table.

Example

These TYPES statements define two data types local to the program. The first inherits a table type from a type pool of the ABAP Dictionary, and the second corresponds to the line type of this table type.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   General Material Data  
This documentation is copyright by SAP AG.

Length: 4905 Date: 20240426 Time: 162850     sap01-206 ( 66 ms )