Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

internal table

Former Member
0 Kudos

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?

7 REPLIES 7

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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!

Former Member
0 Kudos

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!!!

former_member194669
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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