Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Assignments →  Value Assignments →  MOVE 

MOVE EXACT

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


MOVE EXACT source TO destination. 

Effect

If an assignment is made between incompatible data objects, the EXACT addition for the MOVE statement ensures that the assigned content is checked before the assignment is made to establish whether a lossless assignment is possible, namely whether:

  • The value is valid for the data type of the source field
  • The assignment to the target field can result in a loss of values
  • The value is valid for the target field after conversion

If the source field contains a valid value and no values are lost, the assignment is made in exactly the same manner as without the EXACT addition. Otherwise no assignment is made. If it is statically identifiable that one of the prerequisites laid down by EXACT is not met, a syntax error occurs. If this violation is not identified until the program is executed, a handleable exception is raised. The exception class of this exception is generally a subclass of CX_SY_CONVERSION_ERROR.

The following sections outline which rules the EXACT addition considers when checking the assigned content based on the data types involved:

If an exception is raised as a result of an invalid or inappropriate value, the VALUE attribute of the exception object is assigned this value in character form; this value is generally also included in the exception text.


Notes

  • If an exception is raised when the EXACT addition is used, the statement is not executed and the value of the target field remains unchanged. In assignments made without the EXACT addition, the target field contains an undefined value when an exception is handled.
  • Since the checks for the EXACT addition are only carried out when assignments are made between incompatible data objects, we recommend that MOVE EXACT is used to populate data objects that are to be assigned valid values only. Other types of assignments that require a start value to be specified in the declaration using VALUE can generate invalid values that are then not recognized when a lossless assignment is made to a compatible target field.

Example

See Exact Assignment.

Exceptions


Catchable Exceptions

CX_SY_CONVERSION_EXACT_NOT_SUP

  • Cause: Invalid type or length combinations in MOVE EXACT.
    Runtime Error: CONVT_NOT_SUPPORTED

Continue

MOVE EXACT - Elementary Data Objects

MOVE EXACT # Structures

MOVE EXACT - Internal Tables

MOVE EXACT - Reference Variables