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

OCCURS 0

Former Member
0 Likes
933

Hi All,

what is the main Difference between Occurs 0 and occurs 1???

any one can explain plz.

regards,

Hi All,

what is the main Difference between Occurs 0 and occurs 1???

any one can explain plz.

regards,

7 REPLIES 7
Read only

Former Member
0 Likes
903

Refer

Read only

Former Member
0 Likes
903

Occurs 0 will allocate one record of memeory as and when the first record in appended or inserted to the table. BY default no space wil be reserved at the beginnig..

Occurs1 will reserve space for the first record from the beginning itself. From there on, there is no much difference.

regards,

ravi

Read only

Former Member
0 Likes
903

Hi,

it is related to the memory allocation for the number of records in an internal table at run time.

Occurs 0 means initially it won't allocate any memory for the itab,

! means initially it allocates little memory and depending on the data coming into itba it goes on increasing.

So no need to give any number, if you give 0 by default it will takes as per the number of records.

reward points if useful

regards,

ANJI

Read only

Former Member
0 Likes
903

The funktion allokate Storage location. Thats all...

This is an old Statement.

Better use.

DATA: wa_table type table.

DATA: it_table like table of wa_table.

Read only

Former Member
0 Likes
903

Hi Vijay

DATA: BEGIN OF LT_ITAB OCCURS <n>,

END OF LT_ITAB.

This is an internal table

The number <N> indicate how many lines has to have the table in initialization time: i.e. when the program is loaded in memory, the space for the table depends on the initialization numbers of the records.

AT run time if the table needs more space, this'll automatically be enhanced.

Hope this helps.

Britto

Read only

Former Member
0 Likes
903

Vijay,

When we use Occurs 0 no memory will get allocated to that internal table.

When we use Occurs 1 reserved the memory for one record.If you add more records than OCCurs number in Both cases memory will get incresed automatically.Occurs with number we will use only when we total number of records to be stored.

Ex: if you allocated memory like OCCURS 10000 and add 100 records rest of the memory will be wasted .

Don't forget to reward if useful...

Read only

Former Member
0 Likes
903

be aware that this is an obsolete statement!