SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Declarations → Declaration Statements → Data Types and Data Objects → Types and Objects - Overview → Data Objects →Alignment of Data Objects
Data objects with the following data types cannot simply be stored at random addresses in the main memory:
For example, an ABAP field with the type i must have an address divisible by four, a field with the type f or decfloat16 must have an address divisible by eight, and a field with the type decfloat34 must have an address divisible by 16. The storage address of character-like data objects must be divisible by 2 or 4, depending on the Unicode representation.
An elementary data object is aligned when it has an address that corresponds to its data type.
A structure is aligned when
The correct alignment of data objects is not normally an issue, because they are created correctly automatically in the declaration. This can lead to alignment gaps in structures with components of different data types.
However, the alignment must be checked in the following cases:
If a statement expects a particular alignment of a data object, an exception is raised if there is insufficient alignment.
Notes