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: 

Error in module RSQL of the database interface.

Former Member
0 Kudos

Hi Expert,

I get this error "Error in module RSQL of the database interface." when the below ABAP statement executed, do you know the root cuase? Thanks.

ABAP Code:

data lt_fact type TABLE OF /BIC/FZRT_C002.

data ls_Fact type /BIC/FZRT_C002.

*SELECT * INTO table lt_fact FROM /BIC/FZRT_C002 WHERE KEY_ZRT_C0021 in lt_RSDIMID and KEY_ZRT_C0022 in lt_caRSDIMID*.

Information in ST22.

What happened?

Error in the ABAP Application Program

The current ABAP program "SAPLZZ_FG" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in

procedure "ZCA_GET_CUBE_STOCK" "(FUNCTION)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The SQL statement generated from the SAP Open SQL statement violates a

restriction imposed by the underlying database system of the ABAP

system.

Possible error causes:

o The maximum size of an SQL statement was exceeded.

o The statement contains too many input variables.

o The input data requires more space than is available.

o ...

You can generally find details in the system log (SM21) and in the

developer trace of the relevant work process (ST11).

In the case of an error, current restrictions are frequently displayed

in the developer trace.

Best Regards,

Andrew

1 ACCEPTED SOLUTION

former_member194613
Active Contributor

the IN for RANGES is designed for manual input, i.e. it should not become too large.

Usually it will dump, if the number of records is in the range of 1.000, because the resulting statement is too large.

Use FOR ALL ENTRIES instead.

8 REPLIES 8

former_member182566
Active Contributor
0 Kudos

Hi.

Probably the internal tables are too long to be used with IN.

This will result in a select that is too long for the database, and hence the dump.

How many entries do you have in lt_RSDIMID and in lt_caRSDIMID?

0 Kudos

Hi,

the entries number is 2143x4(16).

Best Regards,

Andrew

0 Kudos

>

> the entries number is 2143x4(16).

> Best Regards,

> Andrew

2143 records? on which table? you have two different internal tables, right?

anyway, you can solve the problem if you can change the logic to FOR ALL ENTRIES.

another option, and if you are filling these 2 internal tables from database tables, is to use JOINs instead.

former_member194613
Active Contributor

the IN for RANGES is designed for manual input, i.e. it should not become too large.

Usually it will dump, if the number of records is in the range of 1.000, because the resulting statement is too large.

Use FOR ALL ENTRIES instead.

Former Member
0 Kudos

Hii

Lets check with select query with addition corresponding fields of itab...........

Former Member
0 Kudos

i have the same error but my first select is
SELECT QMNUM QMTXT QMDAT AUFNR OBJNR QMNAM QMART BTPLN IWERK BEBER INGRP  EQUNR SERIALNR MATNR
        INTO TABLE GT_VIQMEL
        FROM VIQMEL
        WHERE QMNUM IN S_QMNUM .

please tell me how to solve this error when i run 24000 raw this select dump.


ASAP

thanks

Eman elgammal.

Former Member
0 Kudos

Even I  also Faced same kind of Error..

data var_sum type n LENGTH 3.

select sum( col ) from ztable INTO  var_sum

  where (filter condition).

Here in above query i try to store the sum of col into a variable of type numc.due to this i got the error.

Solution in my case :

data var_sum type i.


It may help to someone.

victor_chew
Explorer
0 Kudos

The table structure sequence might causing issue as well. best practice is to retrieve column follows the internal table column definition.