‎2007 Jul 06 10:09 AM
Hi experts,
What is exact meaning of refresh statement
Thanks & regards,
vijay.
‎2007 Jul 06 10:11 AM
<b>REFRESH itab.</b>
<b>Effect</b>
This statement sets an internal table itab to its initial value, meaning that it deletes all rows of the internal table. The memory space required for the table is freed up to the initial memory size INITIAL SIZE. For itab, you must specify an internal table.
To delete all rows and free the entire memory space occupied by rows, you can use the statement FREE.
<b>Note</b>
The statement REFRESH itab acts for all internal tables like CLEAR itab[]. If an internal table itab has a header line, then the table body and not the header line is initialized. If the internal table itab has no header line, <b>REFRESH itab</b> acts like <b>CLEAR itab</b>. Therefore, you should always use CLEAR instead of REFRESH.
reward points if it is usefull ...
Girish
‎2007 Jul 06 10:10 AM
Hello
Refresh : It will deletes the contents and memory also.
Regards,
Sree
‎2007 Jul 06 10:10 AM
Hi ,
suppose itab is your internal table..
clear itab . " clear header.
clear itab[] . " clear only body but header line contains the data.
refresh itab. " clear only body but header line contains the data.
so in clear itab[] or refresh itab the bodyb will be deleted you can not access the data by loop at itab or by read table satatement after using clear itab[] and refresh.
in some cases you have to clear the header line because when you are refering the itab-f1 in loop at itab or in read table statement actually you are refering the header line data. So if you want to clear the header line in these occassion then you have to use clear itab.
Reward points if it helps..
Regards,
Omkar.
Message was edited by:
Omkaram Yanamala
‎2007 Jul 06 10:11 AM
Hi,
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
Reward if useful!
‎2007 Jul 06 10:11 AM
REFRESH statement will clear the whole body of the internal table
‎2007 Jul 06 10:11 AM
It is like the clear statement..mostly used with tables to refresh the table contents.
Regards,
Atish
‎2007 Jul 06 10:11 AM
Hi
REFRESH ITAB
means deletes the complete Body data of internal table
Reward points for useful Answers
Regards
Anji
‎2007 Jul 06 10:11 AM
<b>REFRESH itab.</b>
<b>Effect</b>
This statement sets an internal table itab to its initial value, meaning that it deletes all rows of the internal table. The memory space required for the table is freed up to the initial memory size INITIAL SIZE. For itab, you must specify an internal table.
To delete all rows and free the entire memory space occupied by rows, you can use the statement FREE.
<b>Note</b>
The statement REFRESH itab acts for all internal tables like CLEAR itab[]. If an internal table itab has a header line, then the table body and not the header line is initialized. If the internal table itab has no header line, <b>REFRESH itab</b> acts like <b>CLEAR itab</b>. Therefore, you should always use CLEAR instead of REFRESH.
reward points if it is usefull ...
Girish
‎2007 Jul 06 10:12 AM
Hi..
REFRESH IT_TAB.
this statement deletes all the records of the internal table.
that means it will initialize the internal table.
But it will not deallocate the memory of internal table.
You can use
FREE IT_TAB.
This will deallocate the memory of internal table.
reward if helpful.
‎2007 Jul 06 10:17 AM
hi,
<b>REFRESH <itab>.</b>: this statement will remove contents of internal table.
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.
regards,
Ashok Reddy
‎2007 Jul 06 10:19 AM
it deletes all the memory info.
REFRESH
Initializes an internal table.
Syntax
REFRESH <itab>.
Resets the internal table <itab> to its initial value, that is, deletes all of its lines.
REFRESH CONTROL
Initializes a control.
Syntax
REFRESH CONTROL <ctrl> FROM SCREEN <scr>.
The control <ctrl> defined in the CONTROLS statement is reset with the initial values specified for screen <scr>.
‎2007 Jul 06 10:25 AM
Clear ITAB[] : clear contents of the ITAB not header line.
clear ITAB : Clear header line, if itab is w/o header line, shows compilation error.
Refresh : same effect as refresh
Free ITAB : Clear ITAB and header line and free the memory as well.
‎2007 Jul 06 10:29 AM
Hi,
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.
DATA: BEGIN OF LINE,
COL1,
COL2,
END OF LINE.
DATA ITAB LIKE TABLE OF LINE.
LINE-COL1 = 'A'. LINE-COL2 = 'B'.
APPEND LINE TO ITAB.
REFRESH ITAB.
IF ITAB IS INITIAL.
WRITE 'ITAB is empty'.
FREE ITAB.
ENDIF.
The output is:
ITAB is empty.
In this program, an internal table ITAB is filled and then initialized with REFRESH. The IF statement uses the expression ITAB IS INITIAL to find out whether ITAB is empty. If so, the memory is released.
Please reward points.
Regards,
Ameet