sapdev logo background
sapdev logo sapdev logo
Comments

ABAP ASSIGN CASTING OBSOLETE Statement syntax, information and example SAP source code



Return to Statement index



ASSIGN - obsolete_casting

Short Reference

ABAP Syntax(Obsolete) ... { TYPE name }
| { [TYPE name] DECIMALS dec } ... .

ABAP_ADDITIONS
1 ... TYPE name
2 ... DECIMALS dec

What does it do? 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.

ABAP_ADDITION_1 ... TYPE name

What does it do? 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
.
Latest notes: 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.

Example ABAP Coding See Casting Predefined Data Types .

ABAP_ADDITION_2 ... DECIMALS dec

What does it do? 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.

Example ABAP Coding See Casting Decimal Places .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




ASSIGN_CASTING
ASSIGN_CASTING_TYPE




comments powered by Disqus