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

FREE itab.

Former Member
0 Likes
1,680

Hi every body,

I did a program which user nearly 10 itabs.

Is it necessary to use

<b>FREE ITAB.</b>

for all of these itabs.

what is the actual advantange of using this?

IF not what wud happen any performance decline?

At what time can i apply this statement?

IF i use this statement as a last statement it wud be better?

this is a kind of performance issue , Plz help me...

<b>your help appreciated.</b>

RAJA.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,643

Hi Andreas,

PLZ <b>answer</b> to the following.

So that <b>i will be pretty clear</b>.

what is the actual advantange of using this?

IF not what wud happen any performance decline?

At what time can i apply this statement?

IF i use this statement as a last statement it wud be better?

Hi every body,

I did a program which user nearly 10 itabs.

Is it necessary to use

<b>FREE ITAB.</b>

for all of these itabs.

what is the actual advantange of using this?

IF not what wud happen any performance decline?

At what time can i apply this statement?

IF i use this statement as a last statement it wud be better?

this is a kind of performance issue , Plz help me...

<b>your help appreciated.</b>

RAJA.

11 REPLIES 11
Read only

Former Member
0 Likes
1,643

hi,

Free ITab, delete the internal table from the memory itself, mostly its not needed

Use Refresh Itab

Clear Itab.

that is enough even you have any no of internal table

cheers,

sasi

Read only

Former Member
0 Likes
1,643

Hi Raja,

Please take a look at this page for the usage:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb384e358411d1829f0000e829fbfe/content.htm

Regards,

Ville

Read only

Former Member
0 Likes
1,643

Hi sasikumar,

thanks for ur reply.

it wud be good once u go thru my message and clear all my doubts.

see....

after usage of itabs ..if they contain lot of data..?

is it necessary to free itab.

clear itab won't clears it from memory know?

Read only

0 Likes
1,643

Hi Raja,

clear itab will initialize your internal table.

free itab will release the memory.

Regards,

Ville

Read only

0 Likes
1,643

hi,

clear itab - clears only header line

refresh itab- clears body of the internal table

Free itab - clears a internal table from memory

Refresh itab and clear itab is enough i guess

the below points are provided by sap

You can use FREE to initialize an internal table and release its memory space without first using the REFRESH or CLEAR statement. Like REFRESH, FREE works on the table body, not on the table work area. After a FREE statement, you can address the internal table again. It still occupies the amount of memory required for its header (currently 256 bytes). When you refill the table, the system has to allocate new memory space to the lines.

Read only

andreas_mann3
Active Contributor
0 Likes
1,643

Hi Raja,

one example is , you've a big itab and move it to another tab to collect or extract it.

When filling of 2nd tab is finished , you can free 1st itab to improve performance.

regards Andreas

Read only

Former Member
0 Likes
1,644

Hi Andreas,

PLZ <b>answer</b> to the following.

So that <b>i will be pretty clear</b>.

what is the actual advantange of using this?

IF not what wud happen any performance decline?

At what time can i apply this statement?

IF i use this statement as a last statement it wud be better?

Read only

0 Likes
1,643

when u talk of the performance issue, the performance of the program as such will not be affected. Only thing is that if you free the memory allocated to this internal table, the memory could be allocated to another program or another data object in the same program.

normally the memory used by a program is freed automatically as soon as the program finishes execution so use it if you want to handle memory management on your own.

it is normally a gud practice to clear tables and data variables (and free the memory) once the program has to be exited. so as you say, it should be done at the end of the program execution.

rgds,

PJ

Read only

0 Likes
1,643

> Hi Andreas,

> PLZ <b>answer</b> to the following.

> So that <b>i will be pretty clear</b>.

>

> what is the actual advantange of using this?

This will free up system memory. The advantage of doing this is that less system memory is used unnecessarily. Generally speaking, if you refresh your table when you no longer need it, it will usually suffice.

> IF not what wud happen any performance decline?

Not really unless you are running a very very big program that loops through large tables.

> At what time can i apply this statement?

apply the FREE statement whenever you are done with the table. See my earlier post about declaring a local internal table. I believe this is the best way to utilise memory resources

> IF i use this statement as a last statement it wud be

> better?

if you called the FREE statement at the very end of the program you will gain no increase in performance as the system is already finished all it's processing and is about the exit the program (and thus FREE the internal tables)!

Hope this answers your questions.

Cheers,

Pat.

Read only

former_member221770
Contributor
0 Likes
1,643

Raja,

Just to throw in my $0.02...

As everyone here is saying, FREE ITAB will release the memory the table is holding.

REFRESH ITAB will clear up the ocntents but the table definition is still in memory.

CLEAR ITAB will only clear the header line of the internal table. CLEAR ITAB[] does the same thing as REFRESH ITAB.

Technically, it is better practice to use the FREE ITAB command whenever possible as it will maximise system resources.

One way to do this automatically is to declare local internal tables. To do this simply define your internal table within the subroutine. When the progam jumps out of the subroutine, the internal table is automatically freed.

Hope this helps.

Cheers,

Pat.

PS. Kindly assign Reward Points to the posts you find helpful.

Read only

Former Member
0 Likes
1,643

Patrick,

Thank u very much for your patience and kindful answers.

I rewarded your help which is eqivalent to 0.02$...

Just joking.

Thank u very much once again.