ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Assignments →  = - Assignment Operator → 

= - Assign Data Objects

Syntax

destination = dobj.

Effect

In the simplest assignment case, a data object dobj is on the right side of the assignment operator =. This data object can be specified as described under Reader Positions. The content of the data object is assigned to the left side, destination. If necessary, type-specific conversions are made in accordance with the conversion rules. The variant shown here applies to all assignments between operands that are not reference variables. Special rules apply to reference variables.

The following can be specified for destination:

Other generic data types cannot be made concrete for the inline declaration in a useful way and produce a syntax error. An exception to this are table types that are explicitly generic with respect to their secondary table key, since these types are not relevant for the declared data object.

Notes

Example

Assigns a literal to a text string.

DATA text TYPE string.

text = `blah`.

Example

Assigns a generically typed field symbol, <fs>, to a data object, number, declared inline. In the assignment, the field symbol has the type i, however the field number is created with the type decfloat34 when the program is generated. A syntax check warning about this is hidden using the pragma ##type.

FIELD-SYMBOLS <fs> TYPE numeric.

ASSIGN 1 TO <fs>.

DATA(number) = <fs> ##type.



Exceptions

Catchable Exceptions

CX_SY_CONVERSION_NO_NUMBER

CX_SY_CONVERSION_OVERFLOW

Non-Catchable Exceptions