<?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: Add Value to internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961722#M1156790</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to populate the wa_itab with values you want and use append statment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;append tvbdpl to z_tvbdpl.~~ append wa_itab to itab&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2008 13:22:45 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2008-12-10T13:22:45Z</dc:date>
    <item>
      <title>Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961718#M1156786</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;How i can Add a value to internal table e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have table like that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f_name    field1&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;aaa          001
aaa          002
aaa          003
bbb          001
bbb          002
bbb          003
ccc           001
ccc           002
ccc           003&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i want to add to table new row with name and number 000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field_name    field1
aaa               000
aaa               001
aaa               002
aaa               003
bbb               000
bbb               001
bbb               002
bbb               003
ccc                000
ccc                001
ccc                002
ccc                003&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:17:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961718#M1156786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961719#M1156787</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;internal table =&amp;gt; Append or Collect itab&lt;/P&gt;&lt;P&gt;DB-table =&amp;gt; Modify table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:19:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961719#M1156787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961720#M1156788</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;take one more internal table itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of f_name.&lt;/P&gt;&lt;P&gt;itab2-fname = f_name.&lt;/P&gt;&lt;P&gt;itab2-number = '000'.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab2 from itab2.&lt;/P&gt;&lt;P&gt;sort itab2 by f_name number,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961720#M1156788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961721#M1156789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Populate the data in Itab header.Write an INSERT with index = 1. You will get the data as the first record in Itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vivekanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:22:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961721#M1156789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961722#M1156790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to populate the wa_itab with values you want and use append statment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;append tvbdpl to z_tvbdpl.~~ append wa_itab to itab&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961722#M1156790</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-12-10T13:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961723#M1156791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa-field_name ne temp.&lt;/P&gt;&lt;P&gt;wa-field1 = 000.&lt;/P&gt;&lt;P&gt;insert wa into itab index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;wa-field_name = temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:23:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961723#M1156791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961724#M1156792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       field1 type char10 ,&lt;/P&gt;&lt;P&gt;       field2 type i,&lt;/P&gt;&lt;P&gt;       end of itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = 'test1'.&lt;/P&gt;&lt;P&gt;itab-field2 = '01'.&lt;/P&gt;&lt;P&gt;append itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = 'test2'.&lt;/P&gt;&lt;P&gt;itab-field2 = '02'.&lt;/P&gt;&lt;P&gt;append itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab .&lt;/P&gt;&lt;P&gt;write:/ itab-field1 ,&lt;/P&gt;&lt;P&gt;         itab-field2 .&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961724#M1156792</guid>
      <dc:creator>former_member203501</dc:creator>
      <dc:date>2008-12-10T13:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961725#M1156793</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 doing like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: g_field1 type field1,
i_tab_temp type table of.................      "declare one more internal table like i_tab
wa_itab_temp like line of i_tab_temp.     "declare one more WA for the internal table.

loop at i_tab into wa_itab.
if g_field1 is initial.
  g_field1 = wa_itab-field1.
  wa_itab_temp-field1 = wa_itab-field1.
  wa_itab_temp-field2 =  '000'.
  append wa_tab_temp to i_tab_temp. 
endif.
if wa_tab-field1 = g_field.
   wa_itab_temp-field1 = wa_itab-field1.
  wa_itab_temp-field2 =   wa_itab-field1.
  append wa_tab_temp to i_tab_temp. 
else.
g_field1 = wa_itab-field1.
  wa_itab_temp-field1 = wa_itab-field1.
  wa_itab_temp-field2 =  '000'.
  append wa_tab_temp to i_tab_temp. 
endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i_tab_temp will be your final table if you want you can refresh i_tab.&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;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961725#M1156793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961726#M1156794</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 should consider using a table type SORTED table. Then if you use the INSERT statement, The line will be inserted into the table according to the table key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can think of appending all the lines and then later sorting the table by the 2 fields of the internal table will give you the expected result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 13:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961726#M1156794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T13:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add Value to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961727#M1156795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple way is, append the records to internal table as normal way &amp;amp; sort on the first field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get the entries in the desired format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sujatha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 14:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/add-value-to-internal-table/m-p/4961727#M1156795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T14:40:36Z</dc:date>
    </item>
  </channel>
</rss>

