<?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: appending dynamic table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506198#M1559018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the same code and worked fine with out any performance issues. I was abit apprensive because of nested loops and modifying the database table. It worked fine for me without any issues. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Dec 2010 21:21:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-12-08T21:21:53Z</dc:date>
    <item>
      <title>appending dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506194#M1559014</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 am working on appending a dynamic internal table.  In the table s_brd5 there are three records 101, 102 and 103. But &amp;lt;fs_table&amp;gt; gets three records all with 103. Rest of the components are all coming correctly. It seems the last record is overwriting them all. Any thoughtsabout corrections? I am not getting errors but the appending is not happening correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code goes ike this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols: &amp;lt;gi_data&amp;gt; TYPE STANDARD TABLE,
               &amp;lt;fs_table&amp;gt; TYPE STANDARD TABLE.
               &amp;lt;fs_wa&amp;gt; type any,
               &amp;lt;fs_var&amp;gt; type any.

 loop at s_brd5.
     loop at &amp;lt;gi_data&amp;gt; assigning &amp;lt;fs_wa&amp;gt;.
       assign component 4 of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_var&amp;gt;.
*       if sy-subrc = 0.
         &amp;lt;fs_var&amp;gt; = s_brd5-low.
*       endif.
       assign component 12 of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_var&amp;gt;.
       &amp;lt;fs_var&amp;gt;+2(8) = s_brd5-low.
*       append &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_table&amp;gt;.
       endloop.
       append &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_table&amp;gt;.
endloop.
modify &amp;lt;tablename&amp;gt; from table &amp;lt;fs_table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use code tags&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Dec 6, 2010 4:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 21:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506194#M1559014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T21:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: appending dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506195#M1559015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I did something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;go_struct ?= cl_abap_typedescr=&amp;gt;describe_by_name( v_tabname ) .
  TRY.
      CALL METHOD cl_abap_tabledescr=&amp;gt;create
        EXPORTING
          p_line_type  = go_struct
          p_table_kind = 'S'
        RECEIVING
          p_result     = go_table.
    CATCH cx_sy_table_creation .
*MESSAGE e000 WITH text-004.
  ENDTRY.
* creating internal table of table type just created
  CREATE DATA gi_data TYPE HANDLE go_table.
* Assigning the internal table to field symbol
  ASSIGN gi_data-&amp;gt;* TO &amp;lt;gi_data&amp;gt;.
  ASSIGN gi_data-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.

  concatenate 'objid' 'EQ' p_brd5 into i_query-line separated by space.
  append i_query.

** get the data into the internal table from db table
      SELECT * INTO TABLE &amp;lt;gi_data&amp;gt; FROM (v_tabname) where (i_query).
**** get the  ids from HRP1000
   *loop at s_brd5.*    
 loop at &amp;lt;gi_data&amp;gt; assigning &amp;lt;fs_wa&amp;gt;.
       assign component 4 of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_var&amp;gt;.
*       if sy-subrc = 0.
         &amp;lt;fs_var&amp;gt; = s_brd5-low.
*       endif.
*       unassign: &amp;lt;fs_wa&amp;gt;, &amp;lt;fs_var&amp;gt;.
       assign component 12 of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_var&amp;gt;.
       &amp;lt;fs_var&amp;gt;+2(8) = s_brd5-low.
*       append &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_table&amp;gt;.
       endloop.
       append &amp;lt;fs_table&amp;gt;.
   endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is for every record in s_brd5, replace the id and create a new record in &amp;lt;fs_table&amp;gt;. for three records 101, 102 and 103 I need to have just three records in the table &amp;lt;fs_table&amp;gt;. It is not happening that way.  Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the code tags now. Thanks Rob..&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 21:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506195#M1559015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T21:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: appending dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506196#M1559016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to do the append &amp;lt;fs_table&amp;gt; unless you want to add an extra row, and you don't need a modify statement either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you just want to modify existing rows then you just assign the field symbol and make the change:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
       assign component 4 of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs_var&amp;gt;.
       if sy-subrc = 0.
         &amp;lt;fs_var&amp;gt; = s_brd5-low.
       endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always check that the assignment was successful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 22:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506196#M1559016</guid>
      <dc:creator>alex_cook</dc:creator>
      <dc:date>2010-12-06T22:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: appending dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506197#M1559017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ultimate goal is to update the database table.  I am aware that I can do it here one at a time. But i puts a lot of stress on the data base and since I am using nested loops, might cause a performance issue. Hence I am trying to collect all the records in &amp;lt;fs_table&amp;gt; for all the values from 's_brd' and then use modify statement that updates all the records at one go..  I have to use the dynamic process here because I shall not know the table until run time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence if there is a way to append the records into &amp;lt;fs_table&amp;gt; through the process, it shall be helpful. Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 23:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506197#M1559017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T23:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: appending dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506198#M1559018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the same code and worked fine with out any performance issues. I was abit apprensive because of nested loops and modifying the database table. It worked fine for me without any issues. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Dec 2010 21:21:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/appending-dynamic-table/m-p/7506198#M1559018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-08T21:21:53Z</dc:date>
    </item>
  </channel>
</rss>

