<?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: Select query using JOINS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580342#M861955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaydeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your method.&lt;/P&gt;&lt;P&gt;But in the selection for Ztables am not getting any rows. This is the case with all the 3 ztable select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have given the select stmts as under:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZALLIDOM&lt;/P&gt;&lt;P&gt;         ZZALLIPER from ZPSTR_PROJ_APP into table it_proj_app for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZPRACDOM&lt;/P&gt;&lt;P&gt;         ZZPRACPER from ZPSTR_PROJ_PRAC into table it_proj_prac for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZCOEDOM&lt;/P&gt;&lt;P&gt;         ZZCOEPER from ZPSTR_PROJ_COE into table it_proj_coe for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look guide me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 16:02:38 GMT</pubDate>
    <dc:creator>arunneerolil</dc:creator>
    <dc:date>2008-03-25T16:02:38Z</dc:date>
    <item>
      <title>Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580337#M861950</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;My requirement is to select fields from 4 tables, where  DPR_PROJECTS(table-cprojects) being the main table, the selection is based on status of last chagned on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll Select all the records that got changed after a particular date. that is fine till here.&lt;/P&gt;&lt;P&gt;But I have to select from another 3 Ztables say ZPSTR_PROJ_APP; ZPSTR_PROJ_PRAC; ZPSTR_PROJ_COE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In all the tables I have GUID as the Key(common) Filed. So i have to select from all tables the records that satisfies the condition of (last changed on, from main table DPR_PROJECT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guid me this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Chem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 04:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580337#M861950</guid>
      <dc:creator>arunneerolil</dc:creator>
      <dc:date>2008-03-25T04:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580338#M861951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joins are used to fetch data fast from Database tables:&lt;/P&gt;&lt;P&gt;Tables are joined with the proper key fields to fetch the data properly.&lt;/P&gt;&lt;P&gt;If there are no proper key fields between tables don't use Joins;&lt;/P&gt;&lt;P&gt;Important thing is that don't USE JOINS FOR CLUSTER tableslike BSEG and KONV.&lt;/P&gt;&lt;P&gt;Only use for Transparenmt tables.&lt;/P&gt;&lt;P&gt;You can also use joins for the database VIews to fetch the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JOINS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... FROM tabref1 [INNER] JOIN tabref2 ON cond &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON&amp;gt;cond. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 Table 2 &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;E&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;F&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;G&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;H&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;a1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;b1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;c1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;e1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;f1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;g1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt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t;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;a4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;b4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;c4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;|--&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;--| &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\/ &lt;/P&gt;&lt;P&gt;Inner Join &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;E&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;F&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;G&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;H&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&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P&gt;a4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;b4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;c4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;e2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;f2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;g2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;h2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;|--&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&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;Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: DATE LIKE SFLIGHT-FLDATE, &lt;/P&gt;&lt;P&gt;CARRID LIKE SFLIGHT-CARRID, &lt;/P&gt;&lt;P&gt;CONNID LIKE SFLIGHT-CONNID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT F&lt;SUB&gt;CARRID F&lt;/SUB&gt;CONNID F~FLDATE &lt;/P&gt;&lt;P&gt;INTO (CARRID, CONNID, DATE) &lt;/P&gt;&lt;P&gt;FROM SFLIGHT AS F INNER JOIN SPFLI AS P &lt;/P&gt;&lt;P&gt;ON F&lt;SUB&gt;CARRID = P&lt;/SUB&gt;CARRID AND &lt;/P&gt;&lt;P&gt;F&lt;SUB&gt;CONNID = P&lt;/SUB&gt;CONNID &lt;/P&gt;&lt;P&gt;WHERE P~CITYFROM = 'FRANKFURT' &lt;/P&gt;&lt;P&gt;AND P~CITYTO = 'NEW YORK' &lt;/P&gt;&lt;P&gt;AND F~FLDATE BETWEEN '20010910' AND '20010920' &lt;/P&gt;&lt;P&gt;AND F&lt;SUB&gt;SEATSOCC &amp;lt; F&lt;/SUB&gt;SEATSMAX. &lt;/P&gt;&lt;P&gt;WRITE: / DATE, CARRID, CONNID. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: DATE LIKE SFLIGHT-FLDATE, &lt;/P&gt;&lt;P&gt;CARRID LIKE SFLIGHT-CARRID, &lt;/P&gt;&lt;P&gt;CONNID LIKE SFLIGHT-CONNID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT F&lt;SUB&gt;CARRID F&lt;/SUB&gt;CONNID F~FLDATE &lt;/P&gt;&lt;P&gt;INTO (CARRID, CONNID, DATE) &lt;/P&gt;&lt;P&gt;FROM SFLIGHT AS F INNER JOIN SPFLI AS P &lt;/P&gt;&lt;P&gt;ON F&lt;SUB&gt;CARRID = P&lt;/SUB&gt;CARRID &lt;/P&gt;&lt;P&gt;WHERE F&lt;SUB&gt;CONNID = P&lt;/SUB&gt;CONNID &lt;/P&gt;&lt;P&gt;AND P~CITYFROM = 'FRANKFURT' &lt;/P&gt;&lt;P&gt;AND P~CITYTO = 'NEW YORK' &lt;/P&gt;&lt;P&gt;AND F~FLDATE BETWEEN '20010910' AND '20010920' &lt;/P&gt;&lt;P&gt;AND F&lt;SUB&gt;SEATSOCC &amp;lt; F&lt;/SUB&gt;SEATSMAX. &lt;/P&gt;&lt;P&gt;WRITE: / DATE, CARRID, CONNID. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only a table or view may appear to the right of the JOIN operator, not another join expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only AND is possible in the ON condition as a logical operator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each comparison in the ON condition must contain a field from the right-hand table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3 &lt;/P&gt;&lt;P&gt;... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left outer join between table 1 and table 2 where column D in both tables set the join condition: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 Table 2 &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;E&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;F&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;G&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;H&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&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lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;--| &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\ / &lt;/P&gt;&lt;P&gt;\/ &lt;/P&gt;&lt;P&gt;Left Outer Join &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;E&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;F&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;G&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;H&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;HR originaltext="---" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;a1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;b1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;c1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;e1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;f1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;g1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;h1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;T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gt;&lt;P&gt;c4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;e2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;f2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;g2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;h2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;|--&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;&lt;DEL&gt;|&lt;/DEL&gt;--| &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Output a list of all custimers with their bookings for October 15th, 2001: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: CUSTOMER TYPE SCUSTOM, &lt;/P&gt;&lt;P&gt;BOOKING TYPE SBOOK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SCUSTOM&lt;SUB&gt;NAME SCUSTOM&lt;/SUB&gt;POSTCODE SCUSTOM~CITY &lt;/P&gt;&lt;P&gt;SBOOK&lt;SUB&gt;FLDATE SBOOK&lt;/SUB&gt;CARRID SBOOK&lt;SUB&gt;CONNID SBOOK&lt;/SUB&gt;BOOKID &lt;/P&gt;&lt;P&gt;INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY, &lt;/P&gt;&lt;P&gt;BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID, &lt;/P&gt;&lt;P&gt;BOOKING-BOOKID) &lt;/P&gt;&lt;P&gt;FROM SCUSTOM LEFT OUTER JOIN SBOOK &lt;/P&gt;&lt;P&gt;ON SCUSTOM&lt;SUB&gt;ID = SBOOK&lt;/SUB&gt;CUSTOMID AND &lt;/P&gt;&lt;P&gt;SBOOK~FLDATE = '20011015' &lt;/P&gt;&lt;P&gt;ORDER BY SCUSTOM&lt;SUB&gt;NAME SBOOK&lt;/SUB&gt;FLDATE. &lt;/P&gt;&lt;P&gt;WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY, &lt;/P&gt;&lt;P&gt;BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID, &lt;/P&gt;&lt;P&gt;BOOKING-BOOKID. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or using an alias. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;For the resulting set of a SELECT command with a left outer join in the FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Since not all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outer join, the syntax has been restricted to those cases that return the same solution in all database systems: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only a table or view may come after the JOIN operator, not another join statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only logical operator allowed in the ON condition is AND. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each comparison in the ON condition must contain a field from the right-hand table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comparisons in the WHERE condition must not contain a field from the right-hand table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ON condition must contain at least one "real" JOIN condition (a condition in which a field from tabref1 as well as from tabref2 occurs). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;In some cases, '*' may be specivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the llen in der FROM clause, according to the structure of each table work area. There can be gaps between the table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, as in the following example (not simply by counting the total number of fields). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Example of a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001 where there are available places, and display the name of the airline. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF WA, &lt;/P&gt;&lt;P&gt;FLIGHT TYPE SFLIGHT, &lt;/P&gt;&lt;P&gt;PFLI TYPE SPFLI, &lt;/P&gt;&lt;P&gt;CARR TYPE SCARR, &lt;/P&gt;&lt;P&gt;END OF WA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * INTO WA &lt;/P&gt;&lt;P&gt;FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P &lt;/P&gt;&lt;P&gt;ON F&lt;SUB&gt;CARRID = P&lt;/SUB&gt;CARRID AND &lt;/P&gt;&lt;P&gt;F&lt;SUB&gt;CONNID = P&lt;/SUB&gt;CONNID ) &lt;/P&gt;&lt;P&gt;INNER JOIN SCARR AS C &lt;/P&gt;&lt;P&gt;ON F&lt;SUB&gt;CARRID = C&lt;/SUB&gt;CARRID &lt;/P&gt;&lt;P&gt;WHERE P~CITYFROM = 'FRANKFURT' &lt;/P&gt;&lt;P&gt;AND P~CITYTO = 'NEW YORK' &lt;/P&gt;&lt;P&gt;AND F~FLDATE BETWEEN '20010910' AND '20010920' &lt;/P&gt;&lt;P&gt;AND F&lt;SUB&gt;SEATSOCC &amp;lt; F&lt;/SUB&gt;SEATSMAX. &lt;/P&gt;&lt;P&gt;WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID, &lt;/P&gt;&lt;P&gt;WA-FLIGHT-CONNID. &lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... [(] {dbtab_left [AS tabalias_left]} | join &lt;/P&gt;&lt;P&gt;{[INNER] JOIN}|{LEFT [OUTER] JOIN} &lt;/P&gt;&lt;P&gt;{dbtab_right [AS tabalias_right] ON join_cond} [)] ... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of [INNER] JOIN or LEFT [OUTER] JOIN . Depending on the type of join, a join expression can be either an inner ( INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least one comparison must be specified after ON. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Individual comparisons may be joined using AND only. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following language elements may not be used: BETWEEN, LIKE, IN. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No sub-queries may be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For outer joins, only equality comparisons (=, EQ) are possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resulting set for inner join &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resulting set for outer join &lt;/P&gt;&lt;P&gt;&lt;/P&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;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;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;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 04:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580338#M861951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T04:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580339#M861952</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;DATA  :begin of itab.&lt;/P&gt;&lt;P&gt;include structure DPR_PROJECTS.&lt;/P&gt;&lt;P&gt;include structure ZPSTR_PROJ_APP.&lt;/P&gt;&lt;P&gt;include structure  ZPSTR_PROJ_PRAC.&lt;/P&gt;&lt;P&gt;include structure  ZPSTR_PROJ_COE.&lt;/P&gt;&lt;P&gt;data : end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * INTO TABLE itab[] FROM DPR_PROJECTS JOIN ZPSTR_PROJ_APP&lt;/P&gt;&lt;P&gt;                          ON DPR_PROJECTS&lt;SUB&gt;GUID = ZPSTR_PROJ_APP&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;                          JOIN ZPSTR_PROJ_PRAC&lt;/P&gt;&lt;P&gt;                          ON  ZPSTR_PROJ_APP&lt;SUB&gt;GUID = ZPSTR_PROJ_PRAC&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;                          JOIN ZPSTR_PROJ_COE&lt;/P&gt;&lt;P&gt;                          ZPSTR_PROJ_PRAC&lt;SUB&gt;GUID = ZPSTR_PROJ_COE&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;                          WHERE DPR_PROJECTS~LASTCHANGED = '&amp;lt;CONDITION&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 04:49:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580339#M861952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T04:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580340#M861953</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; I think FOR ALL ENTRIES will be a better option to suit your requirement than to go for a join. You said all the tables have a common primary field as 'GUID', then u write like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First select for main db table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &amp;lt;some fields&amp;gt;&lt;/P&gt;&lt;P&gt;from &amp;lt;db table1&amp;gt;&lt;/P&gt;&lt;P&gt;into &amp;lt;int table 1&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;condition last change&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second select for 1st Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &amp;lt;some fields&amp;gt;&lt;/P&gt;&lt;P&gt;from &amp;lt;1st Z table&amp;gt;&lt;/P&gt;&lt;P&gt;into &amp;lt;int table 2&amp;gt;&lt;/P&gt;&lt;P&gt;for all entries &amp;lt;in 1st int table&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;condition last change&amp;gt;&lt;/P&gt;&lt;P&gt;and &amp;lt;guid eq 1st int table-guid&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Likewise fire two more SELECT FOR ALL ENTRIES for rest other two z table. Put the data into separate internal table and then finally compose the data into a global internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;Reward points if helpfull....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 04:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580340#M861953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T04:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580341#M861954</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;For your scenario the code is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;field1 b&lt;/SUB&gt;field2 c&lt;SUB&gt;field3 d&lt;/SUB&gt;field4&lt;/P&gt;&lt;P&gt;         into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;         from dpr_project as a inner join ZPSTR_PROJ_APP AS B&lt;/P&gt;&lt;P&gt;         ON A&lt;SUB&gt;GUID = B&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;         AND &amp;lt;CONDITIONS..&amp;gt;&lt;/P&gt;&lt;P&gt;         INNER JOIN ZPSTR_PROJ_PRAC AS C&lt;/P&gt;&lt;P&gt;         ON B&lt;SUB&gt;GUID = C&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;         AND &amp;lt;CONDITIONS..&amp;gt;&lt;/P&gt;&lt;P&gt;         INNER JOIN ZPSTR_PROJ_COE AS D&lt;/P&gt;&lt;P&gt;         ON C&lt;SUB&gt;GUID = D&lt;/SUB&gt;GUID&lt;/P&gt;&lt;P&gt;         AND &amp;lt;CONDITIONS..&amp;gt;&lt;/P&gt;&lt;P&gt;        WHERE &amp;lt;CONDITIONS&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will help you in some means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Don't use inner join for more than 2 tables. Instead first write a select query from the header table as you have mentioned &lt;/P&gt;&lt;P&gt;DPR_PROJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then within the loop write the select query for the rest of the tables. Say for example we are having tables mara,marc,makt,mard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that in your internal table just populate the data from the table MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then within the loop you can have code as like the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into corresponding fields of table itab.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;select * from marc.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;select * from mard.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;select * from makt.&lt;/P&gt;&lt;P&gt;endselect.&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;Regards,&lt;/P&gt;&lt;P&gt;Sankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 04:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580341#M861954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T04:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580342#M861955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaydeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your method.&lt;/P&gt;&lt;P&gt;But in the selection for Ztables am not getting any rows. This is the case with all the 3 ztable select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have given the select stmts as under:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZALLIDOM&lt;/P&gt;&lt;P&gt;         ZZALLIPER from ZPSTR_PROJ_APP into table it_proj_app for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZPRACDOM&lt;/P&gt;&lt;P&gt;         ZZPRACPER from ZPSTR_PROJ_PRAC into table it_proj_prac for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select GUID&lt;/P&gt;&lt;P&gt;         PROJECT_ID&lt;/P&gt;&lt;P&gt;         ZZCOEDOM&lt;/P&gt;&lt;P&gt;         ZZCOEPER from ZPSTR_PROJ_COE into table it_proj_coe for all entries in it_project_all&lt;/P&gt;&lt;P&gt;          where guid eq it_project_all-guid AND PROJECT_ID EQ IT_PROJECT_ALL-PROJECT_ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look guide me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 16:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580342#M861955</guid>
      <dc:creator>arunneerolil</dc:creator>
      <dc:date>2008-03-25T16:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580343#M861956</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;First select the data from main table DPR_PROJECTS in to one itab. then join the three ztables ZPSTR_PROJ_APP; PSTR_PROJ_PRAC; ZPSTR_PROJ_COE using common field GUID.select that data into another table jtab. &lt;/P&gt;&lt;P&gt;loop the first table itab and read the secondtable  jtab and append data into final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 16:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580343#M861956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T16:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580344#M861957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check whether ur ztables contain any entries or may be where condition is not met&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 16:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580344#M861957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T16:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580345#M861958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first write the select statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select for the source table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select for all entries for the first table from source table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select for all entries for the second table from source table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select for all entries for the third table from source table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 16:19:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580345#M861958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T16:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select query using JOINS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580346#M861959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for all your inputs &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2008 04:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-using-joins/m-p/3580346#M861959</guid>
      <dc:creator>arunneerolil</dc:creator>
      <dc:date>2008-04-15T04:33:21Z</dc:date>
    </item>
  </channel>
</rss>

