<?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 left join restrictions that openSQL poses (Discussion) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-join-restrictions-that-opensql-poses-discussion/m-p/1104790#M104438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;I wonder why opensql throw up this limitation that I can only use only ONE table left &lt;/P&gt;&lt;P&gt;join table in a sql statement. No sql flavor that I know, restrict this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;This is not a urgent question and I can easily live with it, the sql statements here are mere &lt;/P&gt;&lt;P&gt;examples produced by me to sound more understandable, so don&amp;#146;t want to get them fixed.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr
left join vbkd on vbpa~vbeln = vbkd~vbeln    
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error compiler put forward is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Unable to compare with "VBPA~VBELN". A table can be joined with a 
maximum of one other table using LEFT OUTER JOIN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change it to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr
left join vbkd on vbap~vbeln = vbkd~vbeln    
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it becomes a valid openSQL statement&lt;/P&gt;&lt;P&gt;Any comment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;Why can not I use where condition from a column of a table participating as a left join &lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: itab TYPE STANDARD TABLE OF vbeln.

SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr 
Where vbpa~parvw = 'WE'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error compiler put forward is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;No fields from the right-hand table of a LEFT outer Join 
may appear in the WHERE condition:"vbpa~parvw".&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;I understand that the same can be translated into a INNER join sql, but in some cases &lt;/P&gt;&lt;P&gt;what I need is a left join. In course of discussion we can think of cases where I cant live &lt;/P&gt;&lt;P&gt;without a left join&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Nov 2005 05:40:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-05T05:40:32Z</dc:date>
    <item>
      <title>left join restrictions that openSQL poses (Discussion)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-join-restrictions-that-opensql-poses-discussion/m-p/1104790#M104438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;I wonder why opensql throw up this limitation that I can only use only ONE table left &lt;/P&gt;&lt;P&gt;join table in a sql statement. No sql flavor that I know, restrict this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;This is not a urgent question and I can easily live with it, the sql statements here are mere &lt;/P&gt;&lt;P&gt;examples produced by me to sound more understandable, so don&amp;#146;t want to get them fixed.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr
left join vbkd on vbpa~vbeln = vbkd~vbeln    
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error compiler put forward is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Unable to compare with "VBPA~VBELN". A table can be joined with a 
maximum of one other table using LEFT OUTER JOIN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change it to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr
left join vbkd on vbap~vbeln = vbkd~vbeln    
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it becomes a valid openSQL statement&lt;/P&gt;&lt;P&gt;Any comment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;Why can not I use where condition from a column of a table participating as a left join &lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: itab TYPE STANDARD TABLE OF vbeln.

SELECT vbpa~vbeln
INTO TABLE itab
FROM vbap LEFT JOIN vbpa
ON vbap~vbeln = vbpa~vbeln AND
   vbap~posnr = vbpa~posnr 
Where vbpa~parvw = 'WE'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error compiler put forward is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;No fields from the right-hand table of a LEFT outer Join 
may appear in the WHERE condition:"vbpa~parvw".&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;I understand that the same can be translated into a INNER join sql, but in some cases &lt;/P&gt;&lt;P&gt;what I need is a left join. In course of discussion we can think of cases where I cant live &lt;/P&gt;&lt;P&gt;without a left join&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Nov 2005 05:40:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-join-restrictions-that-opensql-poses-discussion/m-p/1104790#M104438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-05T05:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: left join restrictions that openSQL poses (Discussion)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-join-restrictions-that-opensql-poses-discussion/m-p/1104791#M104439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it says 'LEFT' join, it means that table in the &amp;lt;b&amp;gt;Right&amp;lt;/b&amp;gt; may or may not corresponding data for row from table in the left but all the rows satisfying criteria will be included. Here is simple example&lt;/P&gt;&lt;P&gt;Table L                Table R&lt;/P&gt;&lt;P&gt;Key field next field  key next field&lt;/P&gt;&lt;P&gt;10       A            10       B&lt;/P&gt;&lt;P&gt;20       C            20 &lt;/P&gt;&lt;P&gt;                    &lt;/P&gt;&lt;P&gt;The left join will give the following result&lt;/P&gt;&lt;P&gt;10 A B&lt;/P&gt;&lt;P&gt;20 C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the data from the right table may be null, it does not make any sense to apply any condition or make any further left join on that. If open SQL had allowed that, the result would have been same as inner join. This syntax is actually &amp;lt;b&amp;gt;NOT&amp;lt;/b&amp;gt; restricting any functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may see problem in one scenario when you want to have anotert left join from non-key field of table on right with third table. May be SAP restricted this so that open sql can run on multiple DBMS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Nov 2005 08:47:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-join-restrictions-that-opensql-poses-discussion/m-p/1104791#M104439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-05T08:47:35Z</dc:date>
    </item>
  </channel>
</rss>

