<?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 read fields from dynamic table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866884#M1322604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a BW-guy with some ABAP background, but it has been a while since I've used field symbos. I'm writing an enhancement for a BI-extractor using a badi. This is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dynamic table &lt;EM&gt;&amp;lt;t_data&amp;gt;&lt;/EM&gt; over which I need to loop to change data. The fields I need to change are in another table, &lt;EM&gt;t_fields&lt;/EM&gt;. I've written the following code, but in &lt;EM&gt;&amp;lt;fieldname&amp;gt;&lt;/EM&gt;, I get the value of &lt;EM&gt;temp&lt;/EM&gt; instead of the value in &lt;EM&gt;&amp;lt;s_data&amp;gt;-fieldname&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;    LOOP AT &amp;lt;t_data&amp;gt; INTO &amp;lt;s_data&amp;gt;.&lt;/P&gt;&lt;P&gt;      LOOP AT t_fields INTO s_fields.&lt;/P&gt;&lt;P&gt;        concatenate '&amp;lt;s_data&amp;gt;-' s_fields-fieldname into temp.&lt;/P&gt;&lt;P&gt;        ASSIGN temp TO &amp;lt;fieldname&amp;gt;.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example a possible result is:&lt;/P&gt;&lt;P&gt;&amp;lt;fieldname&amp;gt; =  '&amp;lt;s_data&amp;gt;-calday' in stead of '01.01.2009' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I've been doing wrong? Your help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jul 2009 08:27:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-08T08:27:20Z</dc:date>
    <item>
      <title>read fields from dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866884#M1322604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a BW-guy with some ABAP background, but it has been a while since I've used field symbos. I'm writing an enhancement for a BI-extractor using a badi. This is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dynamic table &lt;EM&gt;&amp;lt;t_data&amp;gt;&lt;/EM&gt; over which I need to loop to change data. The fields I need to change are in another table, &lt;EM&gt;t_fields&lt;/EM&gt;. I've written the following code, but in &lt;EM&gt;&amp;lt;fieldname&amp;gt;&lt;/EM&gt;, I get the value of &lt;EM&gt;temp&lt;/EM&gt; instead of the value in &lt;EM&gt;&amp;lt;s_data&amp;gt;-fieldname&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;    LOOP AT &amp;lt;t_data&amp;gt; INTO &amp;lt;s_data&amp;gt;.&lt;/P&gt;&lt;P&gt;      LOOP AT t_fields INTO s_fields.&lt;/P&gt;&lt;P&gt;        concatenate '&amp;lt;s_data&amp;gt;-' s_fields-fieldname into temp.&lt;/P&gt;&lt;P&gt;        ASSIGN temp TO &amp;lt;fieldname&amp;gt;.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example a possible result is:&lt;/P&gt;&lt;P&gt;&amp;lt;fieldname&amp;gt; =  '&amp;lt;s_data&amp;gt;-calday' in stead of '01.01.2009' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I've been doing wrong? Your help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 08:27:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866884#M1322604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T08:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: read fields from dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866885#M1322605</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&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT &amp;lt;t_data&amp;gt; INTO &amp;lt;s_data&amp;gt;.
   LOOP AT t_fields INTO s_fields.
       assign component s_fields-fieldname of structure &amp;lt;s_data&amp;gt; to &amp;lt;fieldvalue&amp;gt;.
      &amp;lt;fieldvalue&amp;gt; =  "...here &amp;lt;fieldvalue&amp;gt; should have '01.01.2009' 
   ENDLOOP.
ENDLOOP.
&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, 08 Jul 2009 08:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866885#M1322605</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-07-08T08:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: read fields from dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866886#M1322606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You are assinging to the temp.&lt;/P&gt;&lt;P&gt;BUt after that modify the main internal table by trtansporting the field which you have changed.&lt;/P&gt;&lt;P&gt;then only it will be updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhilash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 08:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866886#M1322606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T08:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: read fields from dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866887#M1322607</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;Please let me know if I am clear on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have two internal tables, itab1 and itab2. You would like to change the value of field (say fld1) in itab1. This fld1 value is available from fld in itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is the situation, following is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;w_tab1&amp;gt; TYPE ty_tab1.
DATA:                   w_tab2     TYPE  ty_tab2.

LOOP AT itab1 ASSIGNING &amp;lt;w_tab1&amp;gt;.
  READ TABLE itab2 into w_tab2 WITH KEY
                               fldkey = &amp;lt;w_tab1&amp;gt;-fldkey.
  IF sy-subrc EQ 0.
    &amp;lt;w_tab1&amp;gt;-fld1 = w_tab2-fld.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is it. Table itab1 will be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works or if your issue is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sourav1233 on Jul 8, 2009 2:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 08:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866887#M1322607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: read fields from dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866888#M1322608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcin, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is exactly what I wanted to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abhilash and Sourav, thanks for your replies as well. I've assigned points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 08:52:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fields-from-dynamic-table/m-p/5866888#M1322608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T08:52:30Z</dc:date>
    </item>
  </channel>
</rss>

