ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and OLE
FREE OBJECT - OLE
Other versions: 7.31 | 7.40 | 7.54
Syntax
FREE OBJECT ole [NO FLUSH].
Addition
Effect
This statement releases the memory occupied by the object ole on the current
AS Instance. The
automation object must have been created using the special statement
CREATE OBJECT for automation objects. After the release, the object is still available on the current automation server, but can no longer be processed in the ABAP program. For the
typing of ole, the description of the statement CREATE OBJECT applies.
When the statement FREE OBJECT is passed to the presentation layer, the entire automation queue collected using the addition NO FLUSH is passed.
System Fields
| sy-subrc | Meaning |
|---|---|
| 0 | Memory released successfully. |
| 1 | Error in communication with SAP GUI. |
| 2 | Error in 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.
Addition
... NO FLUSH
Effect
The meaning of the addition NO FLUSH is included in the description of the statement CREATE OBJECT.
Example
Releases an Excel object.
DATA app TYPE ole2_object.
CREATE OBJECT app 'Excel.Application' NO FLUSH.
...
FREE OBJECT app NO FLUSH.