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: 

Dump with OPEN Cursor logic- in Ranges condition.

Former Member
0 Kudos

Hi Gurus,

Following is my code snippet.

      
OPEN CURSOR WITH HOLD l_v_c1 FOR
      SELECT matnr
             werks
             lgort
             charg
             lvorm
             clabs
             cumlm
             cinsm
             ceinm
             cspem
             cretm
             FROM mchb
             FOR ALL ENTRIES IN l_i_fltrd_data
             WHERE matnr = l_i_fltrd_data-matnr
             AND   werks = l_i_fltrd_data-werks
             AND   lgort IN l_r_lgort
             AND   charg IN fp_s_charg
             AND   lvorm = space
             AND   (l_v_where).
*Fetch next cursor
      DO.
        FETCH NEXT CURSOR l_v_c1 INTO TABLE l_i_mchb_mch1_temp PACKAGE SIZE c_package_size.
        IF sy-subrc NE 0.
          CLOSE CURSOR l_v_c1.
          EXIT.
        ELSE.
          APPEND LINES OF l_i_mchb_mch1_temp[] TO fp_i_mchb_mch1[].
        ENDIF.
      ENDDO.

In the Above code, the Ranges Table which iam using for LGORT(l_r_lgort), iam populating it with data. The entries in to this table are based on the server. In the development server, iam using some 50-60 entries, so the logic is working fine..

But in the Prod server, i shud give some 300-400 entries in to the ranges table. But while using this code with so many entries, iam getting DUMP.

Error in the module RSQL accessing the database interface. Error analysis An exception occurred. This exception is dealt with in more detail below . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was neither caught nor passed along using a RAISING clause, in the procedure "RETRIEVE_MCHB_MCH1" "(FORM)" . Since the caller of the procedure could not have expected this exception to occur, the running program was terminated. The reason for the exception is: The SQL statement generated from the SAP Open SQL Statement violates a restriction imposed by the database system used in R/3. Possible errors: o The maximum size of an SQL statement has been exceeded. o The statement contains too many input variables. o The space needed for the input data exceeds the available memory. o ... You can usually find details in the system log (SM21) and in the developer trace of the work process (ST11). If an error occurs the developer trace often informs you about the.

So can u please suggest me what is that which is causing the Dump, and is there any limit for Ranges data to be entered.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

There is a limit on the size of the native SQL statement that is generated from the open SQL. It sounds as if you have exceeded this limit, you have to keep the where condition smaller to avoid this.

Darren

6 REPLIES 6

Former Member
0 Kudos

Hi,

There is a limit on the size of the native SQL statement that is generated from the open SQL. It sounds as if you have exceeded this limit, you have to keep the where condition smaller to avoid this.

Darren

0 Kudos

Hi, can u suggest me any other alternative of splitting the logic, if entries are more.

Also some thing abt the Limits(documentation) of SQl in the same logic

0 Kudos

How about using SAp Open SQL instead of native SQL

0 Kudos

From the above code, i suppose , i have used SAP open SQl only..

OPEN CURSOR belongs to the Open SQL command set.

Can any one suggest me how to go abt frm the Above DUMP..

Edited by: chaitanya on Oct 20, 2008 6:14 PM

0 Kudos

You'll need to reduce the number of entries in your RANGES table. To do this, call your SELECT from within a loop and on each loop pass add the next 100 or so records to your RANGES table. Repeat until you've run out of records.

I don't know what the limit for the number of entries in a RANGES table is. I suspect that it will vary depending on the size of the rest of the SQL statement.

Former Member
0 Kudos

Limit for Open SQL commands