Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

In Which Situations we will be using free itab.

Former Member
0 Kudos

Hi Abaper's

Can you Tell in Which Situations we will be using free itab, can any tell one scenario explaining it

1 ACCEPTED SOLUTION

Former Member
0 Kudos

just press F1 on free keyword and read help..i have pasted the same below -

FREE f.

Effect

FREE f has the same effect as CLEAR f , namely that a Data object f is reset to the initial value corresponding to its type.

Unlike CLEAR, FREE also releases any resources taken up by the data object f. FREE can also release more resources than CLEAR for table work areas declared using the TABLES statement.

After FREE f, the data object f can be re-addressed at any time. The only condition is that you may need to re-allocate resources to the object.

Note

If f is an internal table with header line (where the name f in a sense has two meanings) the statement FREE f refers to the body of the table, and the statement CLEAR f refers to the header line.

Note

Performance:

The runtime required to reset an internal table and free its resources, bound by the data object f, depends how much memory the internal table has been occupying.

To reset a small internal table takes around 80 msn (standard microseconds), a 200 KB table takes around 700 msn, and a 1 MB table around 3500 msn.

If the table has an index or hash table (because it was created using INSERT, DELETE or SORT, or edited using COLLECT), the runtime increases, since the index or hash table also need to be released.

3 REPLIES 3

Former Member
0 Kudos

just press F1 on free keyword and read help..i have pasted the same below -

FREE f.

Effect

FREE f has the same effect as CLEAR f , namely that a Data object f is reset to the initial value corresponding to its type.

Unlike CLEAR, FREE also releases any resources taken up by the data object f. FREE can also release more resources than CLEAR for table work areas declared using the TABLES statement.

After FREE f, the data object f can be re-addressed at any time. The only condition is that you may need to re-allocate resources to the object.

Note

If f is an internal table with header line (where the name f in a sense has two meanings) the statement FREE f refers to the body of the table, and the statement CLEAR f refers to the header line.

Note

Performance:

The runtime required to reset an internal table and free its resources, bound by the data object f, depends how much memory the internal table has been occupying.

To reset a small internal table takes around 80 msn (standard microseconds), a 200 KB table takes around 700 msn, and a 1 MB table around 3500 msn.

If the table has an index or hash table (because it was created using INSERT, DELETE or SORT, or edited using COLLECT), the runtime increases, since the index or hash table also need to be released.

0 Kudos

Former Member
0 Kudos

Rarely FREE ITAB is used i guess.

one scenario may be , if you want the last line of the itab in header line always then u can use FREE ITAB.

this statement will keep the last line of internal table in header and deletes the whole body