ABAP Keyword Documentation → ABAP − Short Reference
ASSIGN - Short Reference
Other versions: 7.31 | 7.40 | 7.54
Syntax
ASSIGN { dobj[+off][(len)]
| [TABLE FIELD] (name)
| dref->*
| { dobj INCREMENT inc }
| {COMPONENT comp OF STRUCTURE struc}
| oref->(attr_name)
| {class|(class_name)}=>{attr|(attr_name)}
| writable_exp }
TO <fs>
[ { CASTING [ {TYPE type|(name)}
| {LIKE dobj}
| {[TYPE p] DECIMALS dec}
| {TYPE HANDLE handle} ] }
| { {TYPE name}
| {[TYPE name] DECIMALS dec} } ]
[RANGE range].
Effect
Assigns a memory area to a field symbol <fs>
.
Additions
Specifying the memory area
-
dobj[+off][(len)]
- Data objectdobj
or its subareaoff(len)
. -
(name)
- Data object contained inname
. -
TABLE FIELD
- Obsolete: Restricts the search for the data object (contained inname
) to interface work areas declared using theTABLES
statement. -
dref->*
- De-referenced reference variable. -
dobj INCREMENT inc
- Area that is incrementedinc
times by the length ofdobj
. -
COMPONENT comp OF STRUCTURE
struct - Component
comp
of a structurestruc
. -
oref->(attr_name)
- Attribute of an object referenced byoref
, specified inattr_name
. -
{class|(class_name)}=>{attr|(attr_name)}
- Static attribute attr of the classclass
, where the attribute and class can also be specified as the content ofattr_name
andclass_name
. -
writable_exp
- Writable expression.
Specifying the data type
-
CASTING
Specifies the data type used to handle the memory area:
TYPE type|(name)
- Data typetype
, which can also be specified as the content ofname
.
LIKE dobj
- Data type of data objectdobj
.
[TYPE p] DECIMALS dec
- Data typep
, with decimal places specified indec
.
TYPE HANDLE handle
- Data type described by the type description object of RTTS thathandle
points to. -
[TYPE name] DECIMALS dec
Obsolete: Casting to an elementary ABAP type inname
or to the decimal places indec
.
Restriction of the memory area
-
RANGE range
Restricts the assignable memory area to the data objectrange
.