Skip to Content
0
Jun 10, 2020 at 12:22 PM

Invalid Memory Alignment

207 Views Last edit Jun 11, 2020 at 11:01 AM 4 rev

Hi,

I have created a dynamic structure using RTTS for the view 'FINSV_MASS_CTRLC', and at the same time, dynamically appended 2 single character flags to the structure to create a type handle for casting.

I have used the same code for several other views, and never faced any issue. It ran fine for this view as well for the first run (. After that I filled the View (earlier empty) with data , and now the following statement is throwing dump:

ASSIGN <fs_appl_t1> TO <fs_appl_t2> CASTING TYPE HANDLE lr_struct_type_hndl.

<fs_appl_t1> is a structure of type char200.

Following is the error:

  • an error occurred when setting the field symbol "<FS_APPL_T2>" with ASSIGN or ASSIGNING (maybe in the combination with the CASTING addition). When converting the base entry of field symbol "<FS_APPL_T2>" (number in base table: 32781), the system detected that the target type requires memory alignment 4. The source data object has an invalid memory alignment however, as it is not divisible by 4. If you want to assign a subfield of a structure to a field symbol for example, the offset from the start of the structure should be a multiple of 4. The structure should also contain a type that has at least the alignment 4.

I do not have much knowledge on memory alignment yet. I went through a few a question on the same, but it did not make a lot of sense to me. Any help is deeply appreciated.