<?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: Dynamically updating internal table fields. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738627#M321127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its working fine now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Dec 2006 11:29:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-26T11:29:02Z</dc:date>
    <item>
      <title>Dynamically updating internal table fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738624#M321124</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;I'm trying to update values from one internal table to another internal table for particular fields. The fields to be updates is specified in  CARRIER-FIELD_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to pick particular field value from internal table ITAB1 and update it into corresponding field of internal table ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example: if carrier-field_name has value FROMDATE, then I have to fetch value of ITAB1-FROMDATE and update it into ITAB2-FROMDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following code sniplet is written by me to do the functionality, but the statement &lt;/P&gt;&lt;P&gt;&amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt; , is not puting fetched data into internal table ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me out with this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;                            &amp;lt;fs1&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab1.&lt;/P&gt;&lt;P&gt;   LOOP AT carrier.&lt;/P&gt;&lt;P&gt;      field = carrier-field_name.&lt;/P&gt;&lt;P&gt;      CONCATENATE 'ITAB1-' field INTO val1.&lt;/P&gt;&lt;P&gt;      ASSIGN (val1) TO &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;      CONCATENATE 'ITAB2-' field INTO val2.&lt;/P&gt;&lt;P&gt;      ASSIGN val2 TO &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;     &amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;      APPEND itab2.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 10:53:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738624#M321124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T10:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically updating internal table fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738625#M321125</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;I believe you should append the record to ITAB2 out of the loop of the CARRIER table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to use ASSIGN COMPONENT in this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab1.
   LOOP AT carrier.
      field = carrier-field_name.
      ASSIGN COMPONENT FIELD OF STRUCTURE ITAB1 TO &amp;lt;FS&amp;gt;.
      IF SY-SUBRC = 0.
         ASSIGN COMPONENT FIELD OF STRUCTURE ITAB2 TO &amp;lt;FS1&amp;gt;.
         IF SY-SUBRC = 0.
            &amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt;.
         ENDIF.
      ENDIF.
    ENDLOOP.
    IF NOT ITAB2 IS INITIAL.
      APPEND itab2.
    ENDIF
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 11:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738625#M321125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically updating internal table fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738626#M321126</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;try this code,u'll surely get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;carrid like sflight-carrid,&lt;/P&gt;&lt;P&gt;connid like sflight-connid,&lt;/P&gt;&lt;P&gt;fldate like sflight-fldate,&lt;/P&gt;&lt;P&gt;end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of carrier occurs 0,&lt;/P&gt;&lt;P&gt;field_name like sflight-fldate,&lt;/P&gt;&lt;P&gt;end of carrier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of itab2 occurs 0,&lt;/P&gt;&lt;P&gt;carrid like sflight-carrid,&lt;/P&gt;&lt;P&gt;connid like sflight-connid,&lt;/P&gt;&lt;P&gt;fldate like sflight-fldate,&lt;/P&gt;&lt;P&gt;end of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose if the field is fldate,then itab2 will be updated by fldate field with data taken from itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;carrier-field_name = 'fldate'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select carrid connid fldate from sflight into table itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case carrier-field_name.&lt;/P&gt;&lt;P&gt;when 'fldate'.&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;itab2-fldate = itab1-fldate.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowjanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 11:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738626#M321126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T11:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically updating internal table fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738627#M321127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its working fine now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 11:29:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-updating-internal-table-fields/m-p/1738627#M321127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T11:29:02Z</dc:date>
    </item>
  </channel>
</rss>

