SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Predefined Types, Data Objects, Functions, and Constructors →Constructor Operators for Constructor Expressions
Syntax
... NEW| VALUE| CONV| CAST| REF| EXACT| COND|SWITCH type( ... ) ...
Effect
A constructor expression consists of a
Each constructor expression generates a result whose data type is determined using the specified type. The parameters specified in parentheses are used to pass input values. The following constructor operators exist:
A constructor expression can be specified in general expression positions and functional positions with an appropriate operand type. The result is used here as an operand. In a calculation expression or relational expression, the specified type type is incorporated into the calculation type or comparison type. An expression with the operator VALUE that is not used to generate an initial value cannot be specified directly in an arithmetic expression. This is because it never matches the operand type here. Expressions with the operators NEW and CAST can be positioned directly before the object component selector -> and can occur in chainings.
Visible, usable data types and classes can be specified for type in the current position. This includes predefined ABAP type, types defined using TYPES, types from ABAP Dictionary, and both local and global classes.
If the data type required in an operand position is unique and fully recognizable, the # character can be used instead of an explicitly specified type type and the operand type is used. If REF is used, # can be specified for non-unique operand types as well. In the case of EXACT, the operand type can also be generic.
Note
The constructor operators can be classified as follows: