Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TYPE STANDARD TABLE OF

Former Member
0 Likes
2,405

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,224

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.

?

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.

?

6 REPLIES 6
Read only

Former Member
0 Likes
1,224

yaa ur correct..

occurs 0 gives the static memory (8kb genearally).....and type standard table get the memory dynamically

Read only

Former Member
0 Likes
1,224

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

Read only

Former Member
0 Likes
1,224

hi,

Yes you are right !!!!

Regards,

Santosh

Read only

Former Member
0 Likes
1,225

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.

?

Read only

0 Likes
1,224

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.

Read only

0 Likes
1,224

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.