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

Programatically increase the size of internal table?

Former Member
0 Likes
3,498

Hi ABAPers,

I wish to know, how to increase the size of my internal table programatically? I mean, when i run my report, my report should enlarge the space required for my internal table and when the report ends, the memory allocation for the internal table would be set back to default value.

Is this programatically possible?

Regards,

Sonu.

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,312

Hi,

You can set an initial value that too statically not at runtime.

BUt why do you want to set the size programatically.

Since Internal tables are somethign whihc will be assigned memory based on the need at runtime, why do you want to do the job o the runtime yourself.

Regards,

Sesh

16 REPLIES 16
Read only

varma_narayana
Active Contributor
0 Likes
2,312

Hi..

We cannot increase the Memory of internal table Programmatically (Dynamically)

Based on the INITIAL SIZE addition the system allocates the memory.

We can use FREE <itab> to deallocate the memory.

regards.

Read only

Former Member
0 Likes
2,312

Hi

It is the basic property of the internal tables to increase in size during run time depending upon the data coming in to it.

So always declare them like OCCURS 0, instead of some fixed value like OCCURS 100 or OCCURS 10, so that depending on the data it will go on increase without the propermammer bothering for the memory.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

0 Likes
2,312

Hi Anji,

This is the scenario. I am calling an ABAP function module in my report in a loop. After some 500 entries, it dumps. The entry for which it dumps, when i try to pass it individually to the Function Module, it works fine. Before every call to my the Function Module, i have used FREE memory and FREE ITAB statements too.

Can anyone help me in this :(.

Regards,

Sonu.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,313

Hi,

You can set an initial value that too statically not at runtime.

BUt why do you want to set the size programatically.

Since Internal tables are somethign whihc will be assigned memory based on the need at runtime, why do you want to do the job o the runtime yourself.

Regards,

Sesh

Read only

0 Likes
2,312

Hi Sesh,

Actually my internal table has reached its limits and when i try to append more entries, it dumps saying:-

"The current program had to be terminated because of an

error when installing the R/3 System.The program had already requested

723080128 bytes from the operating system with 'malloc' when the operating

system reported after a further memory request that there was no more memory

space available".

Hence i wish to add more memory to just this internal table. Any idea how to do this?

Regards,

Sonu.

Read only

0 Likes
2,312

That is a BASIS level setting. Contact your basis in this regard.

Regards,

Ravi

Read only

0 Likes
2,312

Hi Sonu,

This stack dump is the result of some select statment population a huge amount of data or for some other operation. Just check all the select statement populating the same as there can be some reason.

Check the use of the where clause and try to reduce the amount of data transfer small.

Thanks,

Samantak.

Rewards points for useful answers.

Read only

0 Likes
2,312

Hi,

Looks like you are running out of memory during run time. Contact your BASIS and check the memory settings of the System and the application server.

If possible ask him to increase is it.

Regards,

Sesh

Read only

0 Likes
2,312

Hi Ravi,

I undestand its a BASIS level setting, do you have an idea of which SYSTEM PARAMETER needs to be changed to incorporate more space to my internal

tables?

regards,

Sonu.

Read only

0 Likes
2,312

Hi Sesh,

Hopefully i could, but the problem is that i have deployed my report on customer's system and his BASIS Admin is not available due to the time diff., i tried to incorporate all the performance measures like Free Memory, Free Itab and everything but still could not eliminate this error.

I know this is happening because of the memory overflow. But why is it that the function module dumps when i call it in loop after some 500 entries. When i call the function module alone only with the entry it dumped at, it works fine?

Regards,

Sonu.

Read only

0 Likes
2,312

Hi sonu,

1. Apart from the basis setting, its also dependent upon

the physical configuration.

ie. how much space is available in hard disk, how much space

is available in memory of server (at that time)

2. If our program takes so much space,

then there is no guarantee that in future, (after doing proper basis settings),

it may not require more space.

Hence, the same error may come again in near future.

3. So it is best to change the architecture of the program,

so that data is fetched / displayed in bunches.

regards,

amit m.

Read only

0 Likes
2,312

Hi Amit,

I wish i could change the architecture, but since the function module am using is SAP function module and its a huge one with thousands of subrouutines and complex structures, hence i can't :(.

Anyways thanks a lot fot the help.

Regards,

Sonu.

Read only

Former Member
0 Likes
2,312

Hi Sonu,

Generally Internal Table operations are handled automatically. For example if you have allocated some space for the internal table statically and at runtime the demand increases then the machine automatically allocates that space. But you can also programmatically allocate the same.

After you have completed all the operation with internal table you want to deallocate the same. This can also be done using the command Free itab.

So you can free the internal table from the memory allocation.

FREE ITAB.

Thanks,

Samantak.

Rewards points for useful answers.

Read only

Former Member
0 Likes
2,312

hi,

depending on your requirement use OCCURS with N -> species who much memory shuld be allocated for that particular internal table as

OCCURS 0 -> default memory.

OCCURS 10 -> same as occurs 0 but after filling first record 10 more reord space memory is allocated dynamically.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Former Member
0 Likes
2,312

Hi,

when ever u declare an internal table declare it as occurs 0.

and it occupies a 5K of memory.

if the total number of records size exceeds the size of internal table

it allocates another 5k of memory. so i think there is no need of changing size of internal table.

Thanks

Srinivas

Read only

Former Member
0 Likes
2,312

Hi,

Since the internal table is an dynamic object,the size of an internal table increases dynamically no matter whatever the size u have specified during declaration of an internal table.

The memory of internal table increases in blocks when memory available is less.

Thanks & Regards

Santhosh