Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Obsolete Language Elements →  Obsolete Assignments 

ASSIGN - obsolete_casting

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Obsolete Syntax

... { TYPE name }
  | { [TYPE name] DECIMALS dec } ... .



This form of the addition casting_spec for the ASSIGN statement in which you specify TYPE or DECIMALS without the CASTING addition, is not allowed in classes. Furthermore, it can neither be used together with the statement INCREMENT in mem_area nor with the addition RANGE. However, the field symbol may be typed using the obsolete addition STRUCTURE of the FIELD-SYMBOLS statement.

Addition 1

... TYPE name


After TYPE, a character-like data object name of length 1 is expected, which must contain exactly one of the case-sensitive letters "C", "D", "F", "I", "N", "P", "T", "X", "b", or "s" when the statement is executed. These letters label the respective built-in ABAP types and have the following effects:

  • If the field symbol <fs> is typed completely or in parts, the typing must match the ABAP type specified after TYPE. The assigned memory area is casted to the type of the field symbol.
  • If the field symbol is typed completely generically, the type of the assigned memory area is casted to the ABAP type specified after TYPE.


The specification of the predefined types b and s using "b" or "s" is an exception to the rule that these cannot be specified in statements, and is only permitted in these obsolete variants.

Addition 2

... DECIMALS dec


After DECIMALS, you must specify a numeric data object dec. For the casting, data type p is used; the size of the fractional portion is determined by the content of dec. You do not need to specify TYPE for DECIMALS. If you specify TYPE, name must contain data type "P", which is used anyway.


See Casting Decimal Places.