<?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: Help with a join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077942#M975040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will not be able to use BSEG in a join statement with BKPF for it is a clustered table and BKPF is a transparent table. I suggest you use two SELECT statements for each table or use other tables aside from BSEG. take a look at BSIS, BSAS, BSIK, BSAK, BSID, and BSAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jul 2008 02:52:00 GMT</pubDate>
    <dc:creator>peter_ruiz2</dc:creator>
    <dc:date>2008-07-08T02:52:00Z</dc:date>
    <item>
      <title>Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077938#M975036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following code and it is giving me a syntax error.  I originally had it as a single join (I didn't have coep in it) and it worked.  This tells me that the issue is with the second join (coep).  I have no idea what it could be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  SELECT a~bukrs a~budat a~blart a~belnr a~xblnr b~zuonr b~wrbtr b~hkont b~bseg c~gkont
    INTO CORRESPONDING FIELDS OF TABLE it_working FROM 
    ( ( bkpf AS a INNER JOIN bseg AS b ON
      a~bukrs = b~bukrs AND
      a~belnr = b~belnr AND
      a~gjahr = b~gjahr ) INNER JOIN coep as c on 
      b~kokrs = c~kokrs AND
      b~belnr = c~belnr AND
      b~buzei = c~buzei ) WHERE
      a~bukrs = p_bukrs AND
      a~budat IN s_budat AND
      b~zuonr IN s_zuonr AND
      b~kunnr IN s_kunnr AND
      c~kgont = p_gkont.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any (easy) ideas to get around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the syntax error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;For pooled tables, cluster tables and projection views, JOIN is not allowed: 'BSEG'&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Davis on Jul 7, 2008 10:18 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:15:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077938#M975036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T02:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077939#M975037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  There is no KGONT field in COEP. You might be referring to GKONT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT a&lt;SUB&gt;bukrs a&lt;/SUB&gt;budat a&lt;SUB&gt;blart a&lt;/SUB&gt;belnr a&lt;SUB&gt;xblnr b&lt;/SUB&gt;zuonr b&lt;SUB&gt;wrbtr b&lt;/SUB&gt;hkont b&lt;SUB&gt;bseg c&lt;/SUB&gt;gkont&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE it_working FROM &lt;/P&gt;&lt;P&gt;    ( ( bkpf AS a INNER JOIN bseg AS b ON&lt;/P&gt;&lt;P&gt;      a&lt;SUB&gt;bukrs = b&lt;/SUB&gt;bukrs AND&lt;/P&gt;&lt;P&gt;      a&lt;SUB&gt;belnr = b&lt;/SUB&gt;belnr AND&lt;/P&gt;&lt;P&gt;      a&lt;SUB&gt;gjahr = b&lt;/SUB&gt;gjahr ) INNER JOIN coep as c on &lt;/P&gt;&lt;P&gt;      b&lt;SUB&gt;kokrs = c&lt;/SUB&gt;kokrs AND&lt;/P&gt;&lt;P&gt;      b&lt;SUB&gt;belnr = c&lt;/SUB&gt;belnr AND&lt;/P&gt;&lt;P&gt;      b&lt;SUB&gt;buzei = c&lt;/SUB&gt;buzei ) WHERE&lt;/P&gt;&lt;P&gt;      a~bukrs = p_bukrs AND&lt;/P&gt;&lt;P&gt;      a~budat IN s_budat AND&lt;/P&gt;&lt;P&gt;      b~zuonr IN s_zuonr AND&lt;/P&gt;&lt;P&gt;      b~kunnr IN s_kunnr AND&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;c~kgont = p_gkont&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:20:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077939#M975037</guid>
      <dc:creator>peter_ruiz2</dc:creator>
      <dc:date>2008-07-08T02:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077940#M975038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing that out; I didn't catch it.  However, the issue is on the join of BSEG and COEP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077940#M975038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T02:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077941#M975039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I thought that it would accept a join between bkpf and bseg but in fact it doesn't  Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  SELECT a~bukrs a~budat a~blart a~belnr a~xblnr b~zuonr b~wrbtr b~hkont b~bseg
    INTO CORRESPONDING FIELDS OF TABLE it_working FROM
      bkpf AS a INNER JOIN bseg AS b ON
      a~bukrs = b~bukrs AND
      a~belnr = b~belnr AND
      a~gjahr = b~gjahr WHERE
      a~bukrs = p_bukrs AND
      a~budat IN s_budat AND
      b~zuonr IN s_zuonr AND
      b~kunnr IN s_kunnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:28:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077941#M975039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T02:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077942#M975040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will not be able to use BSEG in a join statement with BKPF for it is a clustered table and BKPF is a transparent table. I suggest you use two SELECT statements for each table or use other tables aside from BSEG. take a look at BSIS, BSAS, BSIK, BSAK, BSID, and BSAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077942#M975040</guid>
      <dc:creator>peter_ruiz2</dc:creator>
      <dc:date>2008-07-08T02:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077943#M975041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.  I assumed that would be the answer so I went ahead and coded it with three select statements (BKPF leading them) with two being inside their own loop.  I then go through the table and use delete statements to get rid of the unwanted records.  That isn't the best as far as performance goes but I will see how it works (performance wise) and, if need be, I'll look at other tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Davis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 02:59:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-a-join/m-p/4077943#M975041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T02:59:39Z</dc:date>
    </item>
  </channel>
</rss>

