SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and OLE →Syntax
FREE OBJECT ole [NO FLUSH].
Addition:
Effect
This statement releases the memory occupied for the object ole on the application server. The automation object must have been created with the special statement CREATE OBJECT. After the release, the object is still available on the current presentation server, but can no longer be processed in the ABAP program. For the typing of ole and the meaning of the addition NO FLUSH, the same description applies as for CREATE OBJECT.
The transfer of the statement FREE OBJECT to the presentation layer causes the transfer ot the entire automation queue collected using the addition NO FLUSH.
System fields
sy-subrc | Meaning |
0 | Successful memory release |
1 | Error during communication to SAP GUI |
2 | Error during function call in SAP GUI |
Note
An automation object ole created using CREATE OBJECT
must also be released using FREE OBJECT to avoid memory bottlenecks and terminations of the application to be controlled.
... NO FLUSH
Effect
The same description applies for the addition NO FLUSH as for the statement CREATE OBJECT.
Example
Release of an Excel object.
DATA app TYPE ole2_object.
CREATE OBJECT app 'Excel.Application' NO FLUSH.
...
FREE OBJECT app NO FLUSH.