<?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 conditions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525709#M1262635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post the structure of it_report here. Either field names don't match or the same field name appears in multiple tables with different values (&amp;lt;empty&amp;gt; being one of them).&lt;/P&gt;&lt;P&gt;Reg. too many records -&amp;gt; that's probably due to table VBFA being involved, which stores document flow on item basis, whereas all your desired information and selection criteria seems to be on header level. You should investigate in that direction.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2009 12:10:32 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2009-04-27T12:10:32Z</dc:date>
    <item>
      <title>Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525703#M1262629</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 need to JOIN few tables. I will post you my code example and I need any info on corrections of this JOIN conditions because I get too many records in output. Also columns of data that is supposed to be fetched from VBAK table are empty.Here it is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT *&lt;/P&gt;&lt;P&gt;      FROM vbak AS ak INNER JOIN vbfa AS fa&lt;/P&gt;&lt;P&gt;      ON ak&lt;SUB&gt;vbeln = fa&lt;/SUB&gt;vbelv&lt;/P&gt;&lt;P&gt;      INNER JOIN vbrk AS rk&lt;/P&gt;&lt;P&gt;      ON fa&lt;SUB&gt;vbeln = rk&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;      INNER JOIN kna1 AS a1&lt;/P&gt;&lt;P&gt;      ON rk&lt;SUB&gt;kunrg = a1&lt;/SUB&gt;kunnr&lt;/P&gt;&lt;P&gt;      INTO CORRESPONDING FIELDS OF TABLE it_report&lt;/P&gt;&lt;P&gt;      WHERE fa~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;      AND   rk~fkart IN s_fkart&lt;/P&gt;&lt;P&gt;      AND   rk~fkdat IN s_fkdat&lt;/P&gt;&lt;P&gt;      AND   rk~vkorg EQ 'HTSD'&lt;/P&gt;&lt;P&gt;      AND   rk~vtweg IN s_vtweg&lt;/P&gt;&lt;P&gt;      AND   rk~kunrg IN s_kunrg&lt;/P&gt;&lt;P&gt;      AND   rk~kunag IN s_kunag&lt;/P&gt;&lt;P&gt;      AND   a1~stcd1 IN s_stcd1&lt;/P&gt;&lt;P&gt;      AND   rk~erdat IN s_erdat&lt;/P&gt;&lt;P&gt;      AND ak~vkbur IN s_vkbur&lt;/P&gt;&lt;P&gt;      AND ak~augru IN s_augru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 10:07:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525703#M1262629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T10:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525704#M1262630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It seems one of the select-options ranges in the where clause contains initial values due to which all entries from the table are getting fetched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the range is initial i.e. empty then too many records will be fetched.&lt;/P&gt;&lt;P&gt;To avoid this in case the range is empty don't pass it in where clause.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: SAP USER on Apr 27, 2009 12:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 10:11:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525704#M1262630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T10:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525705#M1262631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but still...why can't I get any data from VBAK table? all the fields that are fetched from this table are left empty.... So I think that JOIN is not good...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 10:13:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525705#M1262631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T10:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525706#M1262632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to check the initiality of all the selct-optons you are using.&lt;/P&gt;&lt;P&gt;other wise you will all the records which is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 10:13:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525706#M1262632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T10:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525707#M1262633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maja,&lt;/P&gt;&lt;P&gt;Dont use joins with somany  system tables awith bulk data, it will reduce u perormance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use like this.&lt;/P&gt;&lt;P&gt;select fields from table1 into itab1 where condition.&lt;/P&gt;&lt;P&gt;if not itab1 is initial.&lt;/P&gt;&lt;P&gt;select fields rom table2 into itab2 whee condition from itab1.&lt;/P&gt;&lt;P&gt;.................&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525707#M1262633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T11:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525708#M1262634</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; but still...why can't I get any data from VBAK table? all the fields that are fetched from this table are left empty.... So I think that JOIN is not good...&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; ???&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If the query is bringing back data, then the join is working.  If it's bringing back too may records then your joins may not be specific enough.   If your VBAK fields are not being filled and you're using SELECT * and INTO CORRESPONDING FIELDS, then I would guess that you receiving itab does not contain any fields with the same names as the VBAK fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525708#M1262634</guid>
      <dc:creator>christine_evans</dc:creator>
      <dc:date>2009-04-27T11:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Join conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525709#M1262635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post the structure of it_report here. Either field names don't match or the same field name appears in multiple tables with different values (&amp;lt;empty&amp;gt; being one of them).&lt;/P&gt;&lt;P&gt;Reg. too many records -&amp;gt; that's probably due to table VBFA being involved, which stores document flow on item basis, whereas all your desired information and selection criteria seems to be on header level. You should investigate in that direction.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 12:10:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-conditions/m-p/5525709#M1262635</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-04-27T12:10:32Z</dc:date>
    </item>
  </channel>
</rss>

