<?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 Join condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284436#M785544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am new in ABAP.&lt;/P&gt;&lt;P&gt;Now i got one report in which 5 tables are there.Can you suggest me that Can I use &lt;STRONG&gt;inner join&lt;/STRONG&gt;.OR is there any other method.please tell me with example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2008 04:40:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-18T04:40:46Z</dc:date>
    <item>
      <title>Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284436#M785544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am new in ABAP.&lt;/P&gt;&lt;P&gt;Now i got one report in which 5 tables are there.Can you suggest me that Can I use &lt;STRONG&gt;inner join&lt;/STRONG&gt;.OR is there any other method.please tell me with example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284436#M785544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T04:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284437#M785545</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;rather than using inner joins use select for all entries iit increases performance &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example and syntax search in formus&lt;/P&gt;&lt;P&gt;ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284437#M785545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T04:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284438#M785546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joining 5 tables is not preferred.. performance point of view..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT lt_vbak[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln vposn vbegreg vendreg vabndat vuntdat vlaufz vlauez vbegdat&lt;/P&gt;&lt;P&gt;venddat vlaufk FROM veda&lt;/P&gt;&lt;P&gt;INTO TABLE lt_veda&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FOR ALL ENTRIES IN lt_vbak&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;WHERE vbeln EQ lt_vbak-vbeln.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;SELECT a&lt;SUB&gt;vbeln b&lt;/SUB&gt;posnr a&lt;SUB&gt;auart a&lt;/SUB&gt;vkorg a&lt;SUB&gt;vtweg a&lt;/SUB&gt;spart a~ktext&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;guebg a&lt;/SUB&gt;gueen a&lt;SUB&gt;faksk a&lt;/SUB&gt;audat a&lt;SUB&gt;waerk a&lt;/SUB&gt;abrvw b&lt;SUB&gt;mvgr4 b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;a~knumv&lt;/P&gt;&lt;P&gt;INTO TABLE lt_vbak " all header items&lt;/P&gt;&lt;P&gt;FROM vbak AS a&lt;/P&gt;&lt;P&gt;JOIN vbap AS b&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;WHERE a~vbeln IN so_vbeln&lt;/P&gt;&lt;P&gt;AND a~erdat IN so_cdat&lt;/P&gt;&lt;P&gt;AND a~auart IN ('ZCMV', 'ZCSE', 'ZCSS')&lt;/P&gt;&lt;P&gt;AND a~vkorg IN so_vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Award points if helpful&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:45:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284438#M785546</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-01-18T04:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284439#M785547</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;  &lt;STRONG&gt;Inner join&lt;/STRONG&gt;:   If you have common fields between 2 or more tables, its betterto use Inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below example:&lt;/P&gt;&lt;P&gt; VBAK &amp;amp; VBAP table has common fields, hence we can use inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a&lt;SUB&gt;kunnr a&lt;/SUB&gt;vbeln a&lt;SUB&gt;netwr a&lt;/SUB&gt;bnddt a~knumv&lt;/P&gt;&lt;P&gt;         a&lt;SUB&gt;vkbur a&lt;/SUB&gt;erdat a&lt;SUB&gt;vdatu a&lt;/SUB&gt;augru&lt;/P&gt;&lt;P&gt;         a&lt;SUB&gt;ktext b&lt;/SUB&gt;matnr b&lt;SUB&gt;arktx b&lt;/SUB&gt;kwmeng b~kzwi6&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;volum b&lt;/SUB&gt;posnr  b~kdmat&lt;/P&gt;&lt;P&gt;         INTO CORRESPONDING FIELDS OF TABLE g_t_quot&lt;/P&gt;&lt;P&gt;         FROM vbak AS a INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;         ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         WHERE a~vbeln IN so_vbeln&lt;/P&gt;&lt;P&gt;           AND a~trvog ='2'&lt;/P&gt;&lt;P&gt;           AND a~vkorg IN so_vkorg&lt;/P&gt;&lt;P&gt;           AND a~vtweg IN so_vtweg&lt;/P&gt;&lt;P&gt;           AND a~vkbur IN so_vkbur&lt;/P&gt;&lt;P&gt;           AND a~audat IN so_audat&lt;/P&gt;&lt;P&gt;           AND a~kunnr IN so_kunag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FOR ALL ENTRIES:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you get some data into one internal table and if you want to fetch data from other table based on it, use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;g_t_quot is an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT spras augru bezei FROM tvaut INTO TABLE g_t_tvaut&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN g_t_quot&lt;/P&gt;&lt;P&gt;        WHERE augru = g_t_quot-augru AND spras = sy-langu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:46:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284439#M785547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T04:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284440#M785548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select t1&lt;SUB&gt;field1 t1&lt;/SUB&gt;field2 t2&lt;SUB&gt;field1 t2&lt;/SUB&gt;field2 t3&lt;SUB&gt;field1 t3&lt;/SUB&gt;field2 t4&lt;SUB&gt;field1 t4&lt;/SUB&gt;field2 t5&lt;SUB&gt;field1 t5&lt;/SUB&gt;field2  into itab from (((( tabname1 as t1 inner join tabname2 as t2 on t1&lt;SUB&gt;field = t2&lt;/SUB&gt;field) inner join tabname3 as t3 on t2&lt;SUB&gt;field = t3&lt;/SUB&gt;field) inner join tabname4 as t4 on t3&lt;SUB&gt;field = t4&lt;/SUB&gt;field) inner join tabname5 as t5 on t4&lt;SUB&gt;field = t5&lt;/SUB&gt;field)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284440#M785548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T04:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284441#M785549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi amar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Don't use inner join for 5 tables because if use then ur program performance will decrease.So better use For All Entries.Then it will join not only 5 tables more than 5 also.For example below program is mine.Just check it once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT dokar&lt;/P&gt;&lt;P&gt;       doknr&lt;/P&gt;&lt;P&gt;       dokvr&lt;/P&gt;&lt;P&gt;       dokst&lt;/P&gt;&lt;P&gt;       zdm_doc_owner_id&lt;/P&gt;&lt;P&gt;  FROM draw&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE it_doc_details&lt;/P&gt;&lt;P&gt; WHERE dokst = 'RL'&lt;/P&gt;&lt;P&gt;   AND dokar IN (c_00,c_12,c_68,c_70,c_frm,c_pol,c_cs,c_qa). " retrieve the data from Draw table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="14" type="ul"&gt;&lt;P&gt;Retrieving the release dates from the Drap table.*********************************************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  SELECT dokar&lt;/P&gt;&lt;P&gt;         doknr&lt;/P&gt;&lt;P&gt;         dokvr&lt;/P&gt;&lt;P&gt;         stzae&lt;/P&gt;&lt;P&gt;         datum&lt;/P&gt;&lt;P&gt;    FROM drap&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE it_drap&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN it_doc_details&lt;/P&gt;&lt;P&gt;   WHERE dokar = it_doc_details-dokar&lt;/P&gt;&lt;P&gt;     AND doknr = it_doc_details-doknr&lt;/P&gt;&lt;P&gt;     AND dokvr = it_doc_details-dokvr.        " retrieve the data from Drap table and join to it_doc_details.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SORT it_drap BY dokar doknr dokvr stzae DESCENDING .&lt;/P&gt;&lt;P&gt;    DELETE ADJACENT DUPLICATES FROM it_drap COMPARING dokar doknr dokvr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="14" type="ul"&gt;&lt;P&gt;Retrieving the documents description from the Drat table.*********************************************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;    SELECT dokar&lt;/P&gt;&lt;P&gt;           doknr&lt;/P&gt;&lt;P&gt;           dokvr&lt;/P&gt;&lt;P&gt;           dktxt&lt;/P&gt;&lt;P&gt;      FROM drat INTO CORRESPONDING FIELDS OF TABLE it_drat&lt;/P&gt;&lt;P&gt;       FOR ALL ENTRIES IN it_doc_details&lt;/P&gt;&lt;P&gt;     WHERE dokar = it_doc_details-dokar&lt;/P&gt;&lt;P&gt;      AND  doknr = it_doc_details-doknr&lt;/P&gt;&lt;P&gt;      AND  dokvr = it_doc_details-dokvr.     " retrieve the data from Drat table and join to it_doc_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i showed only 3 tables. In the same fashion you can use 5 tables also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if it is ok Reward me&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 05:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284441#M785549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T05:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Join condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284442#M785550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi amar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use joins. for all entries is the second alternative for joins. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because when you use joins you write single select query to get the data from multiple tables, so you hit the database server one  time only. where in case of for all entries, you will write multiple select queries depending on the no.of tables you want to fetch the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so joins results less trafic when compared to for all entries&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 08:38:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-condition/m-p/3284442#M785550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T08:38:36Z</dc:date>
    </item>
  </channel>
</rss>

