SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Casting Field Symbols
Previously, when you used the ASSIGN feld TO
The length check that was carried out has been tightened in the syntax check in such a way, the the statement is only permitted, if the feld field is at least the same length as the type that is assigned to the field symbol <f>, on Unicode as well as non-Unicode systems. If this condition is not met a syntax error occurs. At runtime the system, as before, only checks that the lengths in the current system match.
If either feld or <f> had a deep structure type, the system also checked that the type and offset of all the reference-type components in <f> matched those in the assigned range in feld. (The term "reference type components" includes object references, field references, tables, and strings). The check of reference-type components has been tightened in the syntax check in such a way that the reference components must match on all platforms. A platform can contain characters one, two, or four bytes in length. At runtime the system, as before, only checks that the reference components in the current system match.
When you use the following statements on a Unicode system, it can happen that the length of str is not a multiple of the character length. This causes a runtime error.
ASSIGN str TO <f> TYPE 'C'|'N'
ASSIGN str TO <f> CASTING TYPE C|N