07-25-2007 1:32 PM
whether REFRESH will erase contains of header and content of internal table, if table is declared as int. table with header line?
whether FREE will erase the contents of int. table?
07-25-2007 1:34 PM
HI,
NO it only erases the table, the header is still there with the data. And also the memory alocated to the table is still there.
FREE will free the memory also along with the Internal table content.
Thats why HEADER LINE is obsolete
Test using this code
DATA: itab TYPE TABLE OF spfli WITH HEADER LINE.
SELECT * FROM spfli INTO TABLE itab.
READ TABLE itab INDEX 1.
REFRESH itab.
WRITE: itab-carrid.
When you reward people who gave you good answers you get one point
Regards,
Sesh
07-25-2007 1:35 PM
Refresh will clear the contents of both the header line and the body of the internal table. Free will clear both and release the memory allocated as well.
Please mark points if the solution was useful.
Regards,
Manoj
07-25-2007 1:39 PM
<b>refresh</b> will clear the contents of internal table leaving behind the header line data. to clear header line data u need to use <b>clear</b> statement.
<b>free</b> statement will clear contents of internal table as well as header line.
07-25-2007 1:57 PM
07-25-2007 2:01 PM
<b>FREE</b>
The FREE statement has the same effect as the CLEAR
statement for any data objects except internal tables.
For internal tables, FREE has the same effect as the REFRESH statement. It releases the entire memory area occupied by the table rows.
<b>If dobj is an internal table with a header line , FREE has the same effect as REFRESH on the table body, and not the header line.</b>
07-25-2007 1:39 PM
hi javed,
REFRESH will clear the header part, the baody remains the same...
and FREE will clear the contens of internal table also the BODY gets freezed...
please reward incase usefull...
regards,
prashant
07-25-2007 1:40 PM
Hi
REFRESH ITAB - CLEARS the Body
FREE ITAB - Removes the internal table from the memory itself
REFRESH <itab>.
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
FREE <itab>.
You can use FREE to initialize an internal table and release its memory space without first using the REFRESH or CLEAR statement. Like REFRESH, FREE works on the table body, not on the table work area. After a FREE statement, you can address the internal table again. It still occupies the amount of memory required for its header (currently 256 bytes). When you refill the table, the system has to allocate new memory space to the lines.
Free
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/free.htm
Refresh
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/refresh.htm
reward if useful
Thanks
07-26-2007 9:30 AM
Hi,
If ew use REFRESH ITAB will delete all the entries from the table but the header line remains the same.
If you want to delete the header line also u have to use CLEAR.
FREE will release the memory allocated for that Table.
don't forget the reward
rgds
harris
07-28-2007 3:00 AM
hi abpes.
do not used header line because coming all version do not supports header line concept.
so upgrated time so many probles do not used header line.
4.7. we have used header line.
07-29-2007 8:32 AM
No it wont cleares the header line but cleares the body of the internal table but the memory allocated to this internat table not released .
but Free .
it releases the memory allocated to this internal table .
07-29-2007 10:20 AM
Hi
With many correct answers,I saw answers, which were partly wrong,so to avoid confusion this is CORRECT answer to your question.
REFRESH - clears only BODY of itab(without memory clearing),HEADER left with its data .
CLEAR - cleans HEADER,but leaves BODY of itab.
FREE - clears itab from memory ,but LEAVES the HEADER LINE data.
Hope you found my answer helpful.
Yossi