on 02-07-2022 6:48 AM
Hello Friends,
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
FOR SELECT
erdk~opbel
fkkvkp~ktokl
FROM erdk AS erdk
INNER JOIN fkkvkp AS fkkvkp
ON fkkvkp~vkont = erdk~vkont
WHERE erdk~opbel IN s_prtdoc.
DO.
FETCH NEXT CURSOR gv_cursor
INTO TABLE gt_input
PACKAGE SIZE 1000.
IF sy-subrc IS INITIAL.
SORT gt_input BY opbel.
ELSE.
CLOSE CURSOR gv_cursor.
EXIT.
ENDIF.
****Some other logics is implemented below.
ENDDO.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.