Application Development and Automation 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: 
Read only

Using fetch next cursor statement.

Former Member
0 Likes
580

Hi Experts,

I have a single record that should come after the execution of below code. The select statement is already setting the value of dbcur. But in this DO statment after the execution of FETCH statement sy-subrc gets set to 4 and thus no records come to it_dfkkop. But one record should come. here iv_ss is of type numc10.

Please help.

DO.
          FETCH next CURSOR dbcur
         APPENDING TABLE it_dfkkop
          PACKAGE SIZE iv_ss.
          IF sy-subrc <> 0.
            CLOSE CURSOR dbcur.
            EXIT.
          ENDIF.
        ENDDO.

Edited by: abhishek ranjan on Feb 25, 2010 2:23 PM

Moderator message - Moved to the correct forum. Please use code tags to format your code.

Edited by: Rob Burbank on Feb 25, 2010 9:06 AM

1 REPLY 1
Read only

StMou
Active Participant
0 Likes
323

HI,

Are you open your cursor ?


OPEN CURSOR [WITH HOLD] dbcur FOR 
  SELECT result 
         FROM source 
         [[FOR ALL ENTRIES IN itab] WHERE sql_cond] 
         [GROUP BY group] [HAVING group_cond] 
         [ORDER BY sort_key].

Rgds