<?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 Two internal tables with different structures in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623338#M1440743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have two internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Age&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 2 structure :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;age&lt;/P&gt;&lt;P&gt;branch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the table 1 has some 5 data's and table 2 is empty.&lt;/P&gt;&lt;P&gt;First i want to move that 5 data's from table 1 to table 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the branch field is same for all records. its stored in a separate field called 'Branch'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finallay i need to move that branch to internal table 2 for all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the Table 2 should has five records and each record should have the branch.Its like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name  Age Branch&lt;/P&gt;&lt;P&gt;name1 10  ECE&lt;/P&gt;&lt;P&gt;name2 10  ECE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didnt use with header line for both tables. In function module i declared as table parameter.&lt;/P&gt;&lt;P&gt;Please give me a logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helps will be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Feb 2010 13:55:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-09T13:55:15Z</dc:date>
    <item>
      <title>Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623338#M1440743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have two internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Age&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 2 structure :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;age&lt;/P&gt;&lt;P&gt;branch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the table 1 has some 5 data's and table 2 is empty.&lt;/P&gt;&lt;P&gt;First i want to move that 5 data's from table 1 to table 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the branch field is same for all records. its stored in a separate field called 'Branch'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finallay i need to move that branch to internal table 2 for all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the Table 2 should has five records and each record should have the branch.Its like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name  Age Branch&lt;/P&gt;&lt;P&gt;name1 10  ECE&lt;/P&gt;&lt;P&gt;name2 10  ECE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didnt use with header line for both tables. In function module i declared as table parameter.&lt;/P&gt;&lt;P&gt;Please give me a logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helps will be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 13:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623338#M1440743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T13:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623339#M1440744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;itab2[] = itab1[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 13:58:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623339#M1440744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T13:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623340#M1440745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The logic is quite simple. Loop at the first table, inside that loop, loop through the branches appropiate for that name and age, and for each appropiate branch append a record in the second table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623340#M1440745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623341#M1440746</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;P&gt;&lt;/P&gt;&lt;P&gt;itab2 = itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa2-brach = 'ECE'.  (wa2 is WA for ITab2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab2 transporting branch from wa2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Komal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:02:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623341#M1440746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623342#M1440747</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 itab1 into wa1.
read table itab2 into wa2.
wa2-name = wa1-name.
wa2-age = wa1-age.
append wa2 to itab2.
endloop.

clear wa1.
clear wa2.
loop at itab2 into wa2.
wa2-branch = 'ECE'.
modify itab2 transaporting wa2-branch.
endloop. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sakshi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:31:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623342#M1440747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623343#M1440748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the structure of yur both internal table is different so you can't use ITAB1[] = ITAB2[] statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this  case you have to  loop on first table then move data into second table and appned data into second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare work area for both table with like line of statement as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_itab1 like line of itab1,&lt;/P&gt;&lt;P&gt;          wa_itab2 like line of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at ita1 into wa_itab1.&lt;/P&gt;&lt;P&gt;wa_itab2-name = wa_itab1-name.&lt;/P&gt;&lt;P&gt;wa_itab2-age = wa_itab1-age.&lt;/P&gt;&lt;P&gt;wa_itab2-branch = 'ECE'.&lt;/P&gt;&lt;P&gt;append wa_itab to itab2.&lt;/P&gt;&lt;P&gt;clear wa_itab1, wa_itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:41:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623343#M1440748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623344#M1440749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the second table is empty and we only move the data of first table to second table, in this case there is no need of read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also no need of second loop because we can populate branch field in first loop itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:46:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623344#M1440749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Two internal tables with different structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623345#M1440750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks All.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 09:41:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/two-internal-tables-with-different-structures/m-p/6623345#M1440750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T09:41:53Z</dc:date>
    </item>
  </channel>
</rss>

