Free is an ABAP programming keyword used to reset the values associated with an object. This keyword is capable of deleting the following:
An internal table used in ABAP programs
A data cluster in ABAP memory
An external object used in object linking and embedding
Unlike other ABAP keywords used for resetting values, Free also releases all resources connected with the object, mostly memory. It is commonly used instead of other keywords or a combination of keywords for resetting objects and releasing associated memory, especially if a large number of objects are involved.
The syntax for using the keyword FREE is as follows:
Features of the Free keyword include the following:
FREE may be directly used to initialize an internal table, like keywords REFRESH and CLEAR. However, FREE also releases all memory space associated with the internal table, including the initial memory requirement.
After the free <object> statement, the data object may be addressed, with the exception of external objects used in object linking and embedding. However, this can involve reallocating data object resources.
In an external object is used in object linking and embedding, FREE does not allow further object processing.
If the addition of variant "Memory ID" is not used, FREE can delete all of the contents in ABAP memory. With the usage of memory ID, only the contents associated with unique ID are deleted from ABAP memory.
The runtime for executing the FREE statement is approximately five standardized microseconds.