Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime error: DBIF_RSQL_INVALID_RSQL Exception: CX_SY_OPEN_SQL_DB

david_reza
Employee
Employee
0 Kudos

Hi everyone,

I got the exception because of this statement:

-->SELECT gjahr

            belnr

            buzei

            ebeln

            ebelp

            vgabe

            dmbtr  " E0JSPINA 46549.

            wrbtr   " E0JSPINA 46549.

            waers

            hswae

            shkzg

            INTO TABLE p_i_ekbe

            FROM ekbe

            WHERE ebeln IN ra_ebeln

            AND   ebelp IN ra_ebelp

            AND   zekkn IN ra_zekkn

            AND   vgabe EQ '1'

            AND   gjahr IN ra_gjahr

            AND   belnr IN ra_belnr

            AND   buzei IN ra_buzei.


Inside the dump, in the Database Information section appears the following:


     Database Interface Information

     B      E      dbtran ERROR (set_input_da_spec): statement too big [dbtran.c#4854]

     B      E       marker count = 21590 > max. marker count = 10000 [dbtran.c#4854]

Related to the Select statement, I have the following:

-------------------------------------------------------------------------

FORM f_get_ekbe  USING    p_i_mkpf TYPE tt_mkpf

                  CHANGING p_i_ekbe TYPE tt_ekbe

> Here comes the Select >

-------------------------------------------------------------------------

DATA  tt_ekbe  TYPE STANDARD TABLE OF ty_ekbe,

-------------------------------------------------------------------------

BEGIN OF ty_ekbe,

     gjahr TYPE ekbe-gjahr,

     belnr TYPE ekbe-belnr,

     buzei TYPE ekbe-buzei,

     ebeln TYPE ekbe-ebeln,

     ebelp TYPE ekbe-ebelp,

     vgabe TYPE ekbe-vgabe,

     wrbtr TYPE ekbe-wrbtr,

     dmbtr TYPE ekbe-dmbtr,

     waers TYPE ekbe-waers,

     hswae TYPE ekbe-hswae,

     shkzg TYPE ekbe-shkzg,

END OF ty_ekbe.

--------------------------------------------------------------------------

Any thoughts?

Regards,

David Reza

1 ACCEPTED SOLUTION

DavidLY
Advisor
Advisor
0 Kudos

Hello,

The dump occurs due to the size of SQL statement. Unfortunately there is
a database limit as explained by SAP note 13607. According to this note, you
have exceeded the maximum number of host-variables allowed in an SQL
statement. With this type of entry, you should reduce the number of bind
variables used to a value less than or equal to 10000.

The issue is not with the number of records which will be returned by
the database, but with the size of the SELECT statement. Note that this
is not a restriction of the SAP system, but of the database. So we can
not influence this restrictions.

What you have to do is to replace individual values for interval ranges.
The SELECT statement generated by the system for such a query is much
larger than the statement which would be executed for an interval
selection (this will contain only two values: interval begin and
interval end).

More information can be found in the following SAP notes:
13607  Termination of an ABAP with DBIF_RSQL_INVALID_RSQL
635318 Open SQL: Size restrictions for commands

Regards,

David

3 REPLIES 3

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hello David,

The dump says the selection criteria given while execution is more than 10000 records.

The basis team has restricted selection of more than 10000 records i,e max. marker count = 10000.

Therefore change your selection criteria to < 10000 and execute to avoid dumps.

Thanks

DavidLY
Advisor
Advisor
0 Kudos

Hello,

The dump occurs due to the size of SQL statement. Unfortunately there is
a database limit as explained by SAP note 13607. According to this note, you
have exceeded the maximum number of host-variables allowed in an SQL
statement. With this type of entry, you should reduce the number of bind
variables used to a value less than or equal to 10000.

The issue is not with the number of records which will be returned by
the database, but with the size of the SELECT statement. Note that this
is not a restriction of the SAP system, but of the database. So we can
not influence this restrictions.

What you have to do is to replace individual values for interval ranges.
The SELECT statement generated by the system for such a query is much
larger than the statement which would be executed for an interval
selection (this will contain only two values: interval begin and
interval end).

More information can be found in the following SAP notes:
13607  Termination of an ABAP with DBIF_RSQL_INVALID_RSQL
635318 Open SQL: Size restrictions for commands

Regards,

David

0 Kudos

Thanks a lot for the explanation!