<?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: ABAP SQL join where the joining fields are based on a condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280798#M1988699</link>
    <description>&lt;P&gt;Thanks, this worked almost flawlessly! &lt;BR /&gt;For my use case I had to switch IS NOT NULL for &amp;lt;&amp;gt; ''.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *
  FROM table1
  JOIN table2
    ON ( ( table2~field1 = table1~field1 AND table1~field1 &amp;lt;&amp;gt; '' )
      OR ( table2~field2 = table1~field2 AND table1~field2 &amp;lt;&amp;gt; '' ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Nov 2020 15:23:38 GMT</pubDate>
    <dc:creator>former_member636171</dc:creator>
    <dc:date>2020-11-04T15:23:38Z</dc:date>
    <item>
      <title>ABAP SQL join where the joining fields are based on a condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280796#M1988697</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I want to join tables (TAB1 and TAB2) together on two columns depending on whether one of the columns is empty or not.&lt;BR /&gt;If TAB1-FIELD1 is not empty then I want to join on FIELD1, else I want to join on FIELD2. &lt;BR /&gt;&lt;BR /&gt;I could do this by selecting TAB1 into an internal table and then doing a select for each line in the table but there must be a better way to do this?&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated.&lt;/P&gt;
  &lt;P&gt;Thanks,&lt;BR /&gt;Birgir&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280796#M1988697</guid>
      <dc:creator>former_member636171</dc:creator>
      <dc:date>2020-11-04T13:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SQL join where the joining fields are based on a condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280797#M1988698</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;bsnorrason&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Check this out. Have not tested it, though.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *
  FROM table1
  JOIN table2
    ON ( ( table2~field1 = table1~field1 AND table1~field1 IS NOT NULL )
      OR ( table2~field2 = table1~field2 AND table1~field2 IS NOT NULL ) ).&lt;/CODE&gt;&lt;/PRE&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Wed, 04 Nov 2020 14:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280797#M1988698</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-11-04T14:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SQL join where the joining fields are based on a condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280798#M1988699</link>
      <description>&lt;P&gt;Thanks, this worked almost flawlessly! &lt;BR /&gt;For my use case I had to switch IS NOT NULL for &amp;lt;&amp;gt; ''.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *
  FROM table1
  JOIN table2
    ON ( ( table2~field1 = table1~field1 AND table1~field1 &amp;lt;&amp;gt; '' )
      OR ( table2~field2 = table1~field2 AND table1~field2 &amp;lt;&amp;gt; '' ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 15:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-sql-join-where-the-joining-fields-are-based-on-a-condition/m-p/12280798#M1988699</guid>
      <dc:creator>former_member636171</dc:creator>
      <dc:date>2020-11-04T15:23:38Z</dc:date>
    </item>
  </channel>
</rss>

