<?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: Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098303#M1616096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the hint. This was exactly my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2011 08:15:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-08-05T08:15:13Z</dc:date>
    <item>
      <title>Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098300#M1616093</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;I have a problem with a select statement. The exception CX_SY_OPEN_SQL_DB" is raised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below you can see my coding. Within the range for the AWKEY I have only one single entry. Therefore there should not be too many values within the where condition. What else can be wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF mm_fi_inv_join,
    bukrs TYPE bukrs,
    belnr TYPE belnr,
    gjahr TYPE gjahr,
    koart TYPE koart,
    augdt TYPE augdt,
    augbl TYPE augbl,
    END OF mm_fi_inv_join.

 

 

  FIELD-SYMBOLS: &amp;lt;lt_mm_fi_inv&amp;gt;     TYPE ANY TABLE.

 

  DATA: lt_mm_fi_inv            TYPE REF TO data.


CREATE DATA lt_mm_fi_inv TYPE TABLE OF mm_fi_inv_join.
  ASSIGN lt_mm_fi_inv-&amp;gt;* TO &amp;lt;lt_mm_fi_inv&amp;gt;.

  SELECT bkpf~bukrs bkpf~belnr bkpf~gjahr bsak~augdt bsak~augbl
    FROM bkpf
      INNER JOIN bsak
    ON bkpf~bukrs = bsak~bukrs
    AND bkpf~belnr = bsak~belnr
    AND bkpf~gjahr = bsak~gjahr
    INTO CORRESPONDING FIELDS OF TABLE &amp;lt;lt_mm_fi_inv&amp;gt;
    WHERE bkpf~awkey IN lr_awkey.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 16:57:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098300#M1616093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-03T16:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098301#M1616094</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;The error is in the definition of your type  MM_FI_INV_JOIN: the type BELNR is a structure, the data element of field BKPF-BELNR is BELNR_D&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF MM_FI_INV_JOIN,
    BUKRS TYPE BUKRS,
*    BELNR TYPE BELNR,
    BELNR TYPE BELNR_D,  "&amp;lt;------Right Definition
    GJAHR TYPE GJAHR,
    KOART TYPE KOART,
    AUGDT TYPE AUGDT,
    AUGBL TYPE AUGBL,
    END OF MM_FI_INV_JOIN..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 17:17:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098301#M1616094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-03T17:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098302#M1616095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, as max said. Just one small hint that never hurts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are always better of  to use the table field reference when typing fields, i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: 
    BEGIN OF MM_FI_INV_JOIN,
    BUKRS TYPE BKPF-BUKRS,
    BELNR TYPE BKPF-BELNR,
    GJAHR TYPE BKPF-GJAHR,
    KOART TYPE BSEG-KOART,
    AUGDT TYPE BSAK-AUGDT,
    AUGBL TYPE BSAK-AUGBL,
    END OF MM_FI_INV_JOIN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do it this way, there is no danger at all and you gain some transparency.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 18:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098302#M1616095</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-08-03T18:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098303#M1616096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the hint. This was exactly my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 08:15:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098303#M1616096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-05T08:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exception CX_SY_OPEN_SQL_DB within Select statement with JOIN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098304#M1616097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So close the post&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 08:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-cx-sy-open-sql-db-within-select-statement-with-join/m-p/8098304#M1616097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-05T08:53:21Z</dc:date>
    </item>
  </channel>
</rss>

