<?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: Need to copy data from database1 to database2 table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489239#M1256308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of internal_tab1 to internal_tabl2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data will be copied to another internal table by one above statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Apr 2009 06:11:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-30T06:11:54Z</dc:date>
    <item>
      <title>Need to copy data from database1 to database2 table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489236#M1256305</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;          Iam teed techinical fessibility to copy data from one database table to another except few fields.&lt;/P&gt;&lt;P&gt;Iam having Ztable1 with 1- 15 fields .Iam also having Ztable2 of 1- 10 fields .The difference of fields is 11-15 is missing in the table 2.so now i need to copy data of table 1-10 fields from table 1 to tables2 .The both table is having same fields from 1- 10 (fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one guide me how to code this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards with many thanks,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 02:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489236#M1256305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T02:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy data from database1 to database2 table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489237#M1256306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi All,&lt;/P&gt;&lt;P&gt;&amp;gt;           Iam teed techinical fessibility to copy data from one database table to another except few fields.&lt;/P&gt;&lt;P&gt;&amp;gt; Iam having Ztable1 with 1- 15 fields .Iam also having Ztable2 of 1- 10 fields .The difference of fields is 11-15 is missing in the table 2.so now i need to copy data of table 1-10 fields from table 1 to tables2 .The both table is having same fields from 1- 10 (fields).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Can any one guide me how to code this ?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards with many thanks,&lt;/P&gt;&lt;P&gt;&amp;gt; Sri&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi sri ram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create two internal tables for   ztable1 and ztable2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: it_tab1 type standard table of ztable1,
         wa_tab1 like line of it_tab1,
        it_tab2  type standard table of ztable2,
         wa_tab2 like line of it_tab2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get data into the first internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from ztable1 into table it_tabl1 .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after getting the data populate the data into second internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at ztable1 into wa_tab1.
move-corresponding wa_tab1 to wa_tab2.
append wa_tab2 to it_tab2.
clear wa_Tab2.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after populating update the table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;update ztable2 from table it_tab2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 02:23:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489237#M1256306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T02:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy data from database1 to database2 table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489238#M1256307</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;You have to declare one internal table(itab1) with work area(wa1)&lt;/P&gt;&lt;P&gt;of type ztable1 and another of type ztable2 suppose itab2 &lt;/P&gt;&lt;P&gt;with work area(wa2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have data present in table ztable1 then,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

select fields required from ztable1 into itab1.

loop at itab1 into wa1.

move corresponding wa1 to wa2.

append wa2 to itab2.


endloop.

modify ztable2 from itab2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 04:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489238#M1256307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T04:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need to copy data from database1 to database2 table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489239#M1256308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of internal_tab1 to internal_tabl2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data will be copied to another internal table by one above statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 06:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-to-copy-data-from-database1-to-database2-table/m-p/5489239#M1256308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T06:11:54Z</dc:date>
    </item>
  </channel>
</rss>

