2008 Jun 30 8:55 AM
When we define an internal table like
DATA itab TYPE STANDARD TABLE OF T001.we create an internal table without a heading record, with the same exact structure of T001. What about the size of the table ?
If you define an internal table using OCCURS, which seems to be outdated, you explicitly define the table's size.
Am I right to think, then, that with TYPE STANDARD TABLE OF the table's size is allocated dynamically ?
Thanks
Avraham
2008 Jun 30 8:59 AM
How do we anticipate the performance of our program, when we don't know the table's size ? It seems in my company they don't define tables using the OCCURS. The book I'm reading emphasized that it's crucial that one does pay attention to the size his internal tables have for performance reasons.
?
When we define an internal table like
DATA itab TYPE STANDARD TABLE OF T001.we create an internal table without a heading record, with the same exact structure of T001. What about the size of the table ?
If you define an internal table using OCCURS, which seems to be outdated, you explicitly define the table's size.
Am I right to think, then, that with TYPE STANDARD TABLE OF the table's size is allocated dynamically ?
Thanks
Avraham
2008 Jun 30 8:57 AM
yaa ur correct..
occurs 0 gives the static memory (8kb genearally).....and type standard table get the memory dynamically
2008 Jun 30 8:58 AM
Contrary to your understanding, all the internal table memory allocation is done dynamically only.
There is no restriction on memory allocation on an internal table at the compile time.
The table expansa as you add new records until it reaches a very big number defined by your basis parameters.
Regards,
Ravi
2008 Jun 30 8:59 AM
2008 Jun 30 8:59 AM
How do we anticipate the performance of our program, when we don't know the table's size ? It seems in my company they don't define tables using the OCCURS. The book I'm reading emphasized that it's crucial that one does pay attention to the size his internal tables have for performance reasons.
?
2008 Jul 01 11:38 AM
you can use
I_TAB TYPE STANDARD TABLE OF X_TAB INITIAL SIZE 0,
the 'INITIAL SIZE 0' will not allocate any space until it gets populated.
and thus it can improve your performance
if it doesn't get populated then no memory will be occupied and so it will improve performance.
do one more thin free the the internal table when it is no more needed, it will also improve performance as available memory gets increased.
2008 Jul 01 12:00 PM
Hi Avraham,
Let me explain in clear context.
When u define ur itab with OCCURS 0 it will allocate 8kb memory for this table irrespective of table size(i.e width ).
When u define ur itab with OCCURS 2 it will allocate memory for 2 rows for this table.
If the size exceeds 8kb in case1 it will again allocate 8kb. in case2 it will allocate for 2 more rows.
Now the question is where does the performance affects????
Assume u defined ur itab with OCCURS 0. So 8kb is allocated.
Now assume each record of ur itab took 1kb. So after getting 8 records into itab again 8kb is allocated. Now if u have total of 10 records then 6kb is wasted(8+8-10 = 6). So u r taking the memory and not using it. Instead u might use it for some other process which is waiting for this memory to be released.
In case of TYPE STANDARD TABLE OF memory will be allocated dynamically for each record. So no wastage of memory.
Hope it is clear now.
Thanks,
Vinod.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |