Application Development 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: 

Internal Table

Former Member
0 Kudos

Hello All,

Is there a limit on the amount of data what we can store in an internal table.

Like i wanted to store around 7lakhs of lines in an internal table, for which i wrote a select, and it is giving me an exception "TSV_TNEW_PAGE_ALLOC_FAILED"

Thanks to reply..

3 REPLIES 3

Former Member
0 Kudos

Hi,

The problem is that each session is alloted a certain amount of memory space. During your program runtime, this limit being exceeded. You need to take action to clean up any memory that is no longer being used. My suggestion would be to analye the program and if you any internal tables that are not being used any longer in the program, free up the memory by using the FREE statement.

refresh itab. Free itab.

(or)

What version of Kernel/OS version you have ? em/max_size_mb was only valid until 4.6D Kernel until patch 569 under Linux and AIX. It has since been replaced with em/total_size_mb .

This parameter should be bigger than em/initial_size_MB . You can put that to your total Physical RAM size.

Please check note 425207 regarding this.

Reward if helpful.

Regards,

Harini.S

Former Member
0 Kudos

Hi Neophyte,

The problem is that each session is alloted a certain amount of memory space. During your program runtime, this limit being exceeded. You need to take action to clean up any memory that is no longer being used. My suggestion would be to analye the program and if you any internal tables that are not being used any longer in the program, free up the memory by using the FREE statement.

refresh itab. Free itab.

In your program, check to see if there are any internal tables which have a lot of data in them at runtime, use the debugger, if there are any, and they are not being used in further processing, use the REFRESH and FREE statement after you don't need the data anymore(in the program). So for example, say that for some reason the program is getting data from a database table, a lot of data, into an internal table, and you loop this internal table and move data to another internal table, and that second internal table is the one that you will be using later in the program, the first is now useless, so as soon as you can, get rid of the data and free the memory.

  • Get data from database

select * into table itab from ztable.

  • Manipulate data and collect into itab2.

Loop at itab.

....

collect itab2.

endloop.

  • so now ITAB is no longer needed, clear it and free it.

refresh itab.

free itab.

The above is just an example, you need to analyze the program and see what can be cleared and freed and when this can happend. Then you simply add the two statements to the program at the right point.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.

Former Member
0 Kudos

hello neophyte,

there's no direct limitation of records for internal tables. but there are limitations set in your systems profile parameters, which limit the amount of memory a users session can consume.

pay special interest at the following parameters:

abap/heap_area_dia

In my system, this is limited to 2GB of memory. Once the users reaches this limit and the program still tries to get some more records in the internal table, this kind of dumpp can appear.

There are several ways to avoid it:

1. Avoid such big selections, using a more restictive selection-screen.

2. Try to limit the width of you internal table, by avoiding SELECT *, but rather specify a specific field list.

3. read and process your data in blocks. SELECT ... INTO TABLE itab PACKAGE SIZE 1000. ENDSELECT. With this statement your only reading 1000 records at once, that you can process within the SELECT ... ENDSELECT loop.

4.Tune your system's parameters. I would to this as last option.

One thing that you need to take care of in any case: Check if your applications free the consumed memory after usage. Use FREE itab, to release memory after usage.

Hope this helps you getting further.

regards

Sven