Application Development and Automation 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: 
Read only

internal table syntax

Former Member
0 Likes
696

data: begin of itab occurs 0

What does 0 signify here ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
674

When appending or inserting a new record into the internal table, an extra space of So many records is allocated in the memory.

In this case the memory is allocated as and when the new record is allocated.

if

its is occurs 4, then for every 4th record, an extra space that is sufficient for holding 4 new records is allocated.

Regards,

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
674

Hi,

Occurs 0 ---> By default no memory allocation to the itab. The Allocation will be dynamically done at run time.

Occurs N ---> By default it will be allocated of Size N.

N indicates the approximate no. of rows in the internal table. This is not good Practice in case of performance.

for better performance use occurs 0.

For more information, please check this link.

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3646358411d1829f0000e829fbfe/content.htm

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
675

When appending or inserting a new record into the internal table, an extra space of So many records is allocated in the memory.

In this case the memory is allocated as and when the new record is allocated.

if

its is occurs 4, then for every 4th record, an extra space that is sufficient for holding 4 new records is allocated.

Regards,

Ravi

Read only

Former Member
0 Likes
674

Hi,

Internal tables are run time tables;

Memory allocation will be done automatically depending up on the data coming to internal tables:

when you declare 0 it starts from taking a lower memory and starts by taking extra memory of 8 MB like that as per the requirement.

you can give occurs 1000 also, if you feel that huge data will be populated in your internal table.

So instead of fixing/asking /allocating the fixed memory to the internal table initilaly, if we declare as occurs 0 it will take the memory reasonably and utilise correctly.

reward if useful

regards,

Anji

Read only

Laxmana_Appana_
Active Contributor
Read only

Former Member
0 Likes
674

occurs 0 -


> Initially memory allocated for Zero records , later on depending on the no of records memory will be increased

occurs 100 -


> Initially memory allocated for 100 records , later on depending on the no of records memory will be increased