<?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: Inner join query not working properly in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531573#M1656727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
INNER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
INNER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
LEFT OUTER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
LEFT OUTER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as long as the table is not used in where condition, u can use left outter join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Feb 2012 08:10:24 GMT</pubDate>
    <dc:creator>surajarafath</dc:creator>
    <dc:date>2012-02-22T08:10:24Z</dc:date>
    <item>
      <title>Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531568#M1656722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does not gives any error, but it is not fetching any values...but when i dont include fourth table CSKT AND THE FIELD LTEXT it is fetching the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE&lt;/P&gt;&lt;P&gt;      T1~PERNR&lt;/P&gt;&lt;P&gt;      T1~BEGDA&lt;/P&gt;&lt;P&gt;      T1~ENAME&lt;/P&gt;&lt;P&gt;      T1~PLANS&lt;/P&gt;&lt;P&gt;      T1~KOSTL&lt;/P&gt;&lt;P&gt;      T2~STRAS&lt;/P&gt;&lt;P&gt;      T2~PSTLZ&lt;/P&gt;&lt;P&gt;      T2~ORT01&lt;/P&gt;&lt;P&gt;      T3~PLSTX&lt;/P&gt;&lt;P&gt;      T4~LTEXT&lt;/P&gt;&lt;P&gt;      INTO  FS_TAB&lt;/P&gt;&lt;P&gt;      FROM PA0001 AS T1&lt;/P&gt;&lt;P&gt;      INNER JOIN PA0006 AS T2 ON T1&lt;SUB&gt;PERNR eq T2&lt;/SUB&gt;PERNR&lt;/P&gt;&lt;P&gt;      INNER JOIN T528T AS T3 ON T1&lt;SUB&gt;PLANS EQ T3&lt;/SUB&gt;PLANS&lt;/P&gt;&lt;P&gt;      INNER JOIN CSKT AS T4 ON T1&lt;SUB&gt;KOSTL EQ T4&lt;/SUB&gt;KOSTL&lt;/P&gt;&lt;P&gt;      WHERE T1~PERNR eq p_pernr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 06:55:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531568#M1656722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T06:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531569#M1656723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vasanthakumar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LEFT OUTER JOIN CSKT ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using OUTER JOIN, if even CSKT table is empty it will not reduce the number of selected records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will be helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;George Shlyahov.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 07:14:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531569#M1656723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T07:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531570#M1656724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vasanthakumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You Inner join is not fetching any values, may be because there are no records for the combination,&lt;/P&gt;&lt;P&gt;Try excluding CSKT AND THE FIELD LTEXT &amp;amp; Use for all entries from the CSKT table w.r.t. the records you get in the inner join statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 07:18:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531570#M1656724</guid>
      <dc:creator>SharathYaralkattimath</dc:creator>
      <dc:date>2012-02-22T07:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531571#M1656725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 07:40:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531571#M1656725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T07:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531572#M1656726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vasanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        I would suggest you not to use inner join in any of your queries. Try using the FOR ALL ENTRIES. But in case of using for all entries follow all the prerequisites for that,&lt;/P&gt;&lt;P&gt;1). Sort the table first.&lt;/P&gt;&lt;P&gt;2). Check if it is not initial.&lt;/P&gt;&lt;P&gt;3). Copy it to temporary table and remove adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the table you use in For all entries is empty then it will fetch all the records from the table for the query written. i.e., there is no point in using for all entries of an empty table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to your question,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    You are not getting any results because one of your table in your joins doesn't have any records meeting your selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Praveenkumar T.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 07:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531572#M1656726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T07:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531573#M1656727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
INNER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
INNER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
LEFT OUTER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
LEFT OUTER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as long as the table is not used in where condition, u can use left outter join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 08:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531573#M1656727</guid>
      <dc:creator>surajarafath</dc:creator>
      <dc:date>2012-02-22T08:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531574#M1656728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;         I would suggest you not to use inner join in any of your queries. Try using the FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What for it is so categorical?&lt;/P&gt;&lt;P&gt;INNER JOIN is very useful construction and it should be implemented if it is necessary (up to 3 times in one select it is normal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It already was discussed repeatedly. To avoid holy war, check this thread:&lt;/P&gt;&lt;P&gt;[http://forums.sdn.sap.com/thread.jspa?threadID=996959&amp;amp;tstart=0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;George Shlyahov.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 08:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531574#M1656728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T08:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531575#M1656729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before i saw your response, i found that the values are missing for the field KOSTL in table PA0001.  Thx for ur response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 08:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531575#M1656729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-22T08:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join query not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531576#M1656730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A little off-topic, let me suggest to drop those aliases, the code is more difficult to read, better use the actual table names in the column identifiers. Aliases make sense (and are mandatory) when you are joining the same table several times.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 12:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-query-not-working-properly/m-p/8531576#M1656730</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-02-22T12:49:00Z</dc:date>
    </item>
  </channel>
</rss>

