AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - ABAP Release News → News for ABAP Release 7.5x → News for ABAP Release 7.53 →
Assignments in ABAP Release 7.53
Modification
Convertibility of Structures
The conversion rules for flat structures are based on their fragment views, where each alignment gap is considered as a fragment. Alignment gaps arise from the alignment requirements of the component's data types. For character-like components, the alignment requirement depends on the character representation:
Before only Unicode systems were supported, the conversion rules for structures had to take all possible alignment requirements for characters into account, regardless of the actual length of a character in its character representation.
Meanwhile, only Unicode systems are supported. The system codepage is UTF-16 and its subset UCS-2 is supported in ABAP language. Any character is represented by 2 bytes and the alignment requirement is always a divisibility by 2.
Because of this, the conversion rules for flat structures can be less strict than before and the new determination of possible alignment gaps was introduced in ABAP release 7.53. For example, the following assignment between two flat structures was not possible before ABAP release 7.53 but is possible now.
TYPES:
BEGIN OF incl1,
num TYPE i,
c2 TYPE c LENGTH 2,
END OF incl1.
DATA:
BEGIN OF struc1,
c1 TYPE c LENGTH 2.
INCLUDE TYPE incl1.
DATA:
c3 TYPE c LENGTH 2,
END OF struc1.
DATA:
BEGIN OF struc2,
c1 TYPE c LENGTH 2,
num TYPE i,
c2 TYPE c LENGTH 2,
c3 TYPE c LENGTH 2,
END OF struc2.
struc1 = struc2.
In the included substructure incl1, the character component has the same alignment as the integer component and there is no alignment gap. But as long as non-Unicode Systems were supported, an alignment gap had to be assumed behind the included structure in order to make the program executable in Unicode systems as well as in non-Unicode Systems.
Hint
When downporting programs from higher to lower releases, syntax errors might occur in the lower releases because of the stricter rules there.