<?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 outer join problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069205#M1811735</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;Below is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&amp;nbsp; SELECT a~column1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a~column2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~column3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM ztab1 AS a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT OUTER JOIN ztab2 AS b&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON a~column1 = b~column1 AND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a~column2 = b~column2 AND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~year =&amp;nbsp; sy-datum+0(4).&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This outer join is picking all the entries where the date is '000000'.&lt;/P&gt;&lt;P&gt;Please let me know what is wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2014 15:58:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-02-24T15:58:46Z</dc:date>
    <item>
      <title>left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069205#M1811735</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;Below is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&amp;nbsp; SELECT a~column1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a~column2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~column3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM ztab1 AS a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT OUTER JOIN ztab2 AS b&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON a~column1 = b~column1 AND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a~column2 = b~column2 AND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b~year =&amp;nbsp; sy-datum+0(4).&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This outer join is picking all the entries where the date is '000000'.&lt;/P&gt;&lt;P&gt;Please let me know what is wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 15:58:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069205#M1811735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T15:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069206#M1811736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you use a left join, it loads all left-handed records from the table and does not care if right-handed conditions are not met. So this is what you really wanted. In other languages (not inside SAP), you would get null values on the records of the right tab. SAP does not work well with null-s, so it uses initial values - that is the reason, why you see '0000' in the year column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:11:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069206#M1811736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T16:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069207#M1811737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that was the case, then how come SAP provided the below example in its Help documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;PARAMETERS p_cityfr TYPE spfli-cityfrom. &lt;BR /&gt;&lt;BR /&gt;DATA: BEGIN OF wa, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; carrid&amp;nbsp;&amp;nbsp; TYPE scarr-carrid, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; carrname TYPE scarr-carrname, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connid&amp;nbsp;&amp;nbsp; TYPE spfli-connid, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END OF wa, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itab LIKE SORTED TABLE OF wa &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH NON-UNIQUE KEY carrid. &lt;BR /&gt;&lt;BR /&gt;SELECT s~carrid s~carrname p~connid &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO CORRESPONDING FIELDS OF TABLE itab &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM scarr AS s &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT OUTER JOIN spfli AS p ON s~carrid&amp;nbsp;&amp;nbsp; =&amp;nbsp; p~carrid &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND p~cityfrom = p_cityfr. &lt;BR /&gt;&lt;BR /&gt;LOOP AT itab INTO wa. &lt;BR /&gt;&amp;nbsp; IF wa-connid = '0000'. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE: / wa-carrid, wa-carrname. &lt;BR /&gt;&amp;nbsp; ENDIF. &lt;BR /&gt;ENDLOOP. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069207#M1811737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T16:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069208#M1811738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your desired result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:21:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069208#M1811738</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2014-02-24T16:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069209#M1811739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you may see in the example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: #333333;"&gt;&amp;nbsp; IF wa-connid = '0000'. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE: / wa-carrid, wa-carrname. &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: #333333;"&gt;&amp;nbsp; ENDIF. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: #333333;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;it checks, whether there is a value of connid, took from the right table. Once the value is initial ('0000'), the record is still fetched, but the right side (connid) could not be found. I do not see, what is wrong with this explanation&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: #333333;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069209#M1811739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T16:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069210#M1811740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two tables ztab1 and ztab2.&lt;/P&gt;&lt;P&gt;I need to outer join ztab1 and ztab2.&lt;/P&gt;&lt;P&gt;But all the resulting records should be of this year.&lt;/P&gt;&lt;P&gt;The column for year is in ztab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069210#M1811740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T16:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069211#M1811741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to make changes to your coding as you can't specify conditions on the right-handed table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069211#M1811741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T16:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069212#M1811742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you want to outer join, when you have a specific condition for table ztab2, which only records that are present in that table can fulfill?&lt;/P&gt;&lt;P&gt;Try changing this into an inner join, or please explain how an outer join and your selection condition should work together.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 16:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069212#M1811742</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2014-02-24T16:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069213#M1811743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two tables ztab1 and ztab2 are supposed to have exact number of entries.&lt;/P&gt;&lt;P&gt;There are two common key fields between 2 tables. col1 and col2.&lt;/P&gt;&lt;P&gt;As i have mentioned earlier only ztab2 has the month and year columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement: For a given specific month and year, i need to check if there are any entries missing in the ztab2 for a given year. If so need to retrieve those missing entries from ztab1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 17:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069213#M1811743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-24T17:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: left outer join problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069214#M1811744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you only need the missing records, then your select can be left alone like it is. If the year column is obligatory, then selecting as you are you will have a larger data-set with all records from the left table. Just loop all the records and compare year column, if it has the value '0000', then it is your output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 07:52:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-problem/m-p/10069214#M1811744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-25T07:52:22Z</dc:date>
    </item>
  </channel>
</rss>

