<?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 Nested INNER JOIN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804971#M1587484</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 joining my three tables using the inner join..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select a&lt;SUB&gt;empid b&lt;/SUB&gt;deptid&lt;/P&gt;&lt;P&gt;into corr fields of table lt_emp&lt;/P&gt;&lt;P&gt;from ( emp as a INNER JOIN dept as b&lt;/P&gt;&lt;P&gt;       ON ( b&lt;SUB&gt;deptid = a&lt;/SUB&gt;deptid ) )&lt;/P&gt;&lt;P&gt;INNER JOIN loc as c&lt;/P&gt;&lt;P&gt;       ON ( b&lt;SUB&gt;deptid = a&lt;/SUB&gt;deptid ) &lt;/P&gt;&lt;P&gt;WHERE a~depid EQ lt_dept-deptid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;deptid is present in all three tables but still my lt_emp table is coming empty...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest me any other way of joining three tables with only one select query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhiraj B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Apr 2011 12:30:29 GMT</pubDate>
    <dc:creator>dhiraj_bhatia1</dc:creator>
    <dc:date>2011-04-13T12:30:29Z</dc:date>
    <item>
      <title>Nested INNER JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804971#M1587484</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 joining my three tables using the inner join..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select a&lt;SUB&gt;empid b&lt;/SUB&gt;deptid&lt;/P&gt;&lt;P&gt;into corr fields of table lt_emp&lt;/P&gt;&lt;P&gt;from ( emp as a INNER JOIN dept as b&lt;/P&gt;&lt;P&gt;       ON ( b&lt;SUB&gt;deptid = a&lt;/SUB&gt;deptid ) )&lt;/P&gt;&lt;P&gt;INNER JOIN loc as c&lt;/P&gt;&lt;P&gt;       ON ( b&lt;SUB&gt;deptid = a&lt;/SUB&gt;deptid ) &lt;/P&gt;&lt;P&gt;WHERE a~depid EQ lt_dept-deptid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;deptid is present in all three tables but still my lt_emp table is coming empty...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest me any other way of joining three tables with only one select query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhiraj B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 12:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804971#M1587484</guid>
      <dc:creator>dhiraj_bhatia1</dc:creator>
      <dc:date>2011-04-13T12:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Nested INNER JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804972#M1587485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;use this.&lt;/P&gt;&lt;P&gt;if it_dept is not initial.&lt;/P&gt;&lt;P&gt;Select a&lt;SUB&gt;empid b&lt;/SUB&gt;deptid&lt;/P&gt;&lt;P&gt;into corr fields of table lt_emp&lt;/P&gt;&lt;P&gt;from ( emp as a INNER JOIN dept as b&lt;/P&gt;&lt;P&gt;ON ( b&lt;SUB&gt;deptid = a&lt;/SUB&gt;deptid ) )&lt;/P&gt;&lt;P&gt;INNER JOIN loc as c&lt;/P&gt;&lt;P&gt;ON ( c&lt;SUB&gt;deptid = b&lt;/SUB&gt;deptid ) &lt;/P&gt;&lt;P&gt;for all entries in it_dept&lt;/P&gt;&lt;P&gt;WHERE a~depid EQ lt_dept-deptid.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because in your code you are checking deptit from table it_dept in where condition,&lt;/P&gt;&lt;P&gt;which will contain only the last values stored in the header of table it_dept.&lt;/P&gt;&lt;P&gt;this is why i have used for all entries here.&lt;/P&gt;&lt;P&gt;thi for all entries will fetch the data from all the table for all the values matches in table it_dept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this and i hope this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;LG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 13:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804972#M1587485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-13T13:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Nested INNER JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804973#M1587486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE a&lt;SUB&gt;matnr c&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;INTO (l_matnr , l_werks)&lt;/P&gt;&lt;P&gt;FROM mara AS a INNER JOIN makt AS b&lt;/P&gt;&lt;P&gt;ON ( a&lt;SUB&gt;matnr = b&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;INNER JOIN marc AS c&lt;/P&gt;&lt;P&gt;ON ( b&lt;SUB&gt;matnr = c&lt;/SUB&gt;matnr )&lt;/P&gt;&lt;P&gt;WHERE a~matnr EQ l_matnr1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your query the second on condition is not correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 15:15:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-inner-join/m-p/7804973#M1587486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-13T15:15:55Z</dc:date>
    </item>
  </channel>
</rss>

