I am receiving runtime error as " Cursor already closed or not open yet." for the below piece of code.
So, can anyone please help me how to solve it?
I have tried DB_COMMIT FM for commit work and also without it, still the same dump occurs.
<content removed by SAP Community Moderator>
data: gv_cursor TYPE cursor.
OPEN CURSOR WITH HOLD gv_cursor
FROM erdk AS erdk
INNER JOIN fkkvkp AS fkkvkp
ON fkkvkp~vkont = erdk~vkont
WHERE erdk~opbel IN s_prtdoc.
FETCH NEXT CURSOR gv_cursor
INTO TABLE gt_input
PACKAGE SIZE 1000.
IF sy-subrc IS INITIAL.
SORT gt_input BY opbel.
CLOSE CURSOR gv_cursor.
****Some other logics is implemented below.