<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Invalid Memory Alignment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194528#M1981117</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;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:&lt;/P&gt;
  &lt;P&gt;ASSIGN &amp;lt;fs_appl_t1&amp;gt; TO &amp;lt;fs_appl_t2&amp;gt; CASTING TYPE HANDLE lr_struct_type_hndl.&lt;/P&gt;
  &lt;P&gt;&amp;lt;fs_appl_t1&amp;gt; is a structure of type char200.&lt;/P&gt;
  &lt;P&gt;Following is the error:&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;an error occurred when setting the field symbol "&amp;lt;FS_APPL_T2&amp;gt;" with ASSIGN or ASSIGNING (maybe in the combination with the CASTING addition). When converting the base entry of field symbol "&amp;lt;FS_APPL_T2&amp;gt;" (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.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2020 12:22:54 GMT</pubDate>
    <dc:creator>ruchirsaxena</dc:creator>
    <dc:date>2020-06-10T12:22:54Z</dc:date>
    <item>
      <title>Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194528#M1981117</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;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:&lt;/P&gt;
  &lt;P&gt;ASSIGN &amp;lt;fs_appl_t1&amp;gt; TO &amp;lt;fs_appl_t2&amp;gt; CASTING TYPE HANDLE lr_struct_type_hndl.&lt;/P&gt;
  &lt;P&gt;&amp;lt;fs_appl_t1&amp;gt; is a structure of type char200.&lt;/P&gt;
  &lt;P&gt;Following is the error:&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;an error occurred when setting the field symbol "&amp;lt;FS_APPL_T2&amp;gt;" with ASSIGN or ASSIGNING (maybe in the combination with the CASTING addition). When converting the base entry of field symbol "&amp;lt;FS_APPL_T2&amp;gt;" (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.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 12:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194528#M1981117</guid>
      <dc:creator>ruchirsaxena</dc:creator>
      <dc:date>2020-06-10T12:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194529#M1981118</link>
      <description>&lt;P&gt;Alignment of data objects is explained in the ABAP documentation.&lt;/P&gt;&lt;P&gt;If those characters were initialized from a structure to a character variable using CL_ABAP_CONTAINER_UTILITIES=&amp;gt;FILL_CONTAINER_C, you may retrieve its content using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CL_ABAP_CONTAINER_UTILITIES=&amp;gt;READ_CONTAINER_C&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jun 2020 12:54:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194529#M1981118</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-06-10T12:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194530#M1981119</link>
      <description>&lt;P&gt;Thank you Sandra for responding. &lt;/P&gt;&lt;P&gt;I have gone through the SAP Help of 'Alignment of data objects', it does say, that in case of casting, the alignment needs to be checked. But provided not much info on how to check and adjust the same.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you can maybe shed some light on the same, that would be of great help. &lt;/P&gt;&lt;P&gt;I also tried to check a few notes, but it was not really of great help, &lt;/P&gt;&lt;P&gt;I am already able to retrieve the contents from standard code. I am trying to cast to a dynamic structure, which works for all other views, but this particular one (I have tried with 10-15 views complex views)&lt;/P&gt;&lt;P&gt;If you can provide a means to adjust the alignment, through code or without it, that would be of great help.&lt;/P&gt;&lt;P&gt;The structure of the dynamic type handle includes 2 nested structures, with first one filling from the aforementioned view&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;P&gt;followed by 2 structure containing 2 flags (char01).&lt;/P&gt;&lt;P&gt;What do you think?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 07:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194530#M1981119</guid>
      <dc:creator>ruchirsaxena</dc:creator>
      <dc:date>2020-06-11T07:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194531#M1981120</link>
      <description>&lt;P&gt;A nested structure doesn't imply gaps. Only a mix of character, deep and numeric types may imply gaps (with memory address alignments of 2, 4, 8 or 16 bytes).&lt;/P&gt;&lt;P&gt;I think that you should post a &lt;A href="https://stackoverflow.com/help/minimal-reproducible-example"&gt;minimal reproducible example&lt;/A&gt; so that I can analyze and answer with code corrected and solution explained.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194531#M1981120</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-06-11T08:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194532#M1981121</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;I have attached the code:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1814696-ytest-alignment-dump-reproduce.txt"&gt;ytest-alignment-dump-reproduce.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would like to point out that the view 'FINSV_MASS_CTRLC' should have data for this dump to be properly reproduced.&lt;/P&gt;&lt;P&gt;Would be of great help to get your insights. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 10:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194532#M1981121</guid>
      <dc:creator>ruchirsaxena</dc:creator>
      <dc:date>2020-06-11T10:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Memory Alignment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194533#M1981122</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;I am still not sure why casting (with data present will not work, or how to make it work,&lt;/P&gt;&lt;P&gt;but I created new data by casting with the type handle  which i earlier created within the code (no data involved), and then used CL_ABAP_CONTAINER_UTILITIES=&amp;gt;READ_CONTAINER_C on that, and it works fine. Even though my doubt persists, my issue is resolved. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 12:14:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/invalid-memory-alignment/m-p/12194533#M1981122</guid>
      <dc:creator>ruchirsaxena</dc:creator>
      <dc:date>2020-06-11T12:14:54Z</dc:date>
    </item>
  </channel>
</rss>

