SAP CLOSE CURSOR ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID CLOSE-CURSOR
• CLOSE CURSOR ABAP_STATEMENT_OSQL

CLOSE CURSOR
Short Reference

ABAP_SYNTAX
CLOSE CURSOR @dbcur.

What does it do?
This AB-SQL statement CLOSE CURSOR closes the database cursor and initializes the cursor variable dbcur, with which the database cursor is linked. The cursor variable dbcur is a host variable that must be declared using the special predefined data type cursor and that was opened using the statement OPEN CURSOR or was assigned an open cursor.



Latest notes:

Since only a limited number of 17 database cursors can be open simultaneously in AB_SQL , all database cursors no longer required should be closed.
Initializing a cursor variable using the CLEAR statement is not enough to close a database cursor. If the value of the cursor variable in the program is known, the database cursor can be further processed using FETCH.
Once a database cursor has been closed, it can no longer be accessed. Other cursor variables that were linked with the database cursor are not initialized but become invalid and accessing them would raise a catchable exception.
The name of the host variable dbcur should be prefixed with the escape character @. If the associated statement OPEN CURSOR is checked in accordance with the ABAP_STRICT_760 strict mode / from ABAP_RELEASE ABAP_760 , the escape character @ must be specified.
BEGIN_SECTION SAP_INTERNAL_HINT
No closing of reader streams in the current release.
END_SECTION SAP_INTERNAL_HINT
ABAP_HINT_END



Example ABAP Coding

Closing of a previously opened and used database cursor.
ABEXA 00111
ABAP_EXAMPLE_END

Return to menu