‎2007 Jul 02 6:48 AM
hi all,
could u pls give me a brief example about when do we exactly clear the header and refresh the body of an internal table .
thanks in advance
spoorthimanohar
‎2007 Jul 02 6:50 AM
Clear : clear only the work area or header
Refresh : Clears the whole contents of the internal table
For example you have an internal table it_tab[] with 12 rows and 12 columns with header line
loop at it_tab.
here it_tab contains one record in the header.
clear it_tab --> Clears only the HEADER.
endloop.
refresh : it_tab. --> Clears all the 12 records and empties the internal table.
Regards
Gopi
‎2007 Jul 02 6:54 AM
If u have one internal table
Clear will clear the headerline and Refresh will clear the whole internal table but Refresh will not clear the header line.If u didnt use Clear statement then the hederlinew iwll be there and it will have recent values.
‎2007 Jul 02 6:56 AM
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.
regards
shiba dutta
‎2007 Jul 02 7:03 AM
Hi,
Clear:
Deletes the content of the header area of internal table
Does not delete the content of the internal table
Refresh:
Deletes the content of the internal table
Does not delete the content of the header area
We clear the header while updating or appending data into internal table
let itab be the intenal table with header line.
itab-name = 'XXXX'.
itab-empno = 'XXXX'.
append itab.
clear itab. -> <b>clears the header line.</b>
<b>refresh itab can also be used.</b>
Refresh does not refresh the body of internal table . It refreshes only the header line.
clear[] - clears the body of the internal table.
Regards,
Priyanka.
‎2007 Jul 02 7:12 AM
hi,
clear is used to clear the body of an internal table, to clear the work area or header of an internal table.
data: itab like mara occurs 0 with header line,
data: int type i value 13.
ex: clear itab. // clears the header line of internal table itab.
clear itab []. // clears the entire content in internal table which includes header and body of an internal table.
clear int. // clears the value of integer varaible to null.
refresh: used to clear the heder line of an internal table or even an explicit work area.
ex: refresh itab. // erases the contents of an workarea or internal table header.
if helpful reward some points.
with regards,
Suresh.A