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: 

DBIF_RSQL_INVALID_RSQL

vicky31
Explorer
0 Kudos

I get this runtime error "Error in module RSQL of the database interface." when this ABAP statement is executed. What is the main cause?

REPORT Z_ALV_V5.


TYPE-POOLS: SLIS. 

TABLES: EKPO. 

TYPES: BEGIN OF ty_ekpo,
         EBELN TYPE EKPO-EBELN, 
         EBELP TYPE EKPO-EBELP, 
         MATNR TYPE EKPO-MATNR, 
         TXZ01 TYPE EKPO-TXZ01, 
         MENGE TYPE EKPO-BSTMG, 
         NETPR TYPE EKPO-BPREI, 
   END OF ty_ekpo.

DATA: it_ekpo TYPE TABLE OF ty_ekpo,
      it_fldcat TYPE SLIS_T_FIELDCAT_ALV,
      it_events TYPE SLIS_T_EVENT,
      it_sort TYPE SLIS_T_SORTINFO_ALV,

      wa_ekpo TYPE ty_ekpo,
      wa_fldcat TYPE SLIS_FIELDCAT_ALV,
      wa_events TYPE SLIS_EVENT,
      wa_sort TYPE SLIS_SORTINFO_ALV.

SELECT-OPTIONS: S_ebeln FOR EKPO-EBELN.

START-OF-SELECTION.


PERFORM FETCH_DATA.
PERFORM PREPARE_FLDCAT.
PERFORM FILL_EVENTS.
PERFORM F_TOP_OF_PAGE.
PERFORM SHOW_DATA.


FORM FETCH_DATA.

  SELECT EBELN 
         EBELP
         MATNR
         TXZ01
         MENGE
         NETPR
    FROM EKPO
    WHERE EBELN IN S_ebeln. 

ENDFORM.


FORM PREPARE_FLDCAT.

  wa_fldcat-fieldname = ‘EBELN’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Purchase Order’.
  wa_fldcat-key = ‘X’.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_fldcat-fieldname = ‘EBELP’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Item’.
  wa_fldcat-key = ‘X’.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_fldcat-fieldname = ‘MATNR’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Material Number’.
  wa_fldcat-col_pos = 3.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_fldcat-fieldname = ‘TXZ01’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Short Text’.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_fldcat-fieldname = ‘MENGE’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Purchase Order Quality’.
  wa_fldcat-no_out = ‘X’.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_fldcat-fieldname = ‘NETPR’.
  wa_fldcat-tabname   = ‘IT_EKPO’.
  wa_fldcat-seltext_m = ‘Net Price’.
  wa_fldcat = ‘X’.
  APPEND wa_fldcat TO it_fldcat.
  CLEAR wa_fldcat.

  wa_sort-fieldname = 'EBELN'.
  wa_sort-up        = 'X'.
  wa_sort-subtot    = 'X'.
  APPEND wa_sort TO it_sort.

ENDFORM.


FORM FILL_EVENTS.

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    IMPORTING
      ET_EVENTS = it_events.
   IF SY-SUBRC = 0.
     READ TABLE it_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.
      IF SY-SUBRC = 0.
        wa_events-form = 'F_TOP_OF_PAGE'.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
   ENDIF.

ENDFORM.


FORM F_TOP_OF_PAGE.

  DATA : it_lheader TYPE slis_t_listheader,
         wa_lheader TYPE slis_listheader.

  wa_lheader-typ  = 'H'.    "HEADER
  wa_lheader-info = 'Purchase order items'.
  APPEND wa_lheader TO it_lheader.

  wa_lheader-typ  = 'S'.    "SECTION
  wa_lheader-info = sy-uname.
  APPEND wa_lheader TO it_lheader.

  wa_lheader-typ  = 'A'.    "ACTION
  wa_lheader-info = sy-datum.
  APPEND wa_lheader TO it_lheader.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = it_lheader
      I_LOGO             = 'AALOGO'

ENDFORM.


FORM SHOW_DATA.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = sy-repid
      IT_FIELDCAT        = it_fldcat      
      IT_SORT            = it_sort
      IT_EVENTS          = it_events
    TABLES
      T_OUTTAB           = it_ekpo.

ENDFORM.

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos

It's explained in the short dump. Unfortunately you didn't paste it. Did you look at it ?

What is the detailed analysis text? What ABAP line is it?

vicky31
Explorer
0 Kudos

@sandra.rossi

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 "FETCH_DATA" "(FORM)", 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: In a SELECT access, the read file could not be placed in the target field provided. Either the conversion is not supported for the type of the target field, the target field is too small to include the value, or the data does not have the format required for the target field.

vicky31
Explorer
0 Kudos

I did not get this error analysis.

And I want to know how to solve this error.

vinita_kasliwal
Active Contributor
0 Kudos

Hi Debabrata

It is difficult for someone to read the entire code, copy paste and replicate the errror you are getting to provide you some inputs

Please try to debug and see where is it coming from is it for all data or specific data and verify the cause in debug

Also, Refer this note and see if it helps

2076669 - ABAP Dump DBIF_RSQL_INVALID_RSQL - Error in module RSQL of the database interface

Regards

Vinita

Sandra_Rossi
Active Contributor

You, as a developer, cannot work if you don't have access to the whole short dump. Like you cannot work if you don't have the debugger.

Why don't you have access to the whole short dump? Mystery...

After checking thoroughly, you did a mistake in declarations:

         MENGE TYPE EKPO-BSTMG, 
         NETPR TYPE EKPO-BPREI, 

It should be:

         MENGE TYPE EKPO-MENGE,
         NETPR TYPE EKPO-NETPR, 

Something else: INTO TABLE IT_EKPO is missing in your SELECT.

matt
Active Contributor
0 Kudos

He's using the obsolete TABLES statement, which looks like it enables him to use the obsolete SELECT syntax, which is equivalent to

  SELECT EBELN 
         EBELP
         MATNR
         TXZ01
         MENGE
         NETPR
    FROM EKPO
    INTO EKPO "<--- the work area defined by TABLES
    WHERE EBELN IN S_ebeln. 

But this should be select single, or select endselect... Anyway, my guess is that the first six fields of ekpo aren't ebeln, ebelp, matnr, txz01, menge and netpr, hence the dump.

This is why using obsolete ABAP syntax is a bad idea. It's why using classes and methods is a goodidea, since you can't then use misleading obsolete forms.

Sandra_Rossi
Active Contributor
0 Kudos

The reason for the exception is: In a SELECT access, the read file could not be placed in the target field provided. Either the conversion is not supported for the type of the target field, the target field is too small to include the value, or the data does not have the format required for the target field.

You said: "I did not get this error analysis. And I want to know how to solve this error." The reason is explained in the short dump, read it thoroughly. If you don't know what failed, then tell me how is it possible to work as a developer?

Sandra_Rossi
Active Contributor
0 Kudos

Note that it's very old school ABAP.

Subroutines are obsolete -> ABAP Objects (methods)

REUSE_ALV_GRID_DISPLAY is obsolete -> CL_SALV_TABLE

Global variables are to avoid -> local variables or attributes or inline declarations

Use the inline declaration (that avoids the error you experienced):

SELECT EBELN 
         EBELP
         MATNR
         TXZ01
         MENGE
         NETPR
    FROM EKPO
    WHERE EBELN IN S_ebeln
    INTO @DATA(it_ekpo). " <===== INLINE DECLARATION

With ABAP Development Tools, you may convert an inline declaration into TYPES and DATA to turn it into an attribute.