‎2007 Jan 22 6:23 AM
hi,
As per my knowledge during the defination internal table donot allocate memory but we use 'free' to deallocate the memory associated with internal tables...
how is it possible...
thanks.
Saurabh Agrawal.
‎2007 Jan 22 6:39 AM
Saurabh,
FREE statement is used for deleting the internal table and releases the memory.
So it's not only releases the momory it's deleting the defination for internal table also.
Regards,
Amey
‎2007 Jan 22 10:36 AM
Hi saurabh,
once memory is allocated to an internal table by using occurs ... ,then to deallocate that memory free will be opted.
‎2007 Jan 22 10:51 AM
Hi,
Whenever you create the internal table irrespective of which statement you use to define it, memory is allocated to the internal table.
To explicitly allocate memory to the internal table you use the 'OCCURS' statement.
After the use of the internal table is over you can then allow this memory to be freed for other use by using the 'FREE' statement.
Hope this clarifies your question.
‎2007 Jan 22 12:50 PM
Hi ,
FREE statement will free the memory allocated to the internal table while creating it..
To my knowlege OCCURS 0 will allocate a memory of 8 KB to the internal table...
Is it like , if i declare OCCURS 100 , will allocate 800 KB..
Plz anyone clarify this, or can add few more info...
Thanks
Rajiv
‎2007 Jan 23 6:50 AM
Hi,
Free will deallocate the memory of the internal table and even the size of the internal table will decrease.
Regards,
Gunasree.
‎2007 Jan 23 9:32 AM
‎2007 May 11 12:20 PM
we r not allocating memory seperately but while declaring internal table we use occurs statement it will automatically allocate memory and we use free to deallocate memory.
‎2007 May 11 12:40 PM
HI saurabh,
<b>Here I will give you a clear information about your query.</b>
See for example we take some scenario of using internal tables
we are using an <b>internal tables itab1 , itab2</b> fetching data into these tables by some select statements so depending on the number of records <b>memory is allocated</b> to these two table--- right....
now you have another <b>internal table IT_FINAL</b> with sould be the output of your report.
looping the itab1 and reading itab2 you get data into the it_final internal table
and show the output using alv grid....
After you get data into final internal table and displaying it, then you can free the itab1 and itab2 .. memory aloocated to ITAB1 AND ITAB2 is dealocated now..
Hope you are clear now
rewards if understood
regards,
nazeer
‎2007 May 12 8:54 AM
Hi saurabh,
when u will define an internal table with occurs 0 it will allocate a memory size of 8Kb to that internal table intially...
the FREE command is used to freeze the body of the internal table...
FREE itab.
aftre this command the internal table will be having only the header part it won't be having the body...use the FREE command when u have finished using that internal table...
alternative to FREE is the REFRESH command..this will clear only the header of that internal table...where as the body size remain as it is...
hope this would solve ur problem....
Regards,
Prashant
‎2007 May 14 10:01 AM
Hi Saurabh
While definition of internal table ,if you use "DATA" in the declaration then memory will be allocated automatically...
after display of internal table to deallocate that memory we use "FREE ITAB".
Data : Begin of itab_final occurs 0, //here memory gets allocated
matnr like mara-matnr,
werks like marc-werks,
end of itab_final.
REWARD IT PLEASE....!!!