FREE - Release memory occupied by an external object

Basic form

FREE OBJECT obj.

Addition:

... NO FLUSH

Effect

Releases the memory needed for object obj. The object cannot be processed afterwards.

The Return Code is set as follows:

SY-SUBRC = 0:
Object was released successfully.
SY-SUBRC = 1:
Error during communication with SAPgui.
SY-SUBRC = 2:
Error during function call in SAPgui.
The OLE function modules are only implemented in Windows.

Addition

... NO FLUSH

Effect

This addition collects FREE OBJECT calls together and, when the function module FLUSH is called explicitly, passes them to the SAPGUI for further processing.


FREE OBJECT belongs to a group of key words that allows you to process external objects with ABAP/4. At present, only the object model OLE2 is supported, i.e. all objects must be of type OLE2_OBJECT. This type and other necessary data are defined in the include program OLE2INCL.

Example

Release an EXCEL object:

INCLUDE OLE2INCL.
DATA EXCEL TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'Excel.Application'.
FREE   OBJECT EXCEL.

Related

CREATE OBJECT, SET PROPERTY, GET PROPERTY, CALL METHOD