<?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>Question Re: Use a parameter on a LEFT OUTER JOIN in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387089#M4635446</link>
    <description>&lt;P&gt;Dell,&lt;/P&gt;&lt;P&gt;Thanks for showing me a way to get around this problem.  Your solution works perfectly.&lt;/P&gt;&lt;P&gt;Thank you so much,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
    <pubDate>Thu, 13 May 2021 16:27:55 GMT</pubDate>
    <dc:creator>former_member731159</dc:creator>
    <dc:date>2021-05-13T16:27:55Z</dc:date>
    <item>
      <title>Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaq-p/12387085</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I have a parameter that I'm passing to a sub report. I would like to use the parameter on the LEFT OUTER JOIN line instead of the WHERE area.&lt;/P&gt;
  &lt;P&gt;Example:&lt;/P&gt;
  &lt;P&gt;Reference "B" &lt;/P&gt;
  &lt;P&gt; SELECT * FROM A &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN B &lt;/P&gt;
  &lt;P&gt;ON (A.Id = B.Id) &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN C &lt;/P&gt;
  &lt;P&gt; ON (A.Id = C.Id) &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN D &lt;/P&gt;
  &lt;P&gt; ON (A.Id = D.Id) &lt;/P&gt;
  &lt;P&gt; WHERE parm = 0 AND &lt;/P&gt;
  &lt;P&gt; r = 12345 AND &lt;/P&gt;
  &lt;P&gt; s = 'abc' AND &lt;/P&gt;
  &lt;P&gt; t = 'nn' &lt;/P&gt;
  &lt;P&gt;Instead do this &lt;/P&gt;
  &lt;P&gt; SELECT * FROM A &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN (Select * FROM B WHERE Name = parm) B &lt;/P&gt;
  &lt;P&gt; ON (A.Id = B.Id) &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN C &lt;/P&gt;
  &lt;P&gt; ON (A.Id = C.Id) &lt;/P&gt;
  &lt;P&gt; LEFT OUTER JOIN D &lt;/P&gt;
  &lt;P&gt; ON (A.Id = D.Id) &lt;/P&gt;
  &lt;P&gt; WHERE &lt;/P&gt;
  &lt;P&gt; r = 12345 AND &lt;/P&gt;
  &lt;P&gt; s = 'abc' AND &lt;/P&gt;
  &lt;P&gt; t = 'nn'&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 15:21:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaq-p/12387085</guid>
      <dc:creator>former_member731159</dc:creator>
      <dc:date>2021-05-10T15:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387086#M4635443</link>
      <description>&lt;P&gt;To do this you need to go to the Select Expert, show the formula and then manually edit the formula.  You'll add something like this to the formula (NOTE:  the parentheses are crucial for getting this to work right!):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;(
  IsNull({b.Name}) OR
  {b.Name} = {?Parameter}
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Since this is in a subreport, you'll create the parameter in the subreport itself.  Then in the Subreport Links, you'll &lt;/P&gt;&lt;P&gt;1.  Select the field or parameter from the main report in the top left.&lt;/P&gt;&lt;P&gt;2.  UN-check "Select data in subreport based on field:" in the bottom right.&lt;/P&gt;&lt;P&gt;3.  Select the subreport parameter that you created in the bottom left.&lt;/P&gt;&lt;P&gt;4.  Click on OK.&lt;/P&gt;&lt;P&gt;This will give the parameter in the subreport the value that it needs to filter correctly.&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 17:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387086#M4635443</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2021-05-10T17:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387087#M4635444</link>
      <description>&lt;P&gt;When I do this and then do a show query, the logic still comes up at the end of all of the LEFT OUTER JOIN  statements.  The logic is not placed into one of the LEFT OUTER JOIN statements.  I need to filter one of the tables in one of the LEFT OUTER Join statemetns.  Every filter that I try goes to the bottom of the whole SQL expression.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 18:27:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387087#M4635444</guid>
      <dc:creator>former_member731159</dc:creator>
      <dc:date>2021-05-10T18:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387088#M4635445</link>
      <description>&lt;P&gt;Ok, disregard the last comment. I see what you are doing now. The isNull is allowing null values to pass through, which means that we get data when there is no match. I testing it now.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 18:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387088#M4635445</guid>
      <dc:creator>former_member731159</dc:creator>
      <dc:date>2021-05-10T18:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387089#M4635446</link>
      <description>&lt;P&gt;Dell,&lt;/P&gt;&lt;P&gt;Thanks for showing me a way to get around this problem.  Your solution works perfectly.&lt;/P&gt;&lt;P&gt;Thank you so much,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387089#M4635446</guid>
      <dc:creator>former_member731159</dc:creator>
      <dc:date>2021-05-13T16:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387090#M4635447</link>
      <description>&lt;P&gt;Hello Dell,&lt;/P&gt;&lt;P&gt;The solution works fine, but I have a twist on the problem.  This solution works when the fields in the "ON" clause do not match, causing a NULL value.  What if the fields in the "ON" clause do match, but you want to filter on other fields that are not in the "ON" clause.  When I have multiple LEFT OUTER JOINS and this one LEFTER OUTER JOIN does not have the necessary data, it causes the whole query to pull no data, when there is data is present.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 14:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387090#M4635447</guid>
      <dc:creator>former_member731159</dc:creator>
      <dc:date>2021-06-14T14:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Use a parameter on a LEFT OUTER JOIN</title>
      <link>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387091#M4635448</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;Please mark my answer as the correct solution in order to close out the question.  Thanks!&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:07:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/use-a-parameter-on-a-left-outer-join/qaa-p/12387091#M4635448</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2021-06-25T17:07:21Z</dc:date>
    </item>
  </channel>
</rss>

