‎2007 Jul 17 5:42 AM
data:Begin of itab occurs 0,
a type i,
b type i,
end of itab.
--how much memory in terms of KB is allocated for itab?
--if it was <u>occurs 5</u> , do 5 new memory locations were created each time a new record is added to itab?or 5 new mem locations are created only when pre allocated memory is used up?
‎2007 Jul 17 5:53 AM
HI,
occurs 0 means initially it will allocate 8kb of memory.later it will increment in terms of 8kbs
occurs n means initially it will allocate memory for n rows.later it will increment in terms of n rows
<b>reward if helpful</b>
rgds,
bharat.
‎2007 Jul 17 5:44 AM
Hi,
Coming to performance: If you know that you will store only one single value in the Internal table If you use OCCURS 1. It would perform well than OCCURS 0.
Occurs 0 keeps on incrementing when there is a value. But Occurs 1 will assign a single space even though there is no value.
Lets suppose you did not get any values from the DB after a select, in this case if you write Occurs 0 it will not allocate any single space in the memory. If you write OCCURS1 it will pre allocates some memory.
Thanks.
‎2007 Jul 17 5:53 AM
HI,
occurs 0 means initially it will allocate 8kb of memory.later it will increment in terms of 8kbs
occurs n means initially it will allocate memory for n rows.later it will increment in terms of n rows
<b>reward if helpful</b>
rgds,
bharat.
‎2007 Jul 17 5:54 AM
Hi
I think the memory will be increased in multiples of 8KB
Occurs ) means it is 8KB then onwards it automatcially increases in multiples of 8KB, depending on the data in internal table at Run time
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 24 9:19 AM
When you write OCCURS 0 - 8 KB memory gets alloted to the structure. This means that the size of the table is increased when you put data into the table. This will make use of dynamic memory allocation.
When you write OCCURS n - n * 8KB memoy gets alloted for data. This is useful when there is a fixed number of records that we need to put into the internal table. This memory allocation is not dynamic.
‎2007 Jul 24 9:21 AM
hi,
by using this, you can store the records in the Internal table,
If you give Occues 0 then we are giving ful space(8kb) to Internal table,
if you give occurs 5, then you are assiging less space,
this is very usefull for large amount of data,
if the total no of records in the internal table execced the 8kb,
then the system automatically assign 8kb space again,
so if you are dealing with small amount of data in the internal table,
then make use of this occurs N, so you won't get any memero related problems
Regards
Reshma