<?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: LEFT OUTER JOIN with internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524036#M847663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The number of values should not be too big for the company code. Use it as a range. In the where clause use field in r_myrange.... The range is an internal table with 3 or 4 fields&lt;/P&gt;&lt;P&gt;option (IN|EX) sign(EQ|NE|LE|LT|GE|GT|BT) plus a low value and a high value field. Read up on Ranges|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Mar 2008 04:18:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-03T04:18:03Z</dc:date>
    <item>
      <title>LEFT OUTER JOIN with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524035#M847662</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;I have a query to execute,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SKAT&lt;SUB&gt;SAKNR SKAT&lt;/SUB&gt;TXT20&lt;/P&gt;&lt;P&gt;SUM( GLT0~HSLVT ) AS HSLVT&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB_ZSTMGLRACC&lt;/P&gt;&lt;P&gt;FROM SKAT&lt;/P&gt;&lt;P&gt;LEFT OUTER JOIN GLT0 ON GLT0&lt;SUB&gt;RACCT = SKAT&lt;/SUB&gt;SAKNR&lt;/P&gt;&lt;P&gt;AND GLT0~RYEAR = I_GJAHR&lt;/P&gt;&lt;P&gt;AND GLT0~BUKRS = 'comp1'&lt;/P&gt;&lt;P&gt;WHERE SKAT~KTOPL = 'EICA'&lt;/P&gt;&lt;P&gt;GROUP BY SKAT&lt;SUB&gt;SAKNR SKAT&lt;/SUB&gt;TXT20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here i want to replace GLT0~BUKRS = 'comp1' with multiple values from Internal table ITAB_T001&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;since i used SUM ......FOR ALL ENTRIES IN ITAB_T001 cant be used .&lt;/P&gt;&lt;P&gt;any one have options??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx &lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2008 04:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524035#M847662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-03T04:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: LEFT OUTER JOIN with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524036#M847663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The number of values should not be too big for the company code. Use it as a range. In the where clause use field in r_myrange.... The range is an internal table with 3 or 4 fields&lt;/P&gt;&lt;P&gt;option (IN|EX) sign(EQ|NE|LE|LT|GE|GT|BT) plus a low value and a high value field. Read up on Ranges|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2008 04:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524036#M847663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-03T04:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: LEFT OUTER JOIN with internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524037#M847664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If the same column name occurs in several database tables in a join expression, they have to be identified in all remaining additions of the SELECT statement by using the column selector ~. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_cityfr TYPE spfli-cityfrom, &lt;/P&gt;&lt;P&gt;            p_cityto TYPE spfli-cityto. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa, &lt;/P&gt;&lt;P&gt;         fldate TYPE sflight-fldate, &lt;/P&gt;&lt;P&gt;         carrname TYPE scarr-carrname, &lt;/P&gt;&lt;P&gt;         connid   TYPE spfli-connid, &lt;/P&gt;&lt;P&gt;       END OF wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE SORTED TABLE OF wa &lt;/P&gt;&lt;P&gt;               WITH UNIQUE KEY fldate carrname connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT c&lt;SUB&gt;carrname p&lt;/SUB&gt;connid f~fldate &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE itab &lt;/P&gt;&lt;P&gt;       FROM ( ( scarr AS c &lt;/P&gt;&lt;P&gt;         INNER JOIN spfli AS p ON p&lt;SUB&gt;carrid   = c&lt;/SUB&gt;carrid &lt;/P&gt;&lt;P&gt;                              AND p~cityfrom = p_cityfr &lt;/P&gt;&lt;P&gt;                              AND p~cityto   = p_cityto ) &lt;/P&gt;&lt;P&gt;         INNER JOIN sflight AS f ON f&lt;SUB&gt;carrid = p&lt;/SUB&gt;carrid &lt;/P&gt;&lt;P&gt;                                AND f&lt;SUB&gt;connid = p&lt;/SUB&gt;connid ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa. &lt;/P&gt;&lt;P&gt;  WRITE: / wa-fldate, wa-carrname, wa-connid. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS p_cityfr TYPE spfli-cityfrom. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa, &lt;/P&gt;&lt;P&gt;        carrid   TYPE scarr-carrid, &lt;/P&gt;&lt;P&gt;        carrname TYPE scarr-carrname, &lt;/P&gt;&lt;P&gt;        connid   TYPE spfli-connid, &lt;/P&gt;&lt;P&gt;      END OF wa, &lt;/P&gt;&lt;P&gt;      itab LIKE SORTED TABLE OF wa &lt;/P&gt;&lt;P&gt;                WITH NON-UNIQUE KEY carrid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT s&lt;SUB&gt;carrid s&lt;/SUB&gt;carrname p~connid &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE itab &lt;/P&gt;&lt;P&gt;       FROM scarr AS s &lt;/P&gt;&lt;P&gt;       LEFT OUTER JOIN spfli AS p ON s&lt;SUB&gt;carrid   =  p&lt;/SUB&gt;carrid &lt;/P&gt;&lt;P&gt;                                  AND p~cityfrom = p_cityfr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa. &lt;/P&gt;&lt;P&gt;  IF wa-connid = '0000'. &lt;/P&gt;&lt;P&gt;    WRITE: / wa-carrid, wa-carrname. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2008 04:26:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/left-outer-join-with-internal-tables/m-p/3524037#M847664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-03T04:26:42Z</dc:date>
    </item>
  </channel>
</rss>

