<?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 Problem with subselect in from clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-subselect-in-from-clause/m-p/7715266#M1579503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I am facing a problem with a subselect in the from clause in a select statement.&lt;/P&gt;&lt;P&gt;I executed the statement on my DB2 database and everything works fine. But in ABAP I get an error message.&lt;/P&gt;&lt;P&gt;'( is not table or view' when writing subselect in the from clause.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT tpm03~/bic/zsbetr_nr
               tpm03~/bic/zsbetteil
               tpm03~/bic/zsverszw
               tpm03~calyear
               SUM( tpm03~/bic/zs_kpi_19 )
           FROM /bic/az3_tpm0300 AS tpm03
           JOIN
           ( SELECT /bic/zsbetr_nr                                                                &amp;lt;--------     error
                    /bic/zsbetteil
                    /bic/zsverszw
                    calyear
                    /bic/zsumvcod
                    MAX( /bic/zsglbnr )
             FROM /bic/az3_tpm0300
             WHERE /bic/zsumvcod = 3
             GROUP BY /bic/zsbetr_nr /bic/zsbetteil /bic/zsverszw calyear /bic/zsumvcod )  AS tpm03_max
             ON tpm03~/bic/zsbetr_nr = tpm03_max~/bic/zsbetr_nr AND
                tpm03~/bic/zsbetteil = tpm03_max~/bic/zsbetteil AND
                tpm03~/bic/zsverszw  = tpm03_max~/bic/zsverszw AND
                tpm03~calyear        = tpm03_max~calyear AND
                tpm03~/bic/zsumvcod  = tpm03_max~/bic/zsumvcod AND
                tpm03~/bic/zsglbnr   = tpm03_max~/bic/zsglbnr
          INTO CORRESPONDING FIELDS OF TABLE tpm03_it
          GROUP BY tpm03~/bic/zsbetr_nr
                   tpm03~/bic/zsbetteil
                   tpm03~/bic/zsverszw
                   tpm03~calyear.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can anyone give me some help.&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 8, 2011 3:26 PM - added  tags&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Feb 2011 13:25:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-02-08T13:25:37Z</dc:date>
    <item>
      <title>Problem with subselect in from clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-subselect-in-from-clause/m-p/7715266#M1579503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I am facing a problem with a subselect in the from clause in a select statement.&lt;/P&gt;&lt;P&gt;I executed the statement on my DB2 database and everything works fine. But in ABAP I get an error message.&lt;/P&gt;&lt;P&gt;'( is not table or view' when writing subselect in the from clause.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT tpm03~/bic/zsbetr_nr
               tpm03~/bic/zsbetteil
               tpm03~/bic/zsverszw
               tpm03~calyear
               SUM( tpm03~/bic/zs_kpi_19 )
           FROM /bic/az3_tpm0300 AS tpm03
           JOIN
           ( SELECT /bic/zsbetr_nr                                                                &amp;lt;--------     error
                    /bic/zsbetteil
                    /bic/zsverszw
                    calyear
                    /bic/zsumvcod
                    MAX( /bic/zsglbnr )
             FROM /bic/az3_tpm0300
             WHERE /bic/zsumvcod = 3
             GROUP BY /bic/zsbetr_nr /bic/zsbetteil /bic/zsverszw calyear /bic/zsumvcod )  AS tpm03_max
             ON tpm03~/bic/zsbetr_nr = tpm03_max~/bic/zsbetr_nr AND
                tpm03~/bic/zsbetteil = tpm03_max~/bic/zsbetteil AND
                tpm03~/bic/zsverszw  = tpm03_max~/bic/zsverszw AND
                tpm03~calyear        = tpm03_max~calyear AND
                tpm03~/bic/zsumvcod  = tpm03_max~/bic/zsumvcod AND
                tpm03~/bic/zsglbnr   = tpm03_max~/bic/zsglbnr
          INTO CORRESPONDING FIELDS OF TABLE tpm03_it
          GROUP BY tpm03~/bic/zsbetr_nr
                   tpm03~/bic/zsbetteil
                   tpm03~/bic/zsverszw
                   tpm03~calyear.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can anyone give me some help.&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 8, 2011 3:26 PM - added  tags&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 13:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-subselect-in-from-clause/m-p/7715266#M1579503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-08T13:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with subselect in from clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-subselect-in-from-clause/m-p/7715267#M1579504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OpenSQL isn't as flexible as "proper" SQL. You either should simplify the query or use EXEC SQL. What you currently have is simply not part of the ABAP syntax. (as far as I can tell).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 14:30:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-subselect-in-from-clause/m-p/7715267#M1579504</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-02-08T14:30:33Z</dc:date>
    </item>
  </channel>
</rss>

