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

Internal table memory

Former Member
0 Likes
3,150

Hi,

Can any one say how to identify,how much memory is associated with the internal table which we are using in our prog.

1 ACCEPTED SOLUTION
Read only

former_member189629
Active Contributor
0 Likes
1,998

Prince,

This will depend on ur itab declaration...

Occurs 0 means a internal table will be allocated 8kb of memory initially.if it needs more then again 8 kb of is allocated to it

in case of occurs 5, SAP allocates 5 units of memory for itab initially and if the number of records fetched more in number at run time then itab memory will be increased depends up on the amount of data record/ size of the record.

Reward if helpful,

Karthik

7 REPLIES 7
Read only

former_member189629
Active Contributor
0 Likes
1,999

Prince,

This will depend on ur itab declaration...

Occurs 0 means a internal table will be allocated 8kb of memory initially.if it needs more then again 8 kb of is allocated to it

in case of occurs 5, SAP allocates 5 units of memory for itab initially and if the number of records fetched more in number at run time then itab memory will be increased depends up on the amount of data record/ size of the record.

Reward if helpful,

Karthik

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,998

DESCRIBE TABLE ITAB OCCURS N

N GIVES THE MEMORY

Read only

Former Member
0 Likes
1,998

Hi Prince

occurs 0, the memory allocation is done by system,

in case of occurs 100 memory of 100 records allocated initially ,then if records exceeds then system ll allocate memory,

memory allocation here is known as extent and depend upon basis administrator...

You can use the above addition to reserve memory space for <n> table lines when you declare the table object.

When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated.

You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The space occupied, depending on the line width, is 16 <= <n> <= 100.

It only makes sense to specify a concrete value of <n> if you can specify a precise number of table entries when you create the table and need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for deep-structured internal tables where the inner table only has a few entries (less than 5, for example).

To avoid excessive requests for memory, large values of <n> are treated as follows: The largest possible value of <n> is 8KB divided by the length of the line. If you specify a larger value of <n>, the system calculates a new value so that n times the line width is around 12KB."

OCCURS 0 is betten than OCCURS 100 because

OCCURS 100.

*****************

if you use occurs 100, the ABAP memory will allocate for 100 records memory location, some time you have only 20 records at that time the remaining 80 records memory space will waste.

REAL TIME EXAMPLE: BUS

***************************

In bus total seat is 57, some time only 20 people only will come at that time also bus should go so remaining seats will waste.

OCCURS 0:

**************

OCCURS 0, the memory is not allocated previously, that is optimistic.if you have 20 records the memory will take for only 20 records.

****************

1. when can we use occurs0?

When declaring internal tables,

whose expected number of records we are not sure,

or we are not bothered.

Its normally better to use occurs 0,

rather than occur 10 , 100 , 90 etc.

2. if we use occurs 0 how will the memory be allocated?

a. if we use 0, 10 , or any other figure,

there is no restriction on the expansion of the internal table.

the 0, 10, etc is just a indicative figure for expected number of records.

b. When using 0,

8 KB - the internal table will be expanded in bunches of 8 KB.

Reward if helpful.

Thanks

Read only

Former Member
0 Likes
1,998

Hi,

Thanks for responding, but what i want to know that how much memory is occupied by internal table through <b>Debugging mode</b>.Is there any option in debugging mode to know the memory occupied by internal table.

Read only

Former Member
0 Likes
1,998

Hi

chk this <<http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm>>

<b>Reward if usefull</b>

Read only

Former Member
0 Likes
1,998

Hi,

Thanks for replaying to my query,actualy what i was looking for is to know the meomary area occupied by internal table in debugging mode.

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,998

hi Prince,

I think is is simple:

number of lines in the internal table multiplied by the length of on line (in byte).

ec