<?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: Code to Join three tables. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725145#M896587</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; U can take three internal tables for each of ur tables T1,T2,T3. Fetch the respective table data into ur internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itba2 with key name eq itab1-name.&lt;/P&gt;&lt;P&gt;read table itab3 with key name eq itab1-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / name under &amp;lt;name heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-name under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-name under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-name under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / age under &amp;lt;age heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-age under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-age under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-age under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / city under &amp;lt;city heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-city under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-city under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-city under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;removed by moderator&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mike Pokraka on Aug 6, 2008 8:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2008 07:03:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-23T07:03:55Z</dc:date>
    <item>
      <title>Code to Join three tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725142#M896584</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;&lt;/P&gt;&lt;P&gt;I am a fresher to this ABAP. &lt;/P&gt;&lt;P&gt;I have an task to join three tables which doesn't take much effort. But the problem is: the tables have same columns, (name, age and city) in all the three tables.&lt;/P&gt;&lt;P&gt;The layout is as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1  ( T1 )            Table 2  ( T2 )          Table 3 ( T3 )&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------" /&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;  name | age | city      name | age | city        name | age | city    -&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="----------------------" /&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;Anju   21     HDD      Anju   20     BGH       Anju    21    SFF&lt;/P&gt;&lt;P&gt;Julie   23     JUH       Julie   24     JUH        Julie   20     JUH &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;      -&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, there should be a selection screen. If I enter a value for this varaible as "Anju", The output should be like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Col       T1        T2      T3&lt;/P&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;Name    Anju     Anju    Anju&lt;/P&gt;&lt;P&gt;Age       21        20       21&lt;/P&gt;&lt;P&gt;City       HDD    BGH    SFF&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to appraoch how to solve this issue. Any pointers would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Anjum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: nasarat anjum on Apr 23, 2008 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 06:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725142#M896584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T06:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Code to Join three tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725143#M896585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in one of the way u can display like this: u can get all the data into one record only but u can display in 3 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of itab,&lt;/P&gt;&lt;P&gt;           name_t1, age_t1, city_t1,&lt;/P&gt;&lt;P&gt;           name_t2, age_t2, city_t2,&lt;/P&gt;&lt;P&gt;           name_t3, age_t3, city_t3,&lt;/P&gt;&lt;P&gt;         end of itab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data declare for itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select t1&lt;SUB&gt;name t1&lt;/SUB&gt;age t1~city&lt;/P&gt;&lt;P&gt;         t2&lt;SUB&gt;name t2&lt;/SUB&gt;age t2~city&lt;/P&gt;&lt;P&gt;        t3&lt;SUB&gt;name t3&lt;/SUB&gt;age t3~city&lt;/P&gt;&lt;P&gt; into itab&lt;/P&gt;&lt;P&gt;from t1 inner join t2 on t1&lt;SUB&gt;name = t2&lt;/SUB&gt;name&lt;/P&gt;&lt;P&gt; and t1 inner join t3 on t1&lt;SUB&gt;name = t3&lt;/SUB&gt;name&lt;/P&gt;&lt;P&gt;and t1~name = p_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : /itab-name_t1, itab-name_t2, itab-name_t3,&lt;/P&gt;&lt;P&gt;         /itab-age_t1, itab-age_t2, itab-age_t3,&lt;/P&gt;&lt;P&gt;        /itab-city_t1, itab-city_t2, itab-city_t3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 06:59:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725143#M896585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T06:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code to Join three tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725144#M896586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if all your columns are the same, no need for you to do a join. Just select the data from ONE database table into an internal table T0. and afterwards transfer the data to the other internal tables T1-T3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 07:00:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725144#M896586</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-04-23T07:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Code to Join three tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725145#M896587</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; U can take three internal tables for each of ur tables T1,T2,T3. Fetch the respective table data into ur internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itba2 with key name eq itab1-name.&lt;/P&gt;&lt;P&gt;read table itab3 with key name eq itab1-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / name under &amp;lt;name heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-name under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-name under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-name under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / age under &amp;lt;age heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-age under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-age under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-age under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / city under &amp;lt;city heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab1-city under &amp;lt;T1 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab2-city under &amp;lt;T2 heading&amp;gt;,&lt;/P&gt;&lt;P&gt;            itab3-city under &amp;lt;T3 heading&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;removed by moderator&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mike Pokraka on Aug 6, 2008 8:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 07:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725145#M896587</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T07:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Code to Join three tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725146#M896588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Closed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2008 06:43:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-join-three-tables/m-p/3725146#M896588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-03T06:43:10Z</dc:date>
    </item>
  </channel>
</rss>

