07-11-2007 11:15 AM
hi
can u plz tell me about occur clause.i want that when i mention occurs 2 in internal table it should only show 2 records and should not increase dynamically.
i don't want to increase the size of the memory dynamically.
07-11-2007 1:24 PM
hi,
occurs 2 means when ever memory given to itab is same when use occurs 1 or 2 or .......
but it differs when after filling the initial record based on the value which user gives for ex:
occurs 2 means two more record space is allocated automatically and after fillling that two records then two more record space is allocated to internal table automatically. like this its goes on..........
if helpful reward some points.
with regards,
Suresh.A
07-11-2007 11:20 AM
Hi,
You cannot limit the size of the internal table using the "OCCUR" clause. this Occur is used in order to define the memory that the internal table should reserve at the start. and whenever the memory is getting scarce, the same amount of memory for the number mentioned inthe occur clause shall get reallocated to the internal table.
Occur clause is used in order to optimise the memory management.
<b>Reward points if this info helps,</b>
Kiran
07-11-2007 11:24 AM
thanks kiran,
but plz can u tell me that suppose i have allocated memmory as 2 and i want only 2 records is it possible i want that it shot not increase dynamically...otherwise i have another option by using package size..but first i want to try with occurs clause i want that what ever i have mentioned should not increase dynamically
07-11-2007 11:21 AM
When u use occurs 2..
then in memory for two records, space is reserved..
but it doesn't mean that u can not store more than 2 records..
as u'll append more records, in memory space will be taken by those extra records...
If u don't append more than 2 records, then size of memory reserved will not increase..
so u need not to worry...
Reward if useful..
regards
Prax.
07-11-2007 11:21 AM
Hi,
If that is the case, then build following logic.
Loop at itab.
if sy-tabix GT 2.
delete itab.
endif.
endloop.
Best regards,
Prashant
07-11-2007 11:24 AM
hi
u cannot restrict the size of the internal table using occurs.
after storing 2 records then it will allocate memory for 2 more records.
use some logic to control it.
reward if useful
07-11-2007 1:24 PM
hi,
occurs 2 means when ever memory given to itab is same when use occurs 1 or 2 or .......
but it differs when after filling the initial record based on the value which user gives for ex:
occurs 2 means two more record space is allocated automatically and after fillling that two records then two more record space is allocated to internal table automatically. like this its goes on..........
if helpful reward some points.
with regards,
Suresh.A