<?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 Problem with assign component in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498647#M1558136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with assign component &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its working and when subrc = 0 it moves the value to the right &lt;/P&gt;&lt;P&gt;field but the problem is the in the second time (subrc = 0.)&lt;/P&gt;&lt;P&gt;its overite the field with wrong value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i miss here ? i want to assign the right fiels value &lt;/P&gt;&lt;P&gt;to the suitable field in &amp;lt;ls_attr_structure&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_mapping INTO ls_mapping.
      ASSIGN COMPONENT ls_mapping-target_field OF STRUCTURE &amp;lt;ls_attr_structure&amp;gt;
      TO &amp;lt;lv_root_attr&amp;gt;.
      IF sy-subrc = 0.
       &amp;lt;ls_attr_structure&amp;gt; = ls_mapping-field_value.
      ENDIF.
    ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the structure and field are type any .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alex Dean on Nov 17, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 07:42:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-17T07:42:51Z</dc:date>
    <item>
      <title>Problem with assign component</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498647#M1558136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with assign component &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its working and when subrc = 0 it moves the value to the right &lt;/P&gt;&lt;P&gt;field but the problem is the in the second time (subrc = 0.)&lt;/P&gt;&lt;P&gt;its overite the field with wrong value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i miss here ? i want to assign the right fiels value &lt;/P&gt;&lt;P&gt;to the suitable field in &amp;lt;ls_attr_structure&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_mapping INTO ls_mapping.
      ASSIGN COMPONENT ls_mapping-target_field OF STRUCTURE &amp;lt;ls_attr_structure&amp;gt;
      TO &amp;lt;lv_root_attr&amp;gt;.
      IF sy-subrc = 0.
       &amp;lt;ls_attr_structure&amp;gt; = ls_mapping-field_value.
      ENDIF.
    ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the structure and field are type any .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alex Dean on Nov 17, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498647#M1558136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T07:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with assign component</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498648#M1558137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are assigning value to whole structure&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;ls_attr_structure&amp;gt; = ls_mapping-field_value.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and should be only to component&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   &amp;lt;lv_root_attr&amp;gt; = ls_mapping-field_value.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:48:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498648#M1558137</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-11-17T07:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with assign component</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498649#M1558138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First time it will work fine but second time you are using the same field symbol which is holding the Previous entry. So after you check SY-SUBRC store the value some where else (Append to an internal table) then use the field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using the same field symbol for eack record in the LOOP and not saving that entry to any of the global variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to save the Field symbol values to an internal table and do the coding accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:52:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-assign-component/m-p/7498649#M1558138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-17T07:52:15Z</dc:date>
    </item>
  </channel>
</rss>

