2008 Mar 25 1:53 PM
Hi,
i wont to clean all internal table what is recommended to use free or refresh and clear (for header).
Regards
2008 Mar 25 2:07 PM
Hi Ricardo,
Please Go through below information on when to use these statements and choose appropriate for your requirement...
Ultimately indepth knowledge is better ...
and If you want to delete just internal table body then use refresh itab.
or
clear itab[].
nd want to clear itab nd deallocate the memory also then
Free itab.
or
if you just want to clear header line then
clear itab.
==========================================
CLEAR <itab>.
statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.
If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.
CLEAR <itab>[].
To ensure that the table itself has been initialized, you can use the
REFRESH <itab>.
statement. This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated. To release the memory space, use the statement
refresh should use only internal table,clear - you can use variables,internal table ,work areas
FREE : it is deallocating meomry .. so this memory can be utilize by other program..
Hope it will solve your problem...
Reward points if useful..
Thanks & Regards
ilesh 24x7
2008 Mar 25 1:54 PM
hi,
clear is recomended,
generally we clear the work areas.
reward if useful
2008 Mar 25 1:55 PM
Header table clearing:
CLEAR: it_tab, it_tab[].
or
CLEAR it_tab.
REFREAH it_tab.
Non Header Tables
REFRESH it_tab.
FREE is for releasing memory.
2008 Mar 25 1:55 PM
Hi friend,
Use FREE itab....it will release the memory space too....
Refer this link:
http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb384e358411d1829f0000e829fbfe/frameset.htm
2008 Mar 25 1:56 PM
refresh clears all the contents of an internal table ...
refresh : itab ...
clear : itab. <-- clears the header line
clear : itab{}. this is equivalent to refresh : itab.
free.. frees the memory allocation to the internal table ..
2008 Mar 25 1:57 PM
Hi,
CLEAR is used if you want to remove only the Header Line of an internal table.
Refresh is used if you want to delete the header line as well as all the values or records present in internal table.
So , usually for work areas and variables Clear is enough. Refresh doesnt make sense here, with variables and work areas.
What Free does is, it clears the value and sets the value to its INITIAL value.
Reward if helpful.
Regards.
2008 Mar 25 1:58 PM
Hi,
Refresh will delete all data present in the internal table.
free will delete the data and deallocate the memory of the internal table.
You can choose either of them.
Thanks,
Sriram Ponna.
2008 Mar 25 2:07 PM
Hi Ricardo,
Please Go through below information on when to use these statements and choose appropriate for your requirement...
Ultimately indepth knowledge is better ...
and If you want to delete just internal table body then use refresh itab.
or
clear itab[].
nd want to clear itab nd deallocate the memory also then
Free itab.
or
if you just want to clear header line then
clear itab.
==========================================
CLEAR <itab>.
statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.
If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.
CLEAR <itab>[].
To ensure that the table itself has been initialized, you can use the
REFRESH <itab>.
statement. This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated. To release the memory space, use the statement
refresh should use only internal table,clear - you can use variables,internal table ,work areas
FREE : it is deallocating meomry .. so this memory can be utilize by other program..
Hope it will solve your problem...
Reward points if useful..
Thanks & Regards
ilesh 24x7