<?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 tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536153#M850810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joining 3 tables is not suggested by SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First try to fetch all the Master entries into an Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a Join for the remaining 2 tables with a FOR ALL ENTRIES condition on the Master Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to put sy-subrc checks, DELETE Duplicates..., SORT, READ, etc. before for all Entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinayak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2008 07:48:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-13T07:48:57Z</dc:date>
    <item>
      <title>join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536151#M850808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to join 3-4 tables with good performance with coding&lt;/P&gt;&lt;P&gt;     reply me soon.......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 07:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536151#M850808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T07:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536152#M850809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use inner joins to select the data from each of these tables together. But you need to be careful and sure about he joining conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Select serially from one table and use for all entries in the next select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Guru&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 07:48:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536152#M850809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T07:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536153#M850810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joining 3 tables is not suggested by SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First try to fetch all the Master entries into an Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a Join for the remaining 2 tables with a FOR ALL ENTRIES condition on the Master Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to put sy-subrc checks, DELETE Duplicates..., SORT, READ, etc. before for all Entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinayak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 07:48:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536153#M850810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T07:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536154#M850811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;by apply inner join condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select i&lt;SUB&gt;recdv i&lt;/SUB&gt;cdiff i&lt;SUB&gt;itime i&lt;/SUB&gt;idate i&lt;SUB&gt;vlcod i&lt;/SUB&gt;point i&lt;SUB&gt;mdtxt i&lt;/SUB&gt;mdocm m&lt;SUB&gt;objnr m&lt;/SUB&gt;swerk e&lt;SUB&gt;eqktx t&lt;/SUB&gt;atinn e~equnr into CORRESPONDING FIELDS OF table it&lt;/P&gt;&lt;P&gt;                                                              from imrg  as i&lt;/P&gt;&lt;P&gt;                                                              inner join imptt as t on i&lt;SUB&gt;point = t&lt;/SUB&gt;point&lt;/P&gt;&lt;P&gt;                                                              inner join mcipmis as m on m&lt;SUB&gt;objnr = t&lt;/SUB&gt;mpobj&lt;/P&gt;&lt;P&gt;                                                              inner join eqkt as e on e&lt;SUB&gt;equnr = m&lt;/SUB&gt;equnr&lt;/P&gt;&lt;P&gt;                                                              where m~swerk in swerk&lt;/P&gt;&lt;P&gt;                                                              and i~idate in idate&lt;/P&gt;&lt;P&gt;                                                              and t~atinn in ('0000000058' , '0000000151' , '0000000152')&lt;/P&gt;&lt;P&gt;                                                              and i~cancl &amp;lt;&amp;gt; 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this type of condition in your program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 07:50:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536154#M850811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T07:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536155#M850812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashwani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this report....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZCUSTOMER_DETAIL                                            *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  ZCUSTOMER_DETAIL                        .

TABLES : KNA1, VBAK, VBAP, LIPS, VBRP, VBRK, KNKK.

PARAMETERS : KUNNR LIKE KNA1-KUNNR.

DATA : BEGIN OF IT OCCURS 0,
       KUNNR LIKE KNA1-KUNNR,
       NAME1 LIKE KNA1-NAME1,
       FKDAT LIKE VBRK-FKDAT,
       KLIMK LIKE KNKK-KLIMK,
       KKBER LIKE KNKK-KKBER,
       END OF IT.

    SELECT SINGLE
                KNA1~KUNNR
                KNA1~NAME1
                VBRK~FKDAT
                KNKK~KLIMK
                KNKK~KKBER
                INTO IT FROM KNA1 INNER JOIN VBAK ON
                KNA1~KUNNR = VBAK~KUNNR
                INNER JOIN KNKK ON
                KNA1~KUNNR = KNKK~KUNNR
                INNER JOIN VBAP ON
                VBAK~VBELN = VBAP~VBELN
                INNER JOIN LIPS ON
                VBAP~VBELN = LIPS~VGBEL
                INNER JOIN VBRP ON
                LIPS~VBELN = VBRP~VGBEL
                INNER JOIN VBRK ON
                VBRP~VBELN = VBRK~VBELN
                WHERE KNA1~KUNNR = KUNNR.

    APPEND IT.

   LOOP AT IT.

   WRITE :/ IT-KUNNR,
            IT-NAME1,
            IT-FKDAT,
            IT-KLIMK,
            IT-KKBER.
   ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 07:53:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536155#M850812</guid>
      <dc:creator>ak_upadhyay</dc:creator>
      <dc:date>2008-03-13T07:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: join tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536156#M850813</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 can achieve it using internal tables. select 1st table and move it to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now use one more select with 'for all entries' in the internal table . make sure you dont write ur code with nested loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Manoharan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:05:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables/m-p/3536156#M850813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:05:28Z</dc:date>
    </item>
  </channel>
</rss>

