08-22-2007 6:00 AM
hi everyone,
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 occurs 5 , 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?
08-22-2007 6:04 AM
Hi,
Occurs 0 stands for Roll Area, will allocate full roll area memo ie 64k, if you enter 5 means will keep max 5 records and not 5k memo.
Hope this will clear .
Tushar choksi
08-22-2007 6:04 AM
Hi,
When u define your table with occurs o option at that time it will occupy 8 kb of memory. U can say it is same as one page characters. But i am suggesting you don't use occurs replace it with type.
Like :
Types: begin of ty_mara,
matnr type matnr,
mtart type mtart,
end of ty_mara.
data: itab type standard table of ty_mara intial size 0,
wa_mara type ty_mara.
This will defenaly better compare to occurs according to performance.
Rewards points if it is useful
08-22-2007 6:04 AM
Hi,
Its upto the ABAP runtime to decide when to allocate the memory.
suppose you have given it as occurs 5, then 5 is the initial size and from then on when ever you are appending values to the table if the runtime feels that it needs more memory it will keep on addiing 5 rows at a time.
But on which addition this memory is allocated is upto the runtime.
Regards,
Sesh
08-22-2007 6:05 AM
Hi,
As per my knowledge memory reqiored to store two integer type data will be allocated for sturcure and occurs 0 takes 8k.b.
If it is 5 then once you cross limit of 8kb then it allocates 1 page and as on...
Reward if useful!
08-22-2007 6:06 AM
By defining occurs 0, the memory allocated would only be the memory to define structure of the internal table and not for any data. By defining occurs 5, memory of 5 records would be allocated, and this happens only once while defining internal table and not every time you append records, when you append records, the memory is extended depending upon the no. of records and is taken care by SAP.
Reward points if useful, get back in case of query...
Cheers!!!
08-22-2007 6:08 AM
Hi,
Occurs 0 means a internal table will be allocated 8kb of memory initially.if it needs more then again 8 kb of is allocated to it
aRs
08-22-2007 6:10 AM
Hi Sriram,
if you use "Occurs 0", initially there will be no memory allocation for itab.
in case of occurs 5, SAP allocates 5 units of memory for itab initially and if the number of records fetched more in number at run time then itab memory will be increased depends up on the amount of data record/ size of the record.
<b>Reward ppoints if useful</b>
Cheers,
Chandra