04-20-2007 9:40 AM
Hi All,
what is the main Difference between Occurs 0 and occurs 1???
any one can explain plz.
regards,
04-20-2007 9:42 AM
04-20-2007 9:43 AM
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
04-20-2007 9:43 AM
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
04-20-2007 9:44 AM
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.
04-20-2007 9:45 AM
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
04-20-2007 9:51 AM
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...
04-20-2007 10:08 AM