2007 Jan 02 9:33 AM
Hi Friends,
I wanted to know what is the difference between occurs 0 & occurs 1.
Which one is prefferable & why??
2007 Jan 02 9:36 AM
Hello Neha,
If u decalre the tab as occurs 0 then the 8kb memory will be allocated for that table.
If u decalre the tab as occurs 1 then the memory will be reallocated as the data is filled in that table.
So if the data the table is holding is more then go for occurs 0 additon. If it is less u can declare it with occurs 100.
If useful reward.
Vasanth
2007 Jan 02 9:42 AM
Hi Neha,
If u declare table with OCCURS 0 ---> defaultly an 8KB memory is assinged to table. Eventhogh the table infromation is not that much, So memory is wated if the informaion is less.
Declaration of table by using OCCURS 1, Means it will assign a memory space which will sufficant to fint for one record first. depending upon the usage the consiqutive memory is assinged.
if u know the amount of information that need to be place in table, it is better to give mount.
Regards,
Sunil
2007 Jan 02 9:47 AM
hi,
occurs 0 addition will allocate large memory space and it is advisable 2 go for occurs 0 when u r not sure of the amount of the data 2 be stored.
however if u need 2 store only limited amount of data, u can go for occurs 100. This will help in improving performance as unwanted memory allocation is avoided.
regards,
Sandeep
*pls award points if u find this useful
2007 Jan 02 10:12 AM
Hi,
I know that if we specify occours 0 it will allocate 8kb of memory by default.
My question is like if i write occurs 1 it will only hold only one row or more than 1 row.
Similarly occurs 2 then it will hold only two rows or anything else.
While occurs 100 what happened??
Pls let me know asap.
2007 Jan 02 10:16 AM
Hi Neha,
For occurs 1, when one row is filled, then more memory is allocated. It can have more than one row as memory will be dynamically allocated.
so for occurs 2 or occurs 100, you will be able to append more records.
Regards
Navneet
2007 Jan 02 10:20 AM
hi,
If u use occurs 1, initially, only 1 row will be allotted and depending on the usage, memory will be reallocated.
Regards,
Sandeep
2007 Jan 02 10:27 AM
Hi,
It will hold more than one record, but initially it will assigne memory for one record only.
While u r appending records it will assign memory...!
Regrds,
Sunil
2007 Jan 02 10:19 AM
Hi
system calculates the size by rowlength * occurs that is how much memoryu you want for declaring the itab.
if your row length is big enough it may allocate 8kb also...
rowlength * no. of occurs > or eq 8 kb it will allocate the memory in system page area and if it is less it will be allocated in program roll area.
access to program roll area memory is faster than system page area.
so it depends on the size of your internal table.
if your internal table contains occurs 1 and row length * 1 less than 8kb then it will allocate memory in program roll area for the first time but if your itab size crosses 8 kb limit it will allocate at system page area .
regards
shiba dutta