2006 Aug 21 6:03 PM
what is the diff between OCCURS 0 and OCCURS 1 while creating internal tables?
what is the diff between OCCURS 0 and OCCURS 1 while creating internal tables?
2006 Aug 21 6:05 PM
Occurs 0 does not reserve space for the itab at the time of declaration, and occurs 1 reserves 1 line when the itab is declared.
Regards
Sridhar
2006 Aug 21 6:06 PM
Occurs 0 creates an internal table with no rows at the time of creation. OCCURS 1 creates a table with 1 physical row at creation time.
2006 Aug 21 6:08 PM
OCCURS 1 actually allocates memory space for 1 line of the internal table. OCCURS 0 allocates no memeory space when the internal table is created. The memeory space is allocated when filling the internal table.
Really, you should not be using the OCCURS extension when defining internal tables as it is obselete. You should define a type instead.
Types: begin of ttab,
fld1 type c,
end of ttab.
data: itab type table of ttab.
data: wa like line of itab.REgards,
Rich Heilman
2006 Aug 21 11:45 PM
Hello Sudharasan
As Rich Heilman already said itab's with header lines are obsolete.
For me, using itab's with header lines is worst ABAP programming possible because these programs are a mess to read and understand. Such programs are highly error-prone when it comes to maintaining.
Regards
Uwe
2006 Aug 21 11:51 PM
hi
occurs 0-->No memory allocated at the time of cretion
occurs 1-->Memory alloted to a line at the time of creation.
Note:Interal table with header lines are oldest form of
internal tables.
Cheers,
Abdul Hakim
2006 Aug 22 7:14 AM
hi
good
there is besically no difference between the occurs 0 and occurs 1 both of them acquire the same memory.If you know the exact amount of that that you r going to fetch from the database than give the same number with occurs otherwise it doesnot make any difference wheather you give occur 0 or 1, even though you r taking less amount of data it ll use the same memory area.
thanks
mrutyun
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |