<?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 Re: Assign structure error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-structure-error/m-p/11116750#M1904429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are creating the HASH table without unique key, it is using all fields as the key fields. It is running into issues, because you are changing the field which is part of the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix - You need to define the type with specific key fields or create the Standard table instead of the Hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on Primary key of the table : &lt;A href="http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm" title="http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm"&gt;http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on Collect (see below for Hash table)&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_702/en/abapcollect.htm" title="http://help.sap.com/abapdocu_702/en/abapcollect.htm"&gt;http://help.sap.com/abapdocu_702/en/abapcollect.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;If a standard table is still filled using &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;, it should not be edited using any other statement, with the exception of &lt;/SPAN&gt;&lt;A class="blue" style="color: #000080; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold;"&gt;MODIFY&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;. If the latter is used with the addition &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;TRANSPORTING&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;, you must ensure that no primary key fields are changed. This is the only way to ensure that the table entries are always unique and compressed, and that the &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt; statement runs efficiently. The function module &lt;/SPAN&gt;&lt;SPAN class="lnkgrey" style="color: #606060; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;ABL_TABLE_HASH_STATE&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt; can be used to check whether a standard table is suitable for editing using &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 May 2015 17:08:13 GMT</pubDate>
    <dc:creator>naimesh_patel</dc:creator>
    <dc:date>2015-05-11T17:08:13Z</dc:date>
    <item>
      <title>Assign structure error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-structure-error/m-p/11116749#M1904428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error : ST22&lt;BR /&gt; Field "&amp;lt;ZSORD&amp;gt;" was to assigned a new value but this field is at least&lt;BR /&gt;&amp;nbsp; partly&lt;BR /&gt; protected against changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Explanation : &lt;/P&gt;&lt;P&gt;I am getting a&amp;nbsp; dynamic table as input at run time for the fm.So I am passing this table in the changing parameter as&lt;/P&gt;&lt;P&gt;ct_package type standard table.&lt;/P&gt;&lt;P&gt;And my requirement is to do some calculations and finally modify/update this table and send it back to the caller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&amp;nbsp;&amp;nbsp;&amp;nbsp; cr TYPE REF TO data.&lt;/P&gt;&lt;P&gt;Field symbols : &amp;lt;fs1&amp;gt; type any,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fs2&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; CREATE DATA cr LIKE LINE OF ct_package.&lt;BR /&gt;&amp;nbsp; ASSIGN cr-&amp;gt;* TO &amp;lt;fs1&amp;gt;.&lt;BR /&gt;&amp;nbsp; ASSIGN cr-&amp;gt;* TO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CREATE DATA cr LIKE HASHED TABLE OF &amp;lt;fs1&amp;gt; WITH UNIQUE DEFAULT KEY.&lt;BR /&gt;&amp;nbsp; ASSIGN cr-&amp;gt;* TO &amp;lt;ltab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOOP AT CT_PACKAGE assigning &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;doing some calculations...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COLLECT &amp;lt;fs1&amp;gt; INTO &amp;lt;ltab&amp;gt;.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Loop at &amp;lt;ltab&amp;gt; assigning &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING &amp;lt;fs1&amp;gt; TO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'ZSALEORD' OF STRUCTURE &amp;lt;fs1&amp;gt; TO &amp;lt;zsord&amp;gt;.&lt;BR /&gt;ASSIGN COMPONENT 'ZCURR' OF STRUCTURE &amp;lt;fs2&amp;gt; TO &amp;lt;zCURR&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* I got the value in &amp;lt;ZSORD&amp;gt; as 73737 but I am trying to change it.Here I am getting dump&lt;BR /&gt;&amp;lt;zsord&amp;gt; = '12323'.&lt;/P&gt;&lt;P&gt;* I got the value in &amp;lt;ZCURR&amp;gt; as INR but I am trying to change it.Here I am getting dump&lt;BR /&gt;&amp;lt;zcurr&amp;gt; = 'USD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; APPEND &amp;lt;fs2&amp;gt; TO ct_package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please help in following.&lt;BR /&gt;1) Is the way I am declaring for referring dynamic tables is right or should I use different approach&lt;BR /&gt;2) Please tell me why I am not able to pass a value to &amp;lt;zsord&amp;gt; and &amp;lt;ZCURR&amp;gt;, if that is not possible then please advice&lt;BR /&gt;how to acheive that and add the records to ct_package.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 14:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-structure-error/m-p/11116749#M1904428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-05-11T14:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Assign structure error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-structure-error/m-p/11116750#M1904429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are creating the HASH table without unique key, it is using all fields as the key fields. It is running into issues, because you are changing the field which is part of the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix - You need to define the type with specific key fields or create the Standard table instead of the Hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on Primary key of the table : &lt;A href="http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm" title="http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm"&gt;http://help.sap.com/abapdocu_702/en/abaptypes_primary_key.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on Collect (see below for Hash table)&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_702/en/abapcollect.htm" title="http://help.sap.com/abapdocu_702/en/abapcollect.htm"&gt;http://help.sap.com/abapdocu_702/en/abapcollect.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;If a standard table is still filled using &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;, it should not be edited using any other statement, with the exception of &lt;/SPAN&gt;&lt;A class="blue" style="color: #000080; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold;"&gt;MODIFY&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;. If the latter is used with the addition &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;TRANSPORTING&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;, you must ensure that no primary key fields are changed. This is the only way to ensure that the table entries are always unique and compressed, and that the &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt; statement runs efficiently. The function module &lt;/SPAN&gt;&lt;SPAN class="lnkgrey" style="color: #606060; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;ABL_TABLE_HASH_STATE&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt; can be used to check whether a standard table is suitable for editing using &lt;/SPAN&gt;&lt;SPAN class="qtext" style="font-family: 'Courier New'; font-weight: bold; color: #000000; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;COLLECT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial; font-size: 12.8000001907349px; background-color: #f2f4f7;"&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 17:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-structure-error/m-p/11116750#M1904429</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2015-05-11T17:08:13Z</dc:date>
    </item>
  </channel>
</rss>

