Skip to Content
author's profile photo Former Member
Former Member

DBIF_RSQL_INVALID_RSQL

Hello All,

I have a dynamic where_clause in a select query. ie its created at runtime. I get a short dump 'DBIF_RSQL_INVALID_RSQL' at the select statement. The reason shown in ST22 is:

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 ...

Could you please suggest a solution to the problem, since the data to be fetched is large I would not want to use select-endselect loop as that would make it slower.

Thanks in advance,

Anju

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 12:06 PM

    Anju, I got a same problem like this.

    Issue in my case is:

    Some versions of system will allow a certain length of condition to hit database.

    In my case lets say my DB statement is

    select * from KONH into TABLE lt_konh[]

    WHERE knumh IN lt_knumh[].

    If my lt_knumh[] has 3000 (more than 1999) it is giving DUMP else if is working fine. So to solve this case I gave limited my table to 1999 entries.

    Now I have to hit my DB two times once with 1999 entries and again with remaining entries.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2008 at 11:14 AM

    Show your Dynamic select logic. That might be the cause of the error. DBIF_RSQL_INVALID_RSQL this means it is some thing with the select statement.

    Add a comment
    10|10000 characters needed characters exceeded

    • I implemented one simple example. Can you check with your code where the mistake is...

      Input Table as SFLIGHT, and Fieldname as CARRID

      REPORT  ZTEST_SIMPLE.
      
      data: it_fcat type lvc_t_fcat.
      data: itable type ref to data.
      field-symbols: <fs> type standard table.
      parameters: p_table(30),
                  p_column(30).
      
      data: cond type string.
      
      cond = 'CARRID = ''AA'' and  connid = ''00017'''.
      
      
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
         I_STRUCTURE_NAME             =  p_table
        CHANGING
          ct_fieldcat                  = it_fcat
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_ERROR                = 2
         OTHERS                       = 3
                .
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      
      
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fcat
        IMPORTING
          EP_TABLE                  = itable
        EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          others                    = 2
              .
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      
      assign itable->* to <fs>.
      
      SELECT DISTINCT (p_column)
      INTO CORRESPONDING FIELDS OF TABLE <fs>
      FROM (p_table) WHERE (cond).
      
      break-point.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2008 at 11:36 AM

    put a debug point at the query.... try to see the dynamic portion... u can get the error...

    May be

     and 

    clause error.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 12:52 PM

    Since you know already that the data selected will be large try writing the problematic Select as a static statement (not dynamic) and see what happens then. It is not very easy to see what causes the problem with your code as it could depend on many circumstances (number of fields selected, size of work area, what the actual DB table is). You may have to execute several times with amendments to trouble-shoot which part is causing your error.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 12:56 PM

    Hi,

    The reason could be in your where clause you may have more number of entries. For example if you are retrieving the data from BSAS for BSIS for allentries. In BSIS table you may have 10,000 GLs . If you use 10000 GLs in BSAS select statement then you will get this dump. Better split the no. of Gls and use appending statement in your select statement.

    Thanks,

    Sriram POnna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.