<?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: problem with select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998245#M1343792</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;How u declaring the internal table gt_bk????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be data : gt_bk type standard table of bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2009 12:12:51 GMT</pubDate>
    <dc:creator>former_member386202</dc:creator>
    <dc:date>2009-08-12T12:12:51Z</dc:date>
    <item>
      <title>problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998241#M1343788</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 select-statment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from bkpf  INTO TABLE gt_bk
                     where bukrs eq pa_bukrs
                      AND belnr IN so_belnr                       
                       and gjahr in so_gjahr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;                      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the select-option has about 3600 entries (single bel-numbers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i got an DBIF_RSQL_INVALID_RSQL error and an dump saying that sql-statment is too long !!! i think 3500 select-option-lines are too much. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to avoid this ? i MUST select only the 3500 belnr's with a good performance ! BKPF-table has over 8 million records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg, Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 11:57:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998241#M1343788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998242#M1343789</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;You are getting the dump because you must have defined few fields in the internal table declarartion of gt_bk. So use INTO CORRESPONDING FIELDS OF TABLE when using select * and check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from bkpf  INTO CORRESPONDING FIELDS OF TABLE gt_bk
                     where bukrs eq pa_bukrs
                      AND belnr IN so_belnr                       
                       and gjahr in so_gjahr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else see to it that you declare gt_bk as an internal table with the same structure as BKPF since you are using select *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:10:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998242#M1343789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998243#M1343790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check OSS notes&lt;/P&gt;&lt;P&gt;374079 and 358282&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:11:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998243#M1343790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998244#M1343791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this error wil caused when more no of items is given to the select option .&lt;/P&gt;&lt;P&gt;please  donot give the same account no 3500 times .&lt;/P&gt;&lt;P&gt;but do one thing don't give repeating nos &lt;/P&gt;&lt;P&gt;or search for the SAP notes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:11:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998244#M1343791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998245#M1343792</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;How u declaring the internal table gt_bk????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be data : gt_bk type standard table of bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998245#M1343792</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2009-08-12T12:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998246#M1343793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Break the SQL Statement into 2 or 3 part by using FOR ALL ENTRIES clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarbajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998246#M1343793</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-08-12T12:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998247#M1343794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oss notes 374079 and 358282 have NOTHING to do with my problem !!! ?????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is the 3500 numbers ! there are NO duplicate numbers in there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_bk is defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gt_bk        type table of bkpf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:16:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998247#M1343794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998248#M1343795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="7564304"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998248#M1343795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998249#M1343796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Open Cursor in the select statement .&lt;/P&gt;&lt;P&gt;for example refer the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Maximum number of lines for DB table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  STATICS: s_s_if TYPE srsc_s_if_simple,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;counter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          s_counter_datapakid LIKE sy-tabix,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;cursor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          s_cursor TYPE cursor.&lt;/P&gt;&lt;P&gt;OPEN CURSOR WITH HOLD s_cursor FOR&lt;/P&gt;&lt;P&gt;  SELECT banfn&lt;/P&gt;&lt;P&gt;         bnfpo&lt;/P&gt;&lt;P&gt;         bsart&lt;/P&gt;&lt;P&gt;         erdat&lt;/P&gt;&lt;P&gt;         menge&lt;/P&gt;&lt;P&gt;         matnr&lt;/P&gt;&lt;P&gt;         matkl&lt;/P&gt;&lt;P&gt;         afnam&lt;/P&gt;&lt;P&gt;         werks&lt;/P&gt;&lt;P&gt;         ebeln&lt;/P&gt;&lt;P&gt;         pstyp&lt;/P&gt;&lt;P&gt;         ebakz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   INTO TABLE it_eban&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    FROM eban WHERE loekz = ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         AND banfn = i_banfn.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;               APPENDING CORRESPONDING FIELDS&lt;/P&gt;&lt;P&gt;               OF TABLE it_eban&lt;/P&gt;&lt;P&gt;               PACKAGE SIZE s_s_if-maxsize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      CLOSE CURSOR s_cursor.&lt;/P&gt;&lt;P&gt;      RAISE no_more_data.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:16:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998249#M1343796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998250#M1343797</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;Your problem is described in SAP note 13607. The range (SELECT-OPTIONS) table SO_BELNR contains according to your problem description 3500 entries. The ABAP DB interface will try and construct a single SQL statement out of this (unlike with FOR ALL ENTRIES where the ABAP select will be cut into pieces automatically). The only solution that I see is that you divide the SELECT itself into manageable pieces, e.g. of 100 entries at the time and then append the results of the successive queries into the internal table GT_BK. Performance-wise I don't think this will make any difference because the access path is the same (IN condition matched via primary index).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998250#M1343797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T12:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998251#M1343798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at (old) OSS [Note 13607 - Termination of an ABAP with DBIF_RSQL_INVALID_RSQL|https://service.sap.com/sap/support/notes/13607]&lt;/P&gt;&lt;P&gt;- break the select-options in slice and SELECT APPENDING&lt;/P&gt;&lt;P&gt;- convert the select-options in a FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insure it will be possible to use one of those solution, use the FM [SELECT_OPTIONS_RESTRICT|https://forums.sdn.sap.com/search.jspa?objID=c42&amp;amp;q=SELECT_OPTIONS_RESTRICT] to restrict options available on the select-options - for first solution, only allow "I" include check, for the second only allow "I/EQ" single values entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 12:18:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/5998251#M1343798</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-08-12T12:18:09Z</dc:date>
    </item>
  </channel>
</rss>

