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: 

Occours 0

Former Member
0 Kudos
346

what is the diffrence between occurs 0 and occurs 100.

What we can use in real time. Heard that we should always use occurs 0. Is that right-if yes than why...............

Confused.......

need solution....

thanks & regards....

9 REPLIES 9

Former Member
0 Kudos
269

Occurs 0 / 100 / 5000

This mean that you reserve the corresponding allocated memory for your internal table.

But in fact, if you choose '0', the memory is allocated dynamically, so put 0 !

Hope this helps,

Erwan

Former Member
0 Kudos
269

Hi Abhay,

occurs specifies the memory..and memories are specified in blocks

if you specify occurs 0 a memory block of 100 records is created and then if you enter the 101st record another block of double the memory of previous one is created.. this is useful when you know how many record you are going to append to the internal table.

and if you dont know the number of records you specify it as occurs 0.... that means internal table automatically gets adjusted to the number of records you are appending ..

please reward if helpful

Regards,

_pankaj singh

Former Member
0 Kudos
269

Hi,

by using this, you can store the records in the Internal table, If you give Occues 0 then we are giving ful space(8kb) to Internal table, if you give occurs 5, then you are assiging less space, this is very usefull for large amount of data, if the total no of records in the internal table execced the 8kb, then the system automatically assign 8kb space again, so if you are dealing with small amount of data in the internal table, then make use of this <b>occurs N</b>, so you won't get any memero related problems

Regards

Sudheer

Former Member
0 Kudos
269

hi,

if you are not sure on the no of internal table entries, better use occurs 0.

Former Member
0 Kudos
269

Occurs 100 means ur internal table gets reserved to store 100 records whereas Occurs 0 doesnot imply this way...It automaticaaly allocates record no. and it can store as many as possible and dynamically the record store no. is generated when used with Occurs 0.

Former Member
0 Kudos
269

thnks ....

answered is been given properly

Former Member
0 Kudos
269

Hi

The space to store an internal table in the memory is calculate automatically at runtime, when a new record is appended the system expands the memory to be used.

If it indicates how many records a table could have,when the program is uploaded in the memory, the system reserves the space necesserary to allocate 100 records.

So in this way it can improve the performance because the system doesn't allocate the memory automatically.

But if it make sure the table'll have 100 records, otherwise it'll be used memory for nothing. So if it can't know how many records can be uploaded in an internal table, it's better not to indicate it in the declaration.

Max

Former Member
0 Kudos
269

'0' assigns 8kb of memory eack time.

where as 'occurs 100' allocates the memory for 100 records each time.

This is not a fixed memory. It increases dynamicallu. But every time it assigns the same memory.

Thanx.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
269

Hi Abhay, maybe you could award points for helpful answers on this post. Thanks.

Regards,

Rich Heilman