2007 Sep 03 5:19 AM
main diff b/w these two
what happends after declaring internal table liske this
2007 Sep 03 5:21 AM
Hi,
free itab
will remove the memory allocated and you cannot use it after this statement
refresh itab
clears off the data in the table and it that table can be used after this statement
if you want to reuse the itab for differnent records with the same field
then go for refresh
if you dont want the itab after certain operations
go for free
thanks & regards,
Venkatesh
main diff b/w these two
what happends after declaring internal table liske this
2007 Sep 03 5:21 AM
Free is to free the grid/alv container/memory ID.
For internal table, you need to use REFRESH.
FOr workareas/structure/variables use CLEAR
2007 Sep 03 5:21 AM
Hi,
Free : It clears the contents of the internal table and deallocated the memory assoxiated with it.
Refresh : It just clears the body of the internal table, doesnt deallocate menory space.
regards,
Navneeth K.
2007 Sep 03 5:21 AM
Hi,
free itab
will remove the memory allocated and you cannot use it after this statement
refresh itab
clears off the data in the table and it that table can be used after this statement
if you want to reuse the itab for differnent records with the same field
then go for refresh
if you dont want the itab after certain operations
go for free
thanks & regards,
Venkatesh
2007 Sep 03 5:23 AM
Free is used to clear all the memory values
Reset to appropriate initial value for type, including release of resources
- FREE f.
Release an area in the ABAP/4 memory
- FREE MEMORY.
Release the memory occupied by an external object
- FREE OBJECT obj.
Refresh is used to clear all the internal table contents.
refresh it_tab.
Regards
Gopi
2007 Sep 03 5:23 AM
HI,
refresh and free both we will use for clearing the internal table body.
but,refresh will initialize the internal table memory.
if it is occurs 0 it will be initialized to 8kbs,if it is occurs n it will initialize for n records.
<b>reward if helpful</b>
rgds,
bharat.
2007 Sep 03 5:24 AM
Hi N Naresh
normally when you declare the variable . variable will occupy the space for the data .
FREE and REFRESH is used for clearing the data in variable , though the entire memory area occupied by the table rows is released.
Best Regards
Wiboon
2007 Sep 03 5:31 AM
Hi Naresh,
FREE : This statement deallocates the memory of the runtime object.. suppose that you say FREE itab, it will deallocate the memory allocated to this internal table at runtime..
What happens is, at the time of execution, when the first record is appended to the internal table, the system allocates a memory block for this table depending on the number in the OCCURS statement if any..
Now, when you use the FREE statement, the system deallocates this memory block..
REFRESH : This statement clear the contents of the internal table, but does not deallocate the memory space..
Use:
FREE : In your program logic, when you are sure that a particular internal table is not going to be used after a certain point, then use FREE.
REFRESH : When you want to clear the contents, but are going to populate the table with new data again, then use REFRESH.
If you use FREE for table clearing, it makes bad impact on performance, because the system spends extra time in the allocation and deallocation of memory.
Thanks and Best Regards,
Vikas Bittera.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |