<?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: Join several tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738122#M320919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this example this might help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT a&lt;SUB&gt;werks a&lt;/SUB&gt;budat a&lt;SUB&gt;grund a&lt;/SUB&gt;ism03 a&lt;SUB&gt;aufnr a&lt;/SUB&gt;rueck a~rmzhl&lt;/P&gt;&lt;P&gt;           a&lt;SUB&gt;stzhl a&lt;/SUB&gt;erzet&lt;/P&gt;&lt;P&gt;    b&lt;SUB&gt;matnr c&lt;/SUB&gt;verid INTO CORRESPONDING FIELDS OF TABLE itab FROM&lt;/P&gt;&lt;P&gt;          afru AS a INNER JOIN afpo AS b ON&lt;/P&gt;&lt;P&gt;          a&lt;SUB&gt;aufnr = b&lt;/SUB&gt;aufnr  INNER JOIN&lt;/P&gt;&lt;P&gt;          mkal AS c ON b&lt;SUB&gt;matnr = c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN it_blpk                            &lt;/P&gt;&lt;P&gt;    WHERE c~verid = it_blpk-verid                           &lt;/P&gt;&lt;P&gt;      AND a~budat = it_blpk-budat                           &lt;/P&gt;&lt;P&gt;      AND a~erzet = it_blpk-uzeit                           &lt;/P&gt;&lt;P&gt;      AND a~werks = it_blpk-werks                           &lt;/P&gt;&lt;P&gt;      AND b~matnr = it_blpk-matnr                           &lt;/P&gt;&lt;P&gt;      AND a~grund IN s_grund AND                            &lt;/P&gt;&lt;P&gt;        ( a&lt;SUB&gt;budat &amp;gt;= c&lt;/SUB&gt;adatu AND                           &lt;/P&gt;&lt;P&gt;          a&lt;SUB&gt;budat &amp;lt;= c&lt;/SUB&gt;bdatu ) AND                         &lt;/P&gt;&lt;P&gt;        a~ism03 &amp;lt;&amp;gt; 0 AND                                   &lt;/P&gt;&lt;P&gt;          a~ile03 EQ 'STD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statements joind data from 3 tables into one internal table.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2006 15:03:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-05T15:03:37Z</dc:date>
    <item>
      <title>Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738120#M320917</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;I need a guidance to join 3 tables at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738120#M320917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738121#M320918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you search this forum for "JOIN", you should find many examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:02:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738121#M320918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738122#M320919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this example this might help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT a&lt;SUB&gt;werks a&lt;/SUB&gt;budat a&lt;SUB&gt;grund a&lt;/SUB&gt;ism03 a&lt;SUB&gt;aufnr a&lt;/SUB&gt;rueck a~rmzhl&lt;/P&gt;&lt;P&gt;           a&lt;SUB&gt;stzhl a&lt;/SUB&gt;erzet&lt;/P&gt;&lt;P&gt;    b&lt;SUB&gt;matnr c&lt;/SUB&gt;verid INTO CORRESPONDING FIELDS OF TABLE itab FROM&lt;/P&gt;&lt;P&gt;          afru AS a INNER JOIN afpo AS b ON&lt;/P&gt;&lt;P&gt;          a&lt;SUB&gt;aufnr = b&lt;/SUB&gt;aufnr  INNER JOIN&lt;/P&gt;&lt;P&gt;          mkal AS c ON b&lt;SUB&gt;matnr = c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN it_blpk                            &lt;/P&gt;&lt;P&gt;    WHERE c~verid = it_blpk-verid                           &lt;/P&gt;&lt;P&gt;      AND a~budat = it_blpk-budat                           &lt;/P&gt;&lt;P&gt;      AND a~erzet = it_blpk-uzeit                           &lt;/P&gt;&lt;P&gt;      AND a~werks = it_blpk-werks                           &lt;/P&gt;&lt;P&gt;      AND b~matnr = it_blpk-matnr                           &lt;/P&gt;&lt;P&gt;      AND a~grund IN s_grund AND                            &lt;/P&gt;&lt;P&gt;        ( a&lt;SUB&gt;budat &amp;gt;= c&lt;/SUB&gt;adatu AND                           &lt;/P&gt;&lt;P&gt;          a&lt;SUB&gt;budat &amp;lt;= c&lt;/SUB&gt;bdatu ) AND                         &lt;/P&gt;&lt;P&gt;        a~ism03 &amp;lt;&amp;gt; 0 AND                                   &lt;/P&gt;&lt;P&gt;          a~ile03 EQ 'STD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statements joind data from 3 tables into one internal table.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738122#M320919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738123#M320920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;same as joining two tables ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after joining the first two tables ... add the condition for joining the 2nd and 3rd table ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738123#M320920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738124#M320921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select a&lt;SUB&gt;field1 a&lt;/SUB&gt;field2 b&lt;SUB&gt;field3 b&lt;/SUB&gt;field4 c&lt;SUB&gt;field5 c&lt;/SUB&gt;field6 into itab&lt;/P&gt;&lt;P&gt;    from table1 as a inner join table2 as b on a-key = b-key&lt;/P&gt;&lt;P&gt;                     inner join table3 as c on b-key = c-key&lt;/P&gt;&lt;P&gt;    where &amp;lt;conditions&amp;gt;..........Here while putting conditions need to put as a&lt;SUB&gt;field or b&lt;/SUB&gt;field or c~field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Ramesh Babu Chirumamilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738124#M320921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738125#M320922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a dirty trick -:P SQ02...Create a query, make the join and copy the code -;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738125#M320922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738126#M320923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Said ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_kna1 occurs 1,&lt;/P&gt;&lt;P&gt;      kunnr like kna1-kunnr,&lt;/P&gt;&lt;P&gt;      land1 like kna1-land1,&lt;/P&gt;&lt;P&gt;      name1 like kna1-name1,&lt;/P&gt;&lt;P&gt;      ort01 like kna1-ort01,&lt;/P&gt;&lt;P&gt;      end of i_kna1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_vbak occurs 1,&lt;/P&gt;&lt;P&gt;      kunnr like vbak-kunnr,&lt;/P&gt;&lt;P&gt;      vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;      erdat like vbak-erdat,&lt;/P&gt;&lt;P&gt;      ernam like vbak-ernam,&lt;/P&gt;&lt;P&gt;      end of i_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_vbap occurs 1,&lt;/P&gt;&lt;P&gt;      vbeln like vbap-vbeln,&lt;/P&gt;&lt;P&gt;      posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;      matnr like vbap-matnr,&lt;/P&gt;&lt;P&gt;      charg like vbap-charg,&lt;/P&gt;&lt;P&gt;      end of i_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_mara,&lt;/P&gt;&lt;P&gt;      matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;      mbrsh like mara-mbrsh,&lt;/P&gt;&lt;P&gt;      mtart like mara-mtart,&lt;/P&gt;&lt;P&gt;      meins like mara-meins,&lt;/P&gt;&lt;P&gt;      end of i_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_dest occurs 1,&lt;/P&gt;&lt;P&gt;      kunnr like kna1-kunnr,&lt;/P&gt;&lt;P&gt;      land1 like kna1-land1,&lt;/P&gt;&lt;P&gt;      name1 like kna1-name1,&lt;/P&gt;&lt;P&gt;      ort01 like kna1-ort01,&lt;/P&gt;&lt;P&gt;      vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;      erdat like vbak-erdat,&lt;/P&gt;&lt;P&gt;      ernam like vbak-ernam,&lt;/P&gt;&lt;P&gt;      posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;      matnr like vbap-matnr,&lt;/P&gt;&lt;P&gt;      charg like vbap-charg,&lt;/P&gt;&lt;P&gt;      mbrsh like mara-mbrsh,&lt;/P&gt;&lt;P&gt;      mtart like mara-mtart,&lt;/P&gt;&lt;P&gt;      meins like mara-meins,&lt;/P&gt;&lt;P&gt;      end of i_dest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select k&lt;SUB&gt;kunnr k&lt;/SUB&gt;land1 k&lt;SUB&gt;name1 k&lt;/SUB&gt;ort01 v&lt;SUB&gt;vbeln v&lt;/SUB&gt;erdat v&lt;SUB&gt;ernam p&lt;/SUB&gt;posnr&lt;/P&gt;&lt;P&gt;p&lt;SUB&gt;matnr p&lt;/SUB&gt;charg into table i_dest from kna1 as k inner join vbak as v on&lt;/P&gt;&lt;P&gt; k&lt;SUB&gt;kunnr = v&lt;/SUB&gt;kunnr inner join vbap as p on v&lt;SUB&gt;vbeln = p&lt;/SUB&gt;vbeln inner join&lt;/P&gt;&lt;P&gt;mara as m on p&lt;SUB&gt;matnr = m&lt;/SUB&gt;matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_dest.&lt;/P&gt;&lt;P&gt; write: / i_dest-kunnr, i_dest-land1, i_dest-name1, i_dest-ort01,&lt;/P&gt;&lt;P&gt;i_dest-vbeln, i_dest-erdat, i_dest-ernam, i_dest-posnr, i_dest-matnr,&lt;/P&gt;&lt;P&gt;i_dest-charg, i_dest-mbrsh, i_dest-mtart, i_dest-meins.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 16:11:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738126#M320923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T16:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Join several tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738127#M320924</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 may experience performance related problem if u join  more than 2 tables ( depends on table size ). For better performance u can join two tables get all the information in one internal table then considering that internal table as a driver table u can select all necessary data from the 3rd table using  FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 16:17:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-several-tables/m-p/1738127#M320924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T16:17:54Z</dc:date>
    </item>
  </channel>
</rss>

