<?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: Implement a UNION clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856907#M1475065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, try the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert ztable from table table1.&lt;/P&gt;&lt;P&gt;insert ztable from table table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           or &lt;/P&gt;&lt;P&gt;collect both the 2 table values in on iternal table and insert it.&lt;/P&gt;&lt;P&gt;insert ztable from table table3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vallamuthu.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Apr 2010 09:52:35 GMT</pubDate>
    <dc:creator>vallamuthu_madheswaran2</dc:creator>
    <dc:date>2010-04-27T09:52:35Z</dc:date>
    <item>
      <title>Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856906#M1475064</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;My requirement is simple.&lt;/P&gt;&lt;P&gt;I want a Z table which combines the distinct Cost Center and Employee Pernr combination from two tables into one ztable.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;table 1..................................&lt;/P&gt;&lt;P&gt;Cost Center         Pernr&lt;/P&gt;&lt;P&gt;A                         emp1&lt;/P&gt;&lt;P&gt;A                         emp2&lt;/P&gt;&lt;P&gt;A                         emp3&lt;/P&gt;&lt;P&gt;B                         emp1&lt;/P&gt;&lt;P&gt;C                         emp3&lt;/P&gt;&lt;P&gt;table 2.................................&lt;/P&gt;&lt;P&gt;Cost Center         Pernr&lt;/P&gt;&lt;P&gt;A                         emp3&lt;/P&gt;&lt;P&gt;B                         emp1&lt;/P&gt;&lt;P&gt;B                         emp2&lt;/P&gt;&lt;P&gt;B                         emp3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resultant ZTable.................&lt;/P&gt;&lt;P&gt;Cost Center         Pernr&lt;/P&gt;&lt;P&gt;A                         emp1&lt;/P&gt;&lt;P&gt;A                         emp2&lt;/P&gt;&lt;P&gt;A                         emp3&lt;/P&gt;&lt;P&gt;B                         emp1&lt;/P&gt;&lt;P&gt;B                         emp2&lt;/P&gt;&lt;P&gt;B                         emp3&lt;/P&gt;&lt;P&gt;C                         emp3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL a simple UNION clause will do the trick, but in ABAP i am not able to achieve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 08:10:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856906#M1475064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T08:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856907#M1475065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, try the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert ztable from table table1.&lt;/P&gt;&lt;P&gt;insert ztable from table table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           or &lt;/P&gt;&lt;P&gt;collect both the 2 table values in on iternal table and insert it.&lt;/P&gt;&lt;P&gt;insert ztable from table table3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vallamuthu.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 09:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856907#M1475065</guid>
      <dc:creator>vallamuthu_madheswaran2</dc:creator>
      <dc:date>2010-04-27T09:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856908#M1475066</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; In SQL a simple UNION clause will do the trick, but in ABAP i am not able to achieve it.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Please advise.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make n SQL statements, the first with inserting into tables, the other with appending. See onloiune help on howto select vakues into internal tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 10:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856908#M1475066</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2010-04-27T10:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856909#M1475067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can u give an example how to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"collect both the 2 table values in on iternal table and insert it."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 06:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856909#M1475067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T06:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856910#M1475068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saqi....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty_tab,&lt;/P&gt;&lt;P&gt;      cc type string,&lt;/P&gt;&lt;P&gt;      emp type string,&lt;/P&gt;&lt;P&gt;     end of ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_tab1 type table of ty_tab.&lt;/P&gt;&lt;P&gt;data : it_tab2 type table of ty_tab.&lt;/P&gt;&lt;P&gt;data : it_result type table of ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wa_tab type ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'A'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp1'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'A'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp2'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'A'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp3'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'B'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp1'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'C'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp3'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'A'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp3'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'B'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp1'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'B'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp2'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;wa_tab-cc = 'B'.&lt;/P&gt;&lt;P&gt;wa_tab-emp = 'emp3'.&lt;/P&gt;&lt;P&gt;append wa_tab to it_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;loop at it_tab1 into wa_tab.&lt;/P&gt;&lt;P&gt;  append wa_tab to it_result.&lt;/P&gt;&lt;P&gt;  clear wa_tab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_tab.&lt;/P&gt;&lt;P&gt;loop at it_tab2 into wa_tab.&lt;/P&gt;&lt;P&gt;  append wa_tab to it_result.&lt;/P&gt;&lt;P&gt;  clear wa_tab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort it_result by cc emp.&lt;/P&gt;&lt;P&gt;  delete adjacent duplicates from it_result comparing cc emp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear wa_tab.&lt;/P&gt;&lt;P&gt;loop at it_result into wa_tab.&lt;/P&gt;&lt;P&gt;  write : wa_tab-cc.&lt;/P&gt;&lt;P&gt;  write : wa_tab-emp.&lt;/P&gt;&lt;P&gt;  clear wa_tab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this above code helps you...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is able to create a union of the two tables...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert back in case of any issues...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 07:46:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856910#M1475068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T07:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856911#M1475069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can take the values of the it_result into your resultant ztable like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ztable [] = it_result [] .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 12:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856911#M1475069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T12:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Implement a UNION clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856912#M1475070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
refresh table_3.
append lines of table_1 to table_3.
append lines of table_2 to table_3.
sort table_3 by CostCenter Pernr.
delete adjacent duplicates from table_3 comparing CostCenter Pernr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 12:55:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/implement-a-union-clause/m-p/6856912#M1475070</guid>
      <dc:creator>Maciej_DomagaBa</dc:creator>
      <dc:date>2010-04-28T12:55:34Z</dc:date>
    </item>
  </channel>
</rss>

