Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Declarations →  Declaration Statements →  Data Types and Data Objects →  Types and Objects - Overview →  Data Objects →  Alignment of Data Objects 

Alignment of Character-Like Data Objects

In Unicode systems, in addition to alignment requirements for numeric data objects of types i, decfloat16, decfloat34, f, s, and of deep data objects, all character-like data types in Unicode systems are also affected. The alignment is determined by the length requirement of a character in the memory.

As a consequence, in structures with components of different data types, the alignment gaps in Unicode systems may be different to those in non-Unicode systems. For enhancements between structures, the Unicode fragment view concept has been introduced here, which divides a structure into fragments according to its alignment gaps.

Other versions: 7.31 | 7.40 | 7.54


Example

In the following structure, alignment gaps (A) occur in Unicode systems that are not present in non-Unicode systems. The first alignment gap is formed as a result of the alignment of the substructure struc2, the second due to the alignment of the component c of type c>, and the third is due to the component d of type i.

DATA: 
  BEGIN OF struc1, 
    a TYPE x LENGTH 1, 
    BEGIN OF struc2, 
      b TYPE x LENGTH 1, 
      c TYPE c LENGTH 6, 
    END OF struc2, 
    d    TYPE i, 
  END OF struc1.

Non-Unicode system [ a | b | cccccc | dddd ]
Unicode system       [ a | A | b | A | cccccccccccc | AA | dddd ]