This method closes all documents on the presentation server. It does not first save their data.
CALL METHOD control->release_all_documents
EXPORTING no_flush = no_flush
IMPORTING retcode = retcode
error = error.

Use this method carefully, otherwise changes to documents may be lost. Ensure that you save all of the changes before calling the method.

To release the memory required to manage the data object document on the application server, use the ABAP statement FREE document.