<?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 not working. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286024#M1989087</link>
    <description>&lt;P&gt;Just as you did with table CSKT, define for LFA1 a LEFT JOIN instead of an INNER JOIN, because the reason for your select to not have any hits with the INNER JOIN, is that either your selected ACDOCA~LIFNR records do either not contain any data, or they do not contain any matching LFA1~LIFNR data, which could also because of missing zeros for ACDOCA~LIFNR. So first analyse what data you have in your selected ACDOCA records for attribute LIFNR, and then compare it to those in LFA1 for attribute LIFNR. You might have to analyse it in the debugger to realize whether it is because of missing zeros or not. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~rldnr, a~rbukrs, a~gjahr, a~belnr, a~racct, a~rcntr, a~prctr, a~wsl, a~budat,
       a~blart, a~zuonr, a~lifnr, a~ps_posid, a~sgtxt, a~koart, a~timestamp,
       b~saknr, b~txt50, c~bukrs, c~belnr AS belnr1, c~gjahr AS gjahr1, c~bktxt,
       d~name1, d~lifnr AS lifnr1, e~posid, e~post1, f~kostl, f~ltext
FROM acdoca AS a
INNER JOIN skat AS b ON a~racct EQ b~saknr AND b~spras = @sy-langu
INNER JOIN bkpf AS c ON a~rbukrs EQ c~bukrs AND a~gjahr EQ c~gjahr AND a~belnr EQ c~belnr
LEFT  JOIN lfa1 AS d ON a~lifnr EQ d~lifnr
INNER JOIN prps AS e ON a~ps_posid EQ e~posid
LEFT  JOIN cskt AS f ON a~rcntr EQ f~kostl AND f~spras = @sy-langu
INTO TABLE @DATA(lt_acdoca).
WHERE a~rldnr = @lc_led
  AND a~rbukrs = @p_rbukrs
  AND a~belnr IN @so_belnr
  AND a~racct IN @so_racct.

cl_demo_output=&amp;gt;display( lt_acdoca ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Once you have assessed the problem, this will explain to you, why you dont hit any records with the INNER JOIN for LFA1. Afterwards, the community will be able to help you out more, but this would require another community question in case it deals with a situation where ACDOCA~LIFNR is not filled or filled incorrectly.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jul 2020 09:26:19 GMT</pubDate>
    <dc:creator>michael_piesche</dc:creator>
    <dc:date>2020-07-14T09:26:19Z</dc:date>
    <item>
      <title>Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286020#M1989083</link>
      <description>&lt;OL&gt; 
   &lt;LI&gt;when i comment inner join lfa1 line, only then data is getting fetched&lt;/LI&gt; 
   &lt;LI&gt;SELECT a~rldnr, &lt;/LI&gt; 
   &lt;LI&gt; a~rbukrs, &lt;/LI&gt; 
   &lt;LI&gt; a~gjahr, &lt;/LI&gt; 
   &lt;LI&gt; a~belnr, &lt;/LI&gt; 
   &lt;LI&gt; a~racct, &lt;/LI&gt; 
   &lt;LI&gt; a~rcntr,&lt;/LI&gt; 
   &lt;LI&gt; a~prctr, &lt;/LI&gt; 
   &lt;LI&gt; a~wsl, &lt;/LI&gt; 
   &lt;LI&gt; a~budat, &lt;/LI&gt; 
   &lt;LI&gt; a~blart,&lt;/LI&gt; 
   &lt;LI&gt; a~zuonr, &lt;/LI&gt; 
   &lt;LI&gt; a~lifnr, &lt;/LI&gt; 
   &lt;LI&gt; a~ps_posid, &lt;/LI&gt; 
   &lt;LI&gt; a~sgtxt, &lt;/LI&gt; 
   &lt;LI&gt; a~koart, &lt;/LI&gt; 
   &lt;LI&gt; a~timestamp, &lt;/LI&gt; 
   &lt;LI&gt; b~saknr, &lt;/LI&gt; 
   &lt;LI&gt; b~txt50, &lt;/LI&gt; 
   &lt;LI&gt; c~bukrs, &lt;/LI&gt; 
   &lt;LI&gt; c~belnr AS belnr1, &lt;/LI&gt; 
   &lt;LI&gt; c~gjahr AS gjahr1,&lt;/LI&gt; 
   &lt;LI&gt; c~bktxt,&lt;/LI&gt; 
   &lt;LI&gt; d~name1,&lt;/LI&gt; 
   &lt;LI&gt; d~lifnr AS lifnr1, &lt;/LI&gt; 
   &lt;LI&gt; e~posid, &lt;/LI&gt; 
   &lt;LI&gt; e~post1,&lt;/LI&gt; 
   &lt;LI&gt; f~kostl, &lt;/LI&gt; 
   &lt;LI&gt; f~ltext &lt;/LI&gt; 
   &lt;LI&gt; FROM acdoca AS a &lt;/LI&gt; 
   &lt;LI&gt; INNER JOIN skat AS b ON a~racct EQ b~saknr AND b~spras = @sy-langu &lt;/LI&gt; 
   &lt;LI&gt; INNER JOIN bkpf AS c ON a~rbukrs EQ c~bukrs AND a~gjahr EQ c~gjahr AND a~belnr EQ c~belnr &lt;/LI&gt; 
   &lt;LI&gt; INNER JOIN lfa1 AS d ON a~lifnr EQ d~lifnr INNER JOIN prps AS e ON a~ps_posid EQ e~posid&lt;/LI&gt; 
   &lt;LI&gt; LEFT OUTER JOIN cskt AS f ON a~rcntr EQ f~kostl AND f~spras = @sy-langu &lt;/LI&gt; 
   &lt;LI&gt; INTO TABLE @DATA(lt_acdoca) &lt;/LI&gt; 
   &lt;LI&gt; WHERE a~rldnr = @lc_led &lt;/LI&gt; 
   &lt;LI&gt; AND a~rbukrs = @p_rbukrs &lt;/LI&gt; 
   &lt;LI&gt; AND a~belnr IN @so_belnr&lt;/LI&gt; 
   &lt;LI&gt; AND a~racct IN @so_racct.&lt;/LI&gt; 
  &lt;/OL&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:39:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286020#M1989083</guid>
      <dc:creator>former_member677973</dc:creator>
      <dc:date>2020-07-10T13:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286021#M1989084</link>
      <description>&lt;P&gt;Please use the "code" button when posting code.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 14:43:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286021#M1989084</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-07-10T14:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286022#M1989085</link>
      <description>&lt;P&gt;Please format your code with button "CODE".&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:41:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286022#M1989085</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-07-10T16:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286023#M1989086</link>
      <description>&lt;P&gt;Do you not have matching records in LFA1?&lt;BR /&gt;An inner join filters against the other side per definition...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 22:36:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286023#M1989086</guid>
      <dc:creator>gasparerdelyi</dc:creator>
      <dc:date>2020-07-13T22:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286024#M1989087</link>
      <description>&lt;P&gt;Just as you did with table CSKT, define for LFA1 a LEFT JOIN instead of an INNER JOIN, because the reason for your select to not have any hits with the INNER JOIN, is that either your selected ACDOCA~LIFNR records do either not contain any data, or they do not contain any matching LFA1~LIFNR data, which could also because of missing zeros for ACDOCA~LIFNR. So first analyse what data you have in your selected ACDOCA records for attribute LIFNR, and then compare it to those in LFA1 for attribute LIFNR. You might have to analyse it in the debugger to realize whether it is because of missing zeros or not. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT a~rldnr, a~rbukrs, a~gjahr, a~belnr, a~racct, a~rcntr, a~prctr, a~wsl, a~budat,
       a~blart, a~zuonr, a~lifnr, a~ps_posid, a~sgtxt, a~koart, a~timestamp,
       b~saknr, b~txt50, c~bukrs, c~belnr AS belnr1, c~gjahr AS gjahr1, c~bktxt,
       d~name1, d~lifnr AS lifnr1, e~posid, e~post1, f~kostl, f~ltext
FROM acdoca AS a
INNER JOIN skat AS b ON a~racct EQ b~saknr AND b~spras = @sy-langu
INNER JOIN bkpf AS c ON a~rbukrs EQ c~bukrs AND a~gjahr EQ c~gjahr AND a~belnr EQ c~belnr
LEFT  JOIN lfa1 AS d ON a~lifnr EQ d~lifnr
INNER JOIN prps AS e ON a~ps_posid EQ e~posid
LEFT  JOIN cskt AS f ON a~rcntr EQ f~kostl AND f~spras = @sy-langu
INTO TABLE @DATA(lt_acdoca).
WHERE a~rldnr = @lc_led
  AND a~rbukrs = @p_rbukrs
  AND a~belnr IN @so_belnr
  AND a~racct IN @so_racct.

cl_demo_output=&amp;gt;display( lt_acdoca ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Once you have assessed the problem, this will explain to you, why you dont hit any records with the INNER JOIN for LFA1. Afterwards, the community will be able to help you out more, but this would require another community question in case it deals with a situation where ACDOCA~LIFNR is not filled or filled incorrectly.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 09:26:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286024#M1989087</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-07-14T09:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286025#M1989088</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;shanmukhtejas6242_3&lt;/SPAN&gt;, do you continue to have issues or were you able to solve your problem?&lt;/P&gt;&lt;P&gt;Please add comments to your question that further describe your problem or add an answer that describes how you solved your problem.&lt;/P&gt;&lt;P&gt;If your problem is solved, accept an answer if it helped you and please close the question.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 04:18:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-not-working/m-p/12286025#M1989088</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-09-13T04:18:13Z</dc:date>
    </item>
  </channel>
</rss>

