ABAP Keyword Documentation → ABAP - Reference → Obsolete Language Elements → Obsolete Processing of Internal Data → Obsolete Assignments
MOVE
Other versions:
7.31 | 7.40 | 7.54
Obsolete Syntax
MOVE {[EXACT] source TO destination}
| { source ?TO destination}.
Variants
1. MOVE [EXACT] source TO destination.
2. MOVE source ?TO destination.
Effect
Obsolete form of the assignment of data objects and
reference variables source
to target variables destination
. As well as data objects, the following can also be specified for source
:
The following cannot be specified with MOVE
:
-
Constructor expressions,
table expressions, and
calculation expressions for
source
-
An inline declaration
DATA(var)
or a writable expression fordestination
.
Notes
-
Instead of
MOVE
, only the more general assignment operators=
and?=
should be used. -
The option to specify function methods and some predefined functions as assignment sources was added
to the source position of the statement
MOVE
(originally designed only for assigning data objects), which made this source position an extended functional operand position. This does not, however, cover all the possible functions of assignment operators. New developments, such as specifying constructor expressions, table expressions, or inline declarations are now only made possible for assignment operators.
Variant 1
MOVE [EXACT] source TO destination.
Effect
Without the addition EXACT
, this statement works in the same way as
destination = source.
If the addition EXACT
is specified, the statement works like
destination = EXACT #( source ).
In this way, the addition EXACT
produces a
lossless assignment in accordance with the rules that apply when using the
lossless operator
EXACT
. This
can raise exceptions if values are lost or if they are invalid. If an exception is raised when the operator
EXACT
is used, the statement is not executed and the value of the target
field remains unchanged. In assignments made without the operator EXACT
, the target field contains an undefined value when an exception raised by the conversion is handled.
Variant 2
MOVE source ?TO destination.
Effect
This statement works in the same way as
destination ?= source.
source
and destination
must have reference types. The addition ?TO
makes
down casts possible, whereas in TO
only
up casts can be used.