Releasing Memory for Large Internal Table

Generally CLEAR or REFRESH statement is used to release the allocated memory for internal tables. Now think of a situation where an internal table initially contains a huge volume of records so as the huge allocated memory. Now you deleted [ DELETE statement doesn’t release memory as CLEAR or REFRESH statement does ]  most of the records from the internal table as per needed but what about the large allocated memory to the table.

In such a case below process can be used for efficient use of memory.


Lets execute the below report with break point set up to analyse the memory.


Execute the select statement and in the debugger select the ‘Memory Analysis’ tab and put LT1 and LT2. Observe the allocated memory for LT1 table.


Now execute the delete statement which deletes most of the records form table LT1. Now still the allocated memory for the table is not decreased.


Now execute the APPEND LINES OF LT1 TO LT1. statement. And observe the allocated memory for the table LT2 which is much more less than the allocated memory of the table LT1.


Now we can refresh the table  LT1 and assign back the records of LT2 to LT1 and continue.






One comment

  1. Hi,I check your blog named “Releasing Memory for Large Internal Table – SAPCODES” on a regular basis.Your story-telling style is witty, keep up the good work! And you can look our website about free proxy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s