2007 Mar 06 5:41 PM
Hi frnds,
Can any one tell me like in real time do we give " occurs 0 " statement for intializing memory to internal tables.
plzz explain...
regards,
sahakla
2007 Mar 06 6:03 PM
As far as I know, specifying OCCURS 0 will allow the system to decide about the memory management of the internal table, instead of reserving memory space for a predefined number of entries like in case of, say, OCCURS 10.
By the way, the OCCURS parameter is considered to be obsolete in ABAP Objects, so it's probably better to use a different internal table declaration method everywhere such as ...TABLE OF...
2007 Mar 06 5:59 PM
No, as per the updated specs we dont use any more this type of declarations with header lines instead we declare Table Types then declare internal table and work area to populate it.
Types: begin of type_tab,
matnr type mara-matnr,
end of type_tab.
types: type_t_tab type satndard table of type_tab.
data: t_tab type type_t_tab,
wa_tab type type_tab.
Regards,
Amit
Reward all helpful replies.
2007 Mar 06 6:03 PM
As far as I know, specifying OCCURS 0 will allow the system to decide about the memory management of the internal table, instead of reserving memory space for a predefined number of entries like in case of, say, OCCURS 10.
By the way, the OCCURS parameter is considered to be obsolete in ABAP Objects, so it's probably better to use a different internal table declaration method everywhere such as ...TABLE OF...
2007 Mar 07 7:06 AM
hii
occurs 0 is an old way of defining internal tables,now we define a table type by using code
types: begin of struct,
fld1 type x,
fld2 type y,
fld3 type z,
...
end of struct.
data : itab type table of struct.
data : wa_tab type struct.
hence we get the itab and wa with the same structure,
now coming back to occurs 0,
in occurs zero system desides the no of lines of the itab dynamically if say you want to enter 10 records then after inserting every record it will increase the no of lines of itab by 1,instead of occurs zero you can also write occurs 5 or 10 or anything but if this case it will use up more memory.
example if you use occurs 10 then for an itab with 11 lines after entering the 10th line it will again add 10 blank rows to the itab, keeping 9 rows blank,
i guess now you are clear with itab declarations and OCCURS statement,
please reward point if useful.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |