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: 

'DATA ITAB LIKE LINE OCCURS 10' occurs 10???

Former Member
0 Kudos

Hi,

DATA  ITAB  LIKE  LINE  OCCURS  10

What does the 'OCCURS 10' means?

Whether it means that this ITAB should only have 10 records inside???

What's the difference between 'OCCUR 0' and 'OCCURS 10'

Thanks.

1 ACCEPTED SOLUTION

former_member186143
Active Contributor

allways use occurs 0, it is for optimizing performance and 10 is the initial memory assignment for the expected number of rows

it is a bit obsolete now for using specific amount with the modern systems

Message was edited by:

A. de Smidt

9 REPLIES 9

Former Member
0 Kudos

hI

If we use occurs 0 means how much space is required that is alloted.

suppose if we use occurs 100 means though that table has no records it will allot

100*minimum space. It will waste the memory if no records are found.

example min = 10 bytes.

occurs 1 = 10 bytes.

occurs 2 = 20 bytes.

please reward points for helpful ans's

kiran.M

former_member186143
Active Contributor

allways use occurs 0, it is for optimizing performance and 10 is the initial memory assignment for the expected number of rows

it is a bit obsolete now for using specific amount with the modern systems

Message was edited by:

A. de Smidt

Former Member
0 Kudos

hI

There is not much difference between occurs 0 and occurs 100 except the performance and unnecessary memory storage .

occurs 0 : the system will allocate memory according to the exact needed memory for the itab .memory increases according to the need .

occurs 100 : equivalent to 100 rows of memory will be allocated for the itab at the begining , which is nothing but blocking the memory area unnecessarily during runtime , which leads to performance issues in a way .

Hope this makes you understand .

Former Member
0 Kudos

Hi Laa,

OCCURS 10 will allocate initial size of internal table as 10 records. If any more records are added then the size of internal table is again increased to another 10 lines to accomdate.

This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to reserve memory space for <n> table lines when you declare the table object.

When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated.

Thanks,

Vinay

Former Member
0 Kudos

Hi

occurs 0 means a internal table will be allocated 8kb of

memory initially.if it needs more then again 8 kb of is

allocated to it,

Internal table has two memory

one roll area and page area

Roll area nothing but occurs 100

page area nothing but occurs 0

occurs 100 means it will get 100 records from data base to application server and from there it will come Presentation server.

occurs 0 means it will get all records from data base to application server and from there it will come Presentation server.

Thanks

Naveen khan

0 Kudos

nice one

Former Member
0 Kudos

Hi,

If you are sure that internal table will hold not more than 10 records at any particular point of time, then give it as OCCURS 10...this will increase the performance, but this does not mean that it will hold only 10 records , it can hold any no of records,

OCCURS 0 --- If you are not sure of the no of records , then give it as OCCURS 0 , depending on the no of records internal table size will be increased

Former Member
0 Kudos

good

former_member189845
Active Participant
0 Kudos

Occur doesn't limit the no of rows added to internal table. Occur clause is just to determine how much memory to allocate.

For Ex:Occur 10 . It doesn't mean like the internal table will hold only 10 records, It can have more the 10 records. The internal table is limited only by amount of memory avaliable in application server.

Don't use occur 0 if you except to store less than 8kb in internal table.

Happy Reading

Moderator Message - Please do not reply to old, dormant threads and push them in the update stream.

Message was edited by: Suhas Saha