<?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: How to construct such SELECT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118389#M443653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always check, is the internal table empty or not, because with an empty internal table, SAP will read ALL entries from T1 and T2, and this will cause bad performance, and/or abap dump (due to the long runtime).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF NOT INT_TABLE2 IS INITIAL.
     SELECT T2~key1
       INTO CORRESPONDING FIELDS OF TABLE et_not_pairs
       FROM  TABLE1 AS T1 OUTER JOIN TABLE2 AS T2
                ON T1~KEY1  = T2~KEY1 AND
                   T1~KEY2 =  T2~KEY2 
       FOR ALL ENTRIES IN INT_TABLE2
        WHERE T2~KEY1 = INT_TABLE2-KEY1 AND
              T2~KEY2 = INT_TABLE2-KEY2.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2007 11:25:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-29T11:25:35Z</dc:date>
    <item>
      <title>How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118388#M443652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I simplify my problem as much as it is possible.&lt;/P&gt;&lt;P&gt;I have two tables TABLE1 and TABLE2. In both table key look:&lt;/P&gt;&lt;P&gt;key1 key2.&lt;/P&gt;&lt;P&gt;I have also an internal table INT_TABLE2 which is of type of TABLE2 which have some entries.&lt;/P&gt;&lt;P&gt;I want to select from TABLE1 all not existing pairs (TABLE1.key1 = TABLE2.key1 AND TABLE1.key2 = TABLE2.key2) for all entries in INT_TABLE2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
     SELECT T2~key1
       INTO CORRESPONDING FIELDS OF TABLE et_not_pairs
       FOR ALL ENTRIES IN INT_TABLE2
       FROM ( TABLE1 AS T1 OUTER JOIN TABLE2 AS T2
                ON T1~KEY1  = T2~KEY1 AND
                      T1~KEY2 =  T2~KEY2 )
           WHERE T2~KEY1 = INT_TALBE2-KEY1 AND
                        T2~KEY2 = INT_TALBE2-KEY2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but without effect (error)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 11:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118388#M443652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T11:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118389#M443653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always check, is the internal table empty or not, because with an empty internal table, SAP will read ALL entries from T1 and T2, and this will cause bad performance, and/or abap dump (due to the long runtime).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF NOT INT_TABLE2 IS INITIAL.
     SELECT T2~key1
       INTO CORRESPONDING FIELDS OF TABLE et_not_pairs
       FROM  TABLE1 AS T1 OUTER JOIN TABLE2 AS T2
                ON T1~KEY1  = T2~KEY1 AND
                   T1~KEY2 =  T2~KEY2 
       FOR ALL ENTRIES IN INT_TABLE2
        WHERE T2~KEY1 = INT_TABLE2-KEY1 AND
              T2~KEY2 = INT_TABLE2-KEY2.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 11:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118389#M443653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T11:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118390#M443654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I check it is empty, but I didn't paste this checking here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 12:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118390#M443654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T12:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118391#M443655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Try with this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT T2~key1&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE et_not_pairs&lt;/P&gt;&lt;P&gt;       FROM ( TABLE1 AS T1 INNER JOIN TABLE2 AS T2&lt;/P&gt;&lt;P&gt;                ON T1&lt;SUB&gt;KEY1  = T2&lt;/SUB&gt;KEY1 AND&lt;/P&gt;&lt;P&gt;                      T1&lt;SUB&gt;KEY2 =  T2&lt;/SUB&gt;KEY2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;shibino sooryan.k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 15:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118391#M443655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T15:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118392#M443656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But INNER JOIN return existing pairs, I need not existing pairs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2007 07:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118392#M443656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-30T07:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct such SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118393#M443657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found solution myself. I replaced OUTER JOIN with two selects&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 14:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-such-select/m-p/2118393#M443657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T14:36:02Z</dc:date>
    </item>
  </channel>
</rss>

