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: 

refresh

Former Member
0 Kudos

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?

11 REPLIES 11

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

<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.

0 Kudos

free will not clear the header line i tried it.

0 Kudos

<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>

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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 .

Former Member
0 Kudos

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