2008 Apr 28 11:24 AM
2008 Apr 28 11:36 AM
Hi Dilip,
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.
Reward if useful,
Regards,
S.Suresh.
*DATA:BEGIN OF it_data OCCURS 0
what does occurs 0 mean?
2008 Apr 28 11:26 AM
The OCCURS <n> signifies the compiler that the declaration is for an internal table....
Reward if useful.
Regards
Shiva
2008 Apr 28 11:27 AM
Hi,
Use of Occurs - If you use the OCCURS parameter, the value of the INITIAL SIZE of the table is returned to the variable <n>
Data : Begin of ITAB occurs 0,
End of ITAB.
Occurs or Initial Size to specify the initial amount of memory that should be assigned to the table.
Yes, we can change the occurs value in program but output remains the same.
2008 Apr 28 11:28 AM
hi,
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.
Regards,
Santosh
2008 Apr 28 11:28 AM
Hi,
OCCURS addition is generally used to reserve memory for the internal table corresponding to those many rows.
In case of Occurs 0, it only means that the data declared before occurs word is going to be an internal table, with no pre-reserved memory space.
It DOES NOT mean that the table cannot have any rows. The internal table so declared can have any number of rows appended (upto the max limit of an internal table, ofcourse).
Do let me know if this helped.
Thanks,
Pranjal.
2008 Apr 28 11:28 AM
This creates an internal table with header line and allocates
8KB of memory(space) to the internal table ...
2008 Apr 28 11:29 AM
2008 Apr 28 11:30 AM
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 occurs N, so you won't get any memero related problems
Hope this helps, Do reward.
2008 Apr 28 11:32 AM
Hi ,
Suppose I write Occurs 4 ,then it wud mean whenever an internal table is falling short of rows , 4 new rows will get added to it.
but there is one problem, suppose I have 5 records..then 4 will get stored in one go and next time 4 more rows will be added however there is a requirement of only one extra row, so our memory is wasted.
This is the reason we always write OCCURS 0 which means whenever internal table is falling short of rows add only the rows required and hence this saves memory..
Revert back if u have doubts...
Please reward points if helpful
Manish
2008 Apr 28 11:32 AM
DATA BEGIN OF itab OCCURS n.
The data object n that has to be specified as a numeric literal or numeric constant determines the initial memory requirement.
Thanks,
Vibha
Please mark all the useful answers
2008 Apr 28 11:34 AM
when you write OCCURS 0. the ABAP interpreter assigns 8kb memory in application server for that particular internal table,.
There is no other concept likfe OCCURS 1 , OCCURS 2 as people say that there u can store only one row in internal table,.,,
This thought is completely wrong....
2008 Apr 28 11:36 AM
Hi Dilip,
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.
Reward if useful,
Regards,
S.Suresh.
2008 Apr 28 12:21 PM
It just deals with the memory and when u write occurs 0 it means the memory allocated for ur structure declaration is 8kb, according to ur records u can increase ur memory size.
And when u declare ur internal table with Begin OF keyword that indicates with Header LINE.
THks
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |