Ansicht
Dokumentation

ABAPCLOSE_CURSOR - CLOSE CURSOR

ABAPCLOSE_CURSOR - CLOSE CURSOR

General Material Data   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

CLOSE CURSOR

Short Reference



CLOSE CURSOR @dbcur.

Effect

This 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.

Notes

  • Since only a limited number of 17 database cursors can be open simultaneously in , 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 strict mode from Release , the escape character @ must be specified.

Example

Closing of a previously opened and used database cursor.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 2227 Date: 20240424 Time: 155443     sap01-206 ( 41 ms )