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: 

Fetch Cursor giving dump

former_member215563
Active Participant
0 Kudos


Hi All,,


My fetch Cursor statement in the below code gives dump  DBIF_RSQL_INVALID_RSQL for unknown reason.

Please help me rectify it.

The structure of my internal table is

TYPES:BEGIN OF gty_ekpo,

        ebeln TYPE ekpo-ebeln,

        ebelp TYPE ekpo-ebelp,

        txz01 TYPE ekpo-txz01,

        afnam TYPE ekpo-afnam,

        netpr TYPE ekpo-netpr,

        menge TYPE ekpo-menge,

        netwr TYPE ekpo-netwr,

        loekz TYPE ekpo-loekz,

        erekz TYPE ekpo-erekz,

        END OF gty_ekpo.

So there is not data type mismatch as well



OPEN CURSOR gv_cursor FOR

       SELECT ebeln

              ebelp

              txz01

              afnam

              netpr

              menge

              netwr

              loekz

              erekz

       FROM   EKPO

       FOR ALL ENTRIES IN lt_ekko

       WHERE ebeln = lt_ekko-ebeln

       AND loekz eq space

       AND erekz eq gc_blank.

       IF sy-subrc = 0.

        lv_return = abap_true.

      ENDIF.

       WHILE lv_return = abap_true.

        FETCH NEXT CURSOR gv_cursor

        APPENDING TABLE lt_ekpo

        PACKAGE SIZE 10001.

3 REPLIES 3

former_member184657
Active Contributor
0 Kudos

Package Size 10001 is not a variable, so shouldn't it be in single quotes?

pk

EDIT: Looks like you can indeed define package size without the single quotes(tried in my system). So whats the error you are getting?

philipdavy
Contributor
0 Kudos

Post the dump you are getting.

Regards,

Philip.

Former Member
0 Kudos

Hi Faizur,

Seems you are in infinite loop. Clear LV_RETURN when sy-subrc fails.

       WHILE lv_return = abap_true.

        FETCH NEXT CURSOR gv_cursor

        APPENDING TABLE lt_ekpo

        PACKAGE SIZE 10001.

if sy-subrc ne 0.

clear lv_return.

endif.

Cheers!!

Raju Shrestha.