<?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: What is wrong with this SQL statement? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024440#M414739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, i suspect that too... something to do with the SQL length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wonder if there is any way to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm doing performance tuning for a report which does a inner join for &lt;/P&gt;&lt;P&gt;kna1, kpb1, bkpf and bsid...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the report later does another inner join for&lt;/P&gt;&lt;P&gt;kna1, kpb1, bkpf and bsad...with the same criteria and combines both itab into a big itab..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these 2 inner joins can take up for several hours for huge data... (selection for 13months)&lt;/P&gt;&lt;P&gt;so, i'm trying to break this up into more efficient statements...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2007 14:50:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-16T14:50:13Z</dc:date>
    <item>
      <title>What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024430#M414729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is wrong with this SQL statement? abap dump generated&lt;/P&gt;&lt;P&gt;checking through ST11...found this..&lt;/P&gt;&lt;P&gt;ERROR =&amp;gt; max. statement length (65536) exceeded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are &lt;/P&gt;&lt;P&gt;114 records in r_blart&lt;/P&gt;&lt;P&gt;44 records in itab&lt;/P&gt;&lt;P&gt;in this selection statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    SELECT
      bukrs
      belnr
      gjahr
      kunnr
      blart
      buzei
      budat
      bldat
      mansp
      shkzg
      xblnr
      bschl
      dmbtr
      zuonr
      INTO TABLE i_bsid
      FROM bsid
      FOR ALL ENTRIES IN itab
      WHERE bukrs = itab-bukrs
        AND kunnr = itab-kunnr
        AND budat BETWEEN backdate_13 AND p_r_date
        AND blart IN r_blart
        AND zuonr IN szuonr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:01:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024430#M414729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024431#M414730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Put a bracket in the line:&lt;/P&gt;&lt;P&gt;AND budat ( BETWEEN backdate_13 AND p_r_date )&lt;/P&gt;&lt;P&gt;and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024431#M414730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024432#M414731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try including all the key fileds in where condition of your select statement  ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dump could be here&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
BETWEEN  ( backdate_13 AND p_r_date )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Santosh Kumar Patha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:04:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024432#M414731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024433#M414732</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;Please add all keys IN WHERE CLAUSE which is defines in BSID table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;      bukrs&lt;/P&gt;&lt;P&gt;      belnr&lt;/P&gt;&lt;P&gt;      gjahr&lt;/P&gt;&lt;P&gt;      kunnr&lt;/P&gt;&lt;P&gt;      blart&lt;/P&gt;&lt;P&gt;      buzei&lt;/P&gt;&lt;P&gt;      budat&lt;/P&gt;&lt;P&gt;      bldat&lt;/P&gt;&lt;P&gt;      mansp&lt;/P&gt;&lt;P&gt;      shkzg&lt;/P&gt;&lt;P&gt;      xblnr&lt;/P&gt;&lt;P&gt;      bschl&lt;/P&gt;&lt;P&gt;      dmbtr&lt;/P&gt;&lt;P&gt;      zuonr&lt;/P&gt;&lt;P&gt;      INTO TABLE i_bsid&lt;/P&gt;&lt;P&gt;      FROM bsid&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN itab&lt;/P&gt;&lt;P&gt;      WHERE bukrs = itab-bukrs&lt;/P&gt;&lt;P&gt;        AND kunnr = itab-kunnr&lt;/P&gt;&lt;P&gt;        AND budat BETWEEN backdate_13 AND p_r_date&lt;/P&gt;&lt;P&gt;        AND blart IN r_blart&lt;/P&gt;&lt;P&gt;        AND zuonr IN szuonr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;KEYS:BUKRS,KUNNR,UMSKS,UMSKZ,AUGDT,AUGBL,ZUONR,GJAHR,BELNR,BUZEI&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;Please reward suitable points&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;With Regards&lt;/P&gt;&lt;P&gt;Navin Khedikar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024433#M414732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024434#M414733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;  Wrong in the Between statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it out once and correct that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:08:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024434#M414733</guid>
      <dc:creator>sreeramkumar_madisetty</dc:creator>
      <dc:date>2007-03-16T11:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024435#M414734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but how come if there are&lt;/P&gt;&lt;P&gt;43 records in itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..there will be no dump?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dump is something to do with the length of the SQL statement?&lt;/P&gt;&lt;P&gt;as mentioned in ST11?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:10:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024435#M414734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024436#M414735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm not able to add in key fields... in my case&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024436#M414735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024437#M414736</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;this is wrt the buffer size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_SNDBUF ( &amp;lt;b&amp;gt;65536&amp;lt;/b&amp;gt;)&lt;/P&gt;&lt;P&gt; Sets the send buffer size for this socket. This option is used by the platform's networking code as a hint for the size to set the underlying network I/O buffers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Increasing the buffer size can increase the performance of network I/O for high-volume connection, while decreasing it can help reduce the backlog of incoming data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:14:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024437#M414736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024438#M414737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select the data with all the key fields,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUKRS&lt;/P&gt;&lt;P&gt;KUNNR&lt;/P&gt;&lt;P&gt;UMSKS&lt;/P&gt;&lt;P&gt;UMSKZ&lt;/P&gt;&lt;P&gt;AUGDT&lt;/P&gt;&lt;P&gt;AUGBL&lt;/P&gt;&lt;P&gt;ZUONR&lt;/P&gt;&lt;P&gt;GJAHR&lt;/P&gt;&lt;P&gt;BELNR&lt;/P&gt;&lt;P&gt;BUZEI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Sujatha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:35:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024438#M414737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T11:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024439#M414738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried this select with fewer values in &amp;lt;b&amp;gt;R_BLART&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;ITAB&amp;lt;/b&amp;gt;? As I understand it (and I could be completely wrong), this problem can occur when the SAP compiler translates the ABAP SELECT statement to native SQL. It creates the SQL select statement in one big, long string, which is then passed to the database. The problem can happen when you use a FOR ALL ENTRIES IN statement or ranges, because these are basically converted into one big WHERE clause. In your case:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE ( bukrs = itab-bukrs[1] AND
        kunnr = itab-kunnr[1] )
   OR ( bukrs = itab-bukrs[2] AND
        kunnr = itab-kunnr[2] )
   OR ...
   OR ( bukrs = itab-bukrs[44] AND
        kunnr = itab-kunnr[44] )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, the range is also expanded: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   AND blart = r_blart[1]
    OR blart = r_blart[2]
    OR ...
    OR blart = r_blart[114]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, while the ABAP SELECT statement might be fine, it could cause the SQL string to overflow and give these wonderfully cryptic short-dumps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I say, I could be entirely wrong about this, and if my wrongness offends any true techies out there, then I only hope they can forgive me. Or point out the error of my ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lyal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 12:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024439#M414738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T12:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024440#M414739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, i suspect that too... something to do with the SQL length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wonder if there is any way to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm doing performance tuning for a report which does a inner join for &lt;/P&gt;&lt;P&gt;kna1, kpb1, bkpf and bsid...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the report later does another inner join for&lt;/P&gt;&lt;P&gt;kna1, kpb1, bkpf and bsad...with the same criteria and combines both itab into a big itab..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these 2 inner joins can take up for several hours for huge data... (selection for 13months)&lt;/P&gt;&lt;P&gt;so, i'm trying to break this up into more efficient statements...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 14:50:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024440#M414739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T14:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024441#M414740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;   There is a limitation for number of entries in the ranges when used in a select statement ( without for all entries addition). I think it accepts only up to 1000 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are using ranges along with the for all entries, it may mean the same.&lt;/P&gt;&lt;P&gt;Is there any possibility to have the r_blart and szuonr values also in the ITAB ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT
      bukrs
      belnr
      gjahr
      kunnr
      blart
      buzei
      budat
      bldat
      mansp
      shkzg
      xblnr
      bschl
      dmbtr
      zuonr
      INTO TABLE i_bsid
      FROM bsid
      FOR ALL ENTRIES IN itab
      WHERE bukrs = itab-bukrs
        AND kunnr = itab-kunnr
        AND budat BETWEEN backdate_13 AND p_r_date
        AND blart = itab-blart
        AND zuonr = itab-szuonr.

&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024441#M414740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024442#M414741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi's answer is largely correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each SAP system has a DB parameter set by the DBAs that determines how large an SQL statement can be... to explain further...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP uses Open SQL (proprietary language)... this is not an SQL language directly supported/used by DB companies like Oracle, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And so... the SAP system must convert your Open SQL to the SQL that is "native" to your underlying DB system.  During this process, it literally re-writes your Open SQL in Oracle SQL (let's say).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: Open SQL with ranges involved actual generates numerous conditions in the WHERE clause that the passed onto the DB system...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES: S_OTHER_FIELD TYPE Zxxxx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assume that S_OTHER_FIELDS has 4 EQ values in it.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Open SQL looks like this.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;SELECT * FROM SOME_TABLE WHERE FIELD1   IN S_OTHER_FIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;The generated Oracle SQL looks like this.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;SELECT * FROM SOME_TABLE &lt;/P&gt;&lt;P&gt;WHERE FIELD1 = '0001'&lt;/P&gt;&lt;P&gt;OR        FIELD1 = '0002'&lt;/P&gt;&lt;P&gt;OR        FIELD1 = '0003'&lt;/P&gt;&lt;P&gt;OR        FIELD1 = '0004'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the outputted SQL text is much larger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This re-written SQL has a textual limit.  In the case cited here, the DBAs have set the limit at 64 KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have two choices: &lt;/P&gt;&lt;P&gt;1) convince your DBAs to increase this limit (and good luck with that)&lt;/P&gt;&lt;P&gt;2) Or alter your business logic to gather the results in chunks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pretty amazing stuff... huh?!?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:19:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024442#M414741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024443#M414742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dump:&lt;/P&gt;&lt;P&gt;The reason for the exception is:                                      &lt;/P&gt;&lt;P&gt;The SQL statement generated from the SAP Open SQL Statement violates a&lt;/P&gt;&lt;P&gt;restriction imposed by the database system used in R/3.                                                                                &lt;/P&gt;&lt;P&gt;Possible errors:                                                      &lt;/P&gt;&lt;P&gt;-The maximum size of an SQL statement has been exceeded.            &lt;/P&gt;&lt;P&gt;-The statement contains too many input variables.                   &lt;/P&gt;&lt;P&gt;-The space needed for the input data exceeds the available memory.  &lt;/P&gt;&lt;P&gt;-...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024443#M414742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024444#M414743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, sounds to me like we were all correct, but that there is no instant, elegant solution to the  problem, other than limiting the data to be selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But enough of that! It's Friday afternoon - anyone for a beer? &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:29:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024444#M414743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024445#M414744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well well....&lt;/P&gt;&lt;P&gt;hahahha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024445#M414744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024446#M414745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct.  You will need to pursue one of my options above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points accordingly and close the thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 15:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024446#M414745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T15:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with this SQL statement?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024447#M414746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do u mean to include blart and zuonr into selection...&lt;/P&gt;&lt;P&gt;then filter them out manually in a loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hmm... well.. there could be a way... but may affect performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but again... its funny... how come when i test in test environment..&lt;/P&gt;&lt;P&gt;the for all entries table has more than 6000 records and s_blart has 126 records..&lt;/P&gt;&lt;P&gt;there's no problem with this...&lt;/P&gt;&lt;P&gt;so meaning DBA didnt set that in test environment? or its just SAP "bug"...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2007 16:45:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-this-sql-statement/m-p/2024447#M414746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-16T16:45:06Z</dc:date>
    </item>
  </channel>
</rss>

