<?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: URGENTLY NEED INNER JOIN-SYNTAX in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550183#M580589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select a&lt;SUB&gt;airln a&lt;/SUB&gt;lnnam b&lt;SUB&gt;fligh b&lt;/SUB&gt;cntry into table int_airdet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            From zairln as a inner join zflight as b on a&lt;SUB&gt;airln = b&lt;/SUB&gt;airln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;pls Reward pts if found usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jul 2007 05:58:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-16T05:58:19Z</dc:date>
    <item>
      <title>URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550176#M580582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I URGENTLY NEED INNER-JOIN STATMENT  SYNTAX&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550176#M580582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550177#M580583</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;chk the foll code&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;regards,&lt;/P&gt;&lt;P&gt;Navneeth K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:49:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550177#M580583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550178#M580584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select tab1&lt;SUB&gt;field1 tab2&lt;/SUB&gt;field2 &lt;/P&gt;&lt;P&gt;    into table t_table&lt;/P&gt;&lt;P&gt;    from tab1&lt;/P&gt;&lt;P&gt;   inner join tab2&lt;/P&gt;&lt;P&gt;       on tab1&lt;SUB&gt;field1 = tab2&lt;/SUB&gt;field2&lt;/P&gt;&lt;P&gt;   where field1 in s_field1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:50:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550178#M580584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550179#M580585</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;follow these link for sample programs and statement on INNER JOIN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_InnerJoinStatement.asp" target="test_blank"&gt;http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_InnerJoinStatement.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashok Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550179#M580585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550180#M580586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Specifying Two or More Database Tables as an Inner Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a relational database, you normally need to read data simultaneously from more than one database table into an application program. You can read from more than one table in a single SELECT statement, such that the data in the tables all has to meet the same conditions, using the following join expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT... &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM &amp;lt;tab&amp;gt; [INNER] JOIN &amp;lt;dbtab&amp;gt; [AS &amp;lt;alias&amp;gt;] ON &amp;lt;cond&amp;gt; &amp;lt;options&amp;gt; &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;dbtab&amp;gt; is a single database table and &amp;lt;tab&amp;gt; is either a table or another join expression. The database tables can be specified statically or dynamically as described above. You may also use aliases. You can enclose each join expression in parentheses. The INNER addition is optional.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A join expression links each line of &amp;lt;tab&amp;gt; with the lines in &amp;lt;dbtab&amp;gt; that meet the condition &amp;lt;cond&amp;gt;. This means that there is always one or more lines from the right-hand table that is linked to each line from the left-hand table by the join. If &amp;lt;dbtab&amp;gt; does not contain any lines that meet the condition &amp;lt;cond&amp;gt;, the line from &amp;lt;tab&amp;gt; is not included in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax of the &amp;lt;cond&amp;gt; condition is like that of the WHERE clause, although individual comparisons can only be linked using AND. Furthermore, each comparison must contain a column from the right-hand table &amp;lt;dbtab&amp;gt;. It does not matter on which side of the comparison it occurs. For the column names in the comparison, you can use the same names that occur in the SELECT clause, to differentiate columns from different database tables that have the same names. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The comparisons in the condition &amp;lt;cond&amp;gt; can appear in the WHERE clause instead of the ON clause, since both clauses are applied equally to the temporary table containing all of the lines resulting from the join. However, each join must contain at least one comparison in the condition &amp;lt;cond&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying Two or More Database Tables as a Left Outer Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an inner join, a line from the left-hand database table or join is only included in the selection if there is one or more lines in the right-hand database table that meet the ON condition &amp;lt;cond&amp;gt;. The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT... &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM &amp;lt;tab&amp;gt; LEFT [OUTER] JOIN &amp;lt;dbtab&amp;gt; [AS &amp;lt;alias&amp;gt;] ON &amp;lt;cond&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;options&amp;gt; &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tab&amp;gt; and &amp;lt;dbtab&amp;gt; are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from &amp;lt;tab&amp;gt; are included in the final selection. If &amp;lt;dbtab&amp;gt; does not contain any lines that meet the condition &amp;lt;cond&amp;gt;, the system includes a single line in the selection whose columns from &amp;lt;dbtab&amp;gt; are filled with null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the left outer join, more restrictions apply to the condition &amp;lt;cond&amp;gt; than in the inner join. In addition to the above restrictions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EQ or = is the only permitted relational operator. &lt;/P&gt;&lt;P&gt;There must be at least one comparison between columns from &amp;lt;tab&amp;gt; and &amp;lt;dbtab&amp;gt;. &lt;/P&gt;&lt;P&gt;The WHERE clause may not contain any comparisons with columns from &amp;lt;dbtab&amp;gt;. All comparisons using columns from &amp;lt;dbtab&amp;gt; must appear in the condition &amp;lt;cond&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Minimize the Number of Data Transfers &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In every Open SQL statement, data is transferred between the application server and the database system. Furthermore, the database system has to construct or reopen the appropriate administration data for each database access. You can therefore minimize the load on the network and the database system by minimizing the number of times you access the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Multiple Operations Instead of Single Operations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you change data using INSERT, UPDATE, and DELETE, use internal tables instead of single entries. If you read data using SELECT, it is worth using multiple operations if you want to process the data more than once, other wise, a simple select loop is more efficient. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid Repeated Access&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a rule you should read a given set of data once only in your program, and using a single access. Avoid accessing the same data more than once (for example, SELECT before an UPDATE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid Nested SELECT Loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. You should therefore only use nested SELECT loops if the selection in the outer loop contains very few lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, using combinations of data from different database tables is more the rule than the exception in the relational data model. You can use the following techniques to avoid nested SELECT statements: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Dictionary Views&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define joins between database tables statically and systemwide as views in the ABAP Dictionary. ABAP Dictionary views can be used by all ABAP programs. One of their advantages is that fields that are common to both tables (join fields) are only transferred once from the database to the application server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Views in the ABAP Dictionary are implemented as inner joins. If the inner table contains no lines that correspond to lines in the outer table, no data is transferred. This is not always the desired result. For example, when you read data from a text table, you want to include lines in the selection even if the corresponding text does not exist in the required language. If you want to include all of the data from the outer table, you can program a left outer join in ABAP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The links between the tables in the view are created and optimized by the database system. Like database tables, you can buffer views on the application server. The same buffering rules apply to views as to tables. In other words, it is most appropriate for views that you use mostly to read data. This reduces the network load and the amount of physical I/O in the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joins in the FROM Clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read data from more than one database table in a single SELECT statement by using inner or left outer joins in the FROM clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The disadvantage of using joins is that redundant data is read from the hierarchically-superior table if there is a 1:N relationship between the outer and inner tables. This can considerably increase the amount of data transferred from the database to the application server. Therefore, when you program a join, you should ensure that the SELECT clause contains a list of only the columns that you really need. Furthermore, joins bypass the table buffer and read directly from the database. For this reason, you should use an ABAP Dictionary view instead of a join if you only want to read the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The runtime of a join statement is heavily dependent on the database optimizer, especially when it contains more than two database tables. However, joins are nearly always quicker than using nested SELECT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subqueries in the WHERE and HAVING Clauses&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of accessing more than one database table in the same Open SQL statement is to use subqueries in the WHERE or HAVING clause. The data from a subquery is not transferred to the application server. Instead, it is used to evaluate conditions in the database system. This is a simple and effective way of programming complex database operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is also possible to avoid nested SELECT loops by placing the selection from the outer loop in an internal table and then running the inner selection once only using the FOR ALL ENTRIES addition. This technique stems from the time before joins were allowed in the FROM clause. On the other hand, it does prevent redundant data from being transferred from the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a Cursor to Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A further method is to decouple the INTO clause from the SELECT statement by opening a cursor using OPEN CURSOR and reading data line by line using FETCH NEXT CURSOR. You must open a new cursor for each nested loop. In this case, you must ensure yourself that the correct lines are read from the database tables in the correct order. This usually requires a foreign key relationship between the database tables, and that they are sorted by the foreign key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull:)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550180#M580586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550181#M580587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SYNTAX:&lt;/P&gt;&lt;P&gt;EXAMPLE OF INNER JOIN BETWEEN MARA &amp;amp; MAKT TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT J1&lt;SUB&gt;MATNR J1&lt;/SUB&gt;MEINS J2~MAKTX&lt;/P&gt;&lt;P&gt;  FROM MARA AS J1&lt;/P&gt;&lt;P&gt;    INNER JOIN MAKT AS J2&lt;/P&gt;&lt;P&gt;      ON J2&lt;SUB&gt;MATNR EQ J1&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;      AND J2~SPRAS EQ 'E'&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF INT_TAB&lt;/P&gt;&lt;P&gt;  WHERE J1~MATNR EQ MATERIAL_NO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE : AWARD POINTS IF USEFUL.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550181#M580587</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550182#M580588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt; a~omeng &lt;/P&gt;&lt;P&gt; b~vgbel &lt;/P&gt;&lt;P&gt; b~vgpos &lt;/P&gt;&lt;P&gt; c~vbeln &lt;/P&gt;&lt;P&gt; c~posnr &lt;/P&gt;&lt;P&gt; c~klmeng &lt;/P&gt;&lt;P&gt; c~netwr&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;&lt;P&gt;FROM vbbe AS a INNER JOIN lips AS b&lt;/P&gt;&lt;P&gt;               ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;             AND a&lt;SUB&gt;posnr = b&lt;/SUB&gt;posnr&lt;/P&gt;&lt;P&gt;   INNER JOIN vbap AS c&lt;/P&gt;&lt;P&gt;               ON b&lt;SUB&gt;vgbel = c&lt;/SUB&gt;vbeln &lt;/P&gt;&lt;P&gt;             AND b&lt;SUB&gt;vgpos = c&lt;/SUB&gt;posnr&lt;/P&gt;&lt;P&gt;WHERE a~vbtyp = 'J'&lt;/P&gt;&lt;P&gt;      AND a~werks like '21%'&lt;/P&gt;&lt;P&gt;      AND c~klmeng &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will be helpful for u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: anju&lt;/P&gt;&lt;P&gt;        anju sinha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550182#M580588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550183#M580589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select a&lt;SUB&gt;airln a&lt;/SUB&gt;lnnam b&lt;SUB&gt;fligh b&lt;/SUB&gt;cntry into table int_airdet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            From zairln as a inner join zflight as b on a&lt;SUB&gt;airln = b&lt;/SUB&gt;airln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;pls Reward pts if found usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 05:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550183#M580589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T05:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550184#M580590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I NEED SYNTAX FOR JOINING 4 TABLES AND USING A SELECT CONDITION ON IT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; HELP ME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 06:43:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550184#M580590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T06:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550185#M580591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ashok &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; Select single Vbrk~Bukrs Vbrk~Kunrg    Vbrk~Vbeln  
                   Vbrk~Fkdat Vbrk~Bstnk_Vf Vbrk~Zterm  
                   Tvzbt~Vtext  
                   Vbak~Vbeln Vbak~Bstdk  
                   Likp~Vbeln Likp~lfdat    Likp~Lfuhr  
       into w_vbrk  
       from vbrk  
      inner join       Tvzbt on Tvzbt~Zterm        = Vbrk~Zterm      and  
                                Tvzbt~Spras        = sy-langu  
      Inner join       Vbfa  as SalesLnk  
                             on SalesLnk~vbeln     = pu_vbeln        and  
                                SalesLnk~vbtyp_v   = c_order  
            inner join Vbak  on Vbak~Vbeln           = SalesLnk~Vbelv 
      Inner join       Vbfa  as DeliveryLnk  
                             on DeliveryLnk~vbeln   = pu_vbeln       and  
                                DeliveryLnk~vbtyp_v = c_Delivery  
            inner join Likp  on Likp~Vbeln          = DeliveryLnk~Vbelv  
      where vbrk~vbeln = pu_Vbeln.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 06:45:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550185#M580591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T06:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550186#M580592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WHILE WE ARE USING SELECT STATMENT WITH INNER-JOIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHOULD I CLOSE WITN END-SELECT &lt;/P&gt;&lt;P&gt;OR NOT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPLAIN ME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 06:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550186#M580592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T06:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: URGENTLY NEED INNER JOIN-SYNTAX</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550187#M580593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no need to declare a endselect statement. refer to the above example which i had given in which u can find 3 inner joins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;CHECK THESE LINKS TOO&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;a href="http://www.sap-img.com/abap/select-statement-with-inner-join-is-taking-forever.htm"&amp;gt;INNER JOIN&amp;lt;/a&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_InnerJoinStatement.asp"&amp;gt;PROPER USE OF INNER JOIN&amp;lt;/a&amp;gt; &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 07:00:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/urgently-need-inner-join-syntax/m-p/2550187#M580593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T07:00:57Z</dc:date>
    </item>
  </channel>
</rss>

