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

I WANT MY PROGRAM TO EVALUATE OTHER PROGRAMS - HELP!

Former Member
0 Likes
1,028

i want to detect if the program evaluated has FREE'd all its internal table after use. but i just can't search for the word 'FREE itab' because there might be some subroutines in that program that can fill the internal table again. and subroutines are not arranged according to execution.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
999

This cant be achieved programmatically.

i want to detect if the program evaluated has FREE'd all its internal table after use. but i just can't search for the word 'FREE itab' because there might be some subroutines in that program that can fill the internal table again. and subroutines are not arranged according to execution.

8 REPLIES 8
Read only

Former Member
0 Likes
999

Hi,

Usually REFRESH is used to clear contents of Internal table & FREE is used to release the memory id.

Please search for REFRESH.

Best regards,

Prashant

Read only

0 Likes
999

Ok. i can search for the word REFRESH. but what if somewhere after the REFRESH code, the table was filled up again in a PERFORM statement(subroutine).this subroutine can be placed anywhere in the program right? how can i detect at the end of the program that the internal table is really initial?

Read only

0 Likes
999

Sorry, i am not having problems with clearing or freeing i_tabs. My problem is how can i detect the codes of another program if his internal tables are cleared or freed at the end of his program.

Read only

0 Likes
999

It's because this can happen:

Form f_fill_itab.

Select belnr

from bsad

into i_tab.....

Endform

Refresh i_tab.

Perform f_fill_itab.

Even though there is a REFRESH statement, the i_tab can still be filled up

Read only

Nimesh_S_Patel
Explorer
0 Likes
999

Hi Rico,

The FREE statement has the same effect as the CLEAR statement for any data objects except internal tables.

For internal tables, FREE has the same effect as the REFRESH statement, though the entire memory area occupied by the table rows is released, and the initial memory area remains unoccupied. If dobj is a structure with table-like components, the memory of each table-like component is released.

Regards

Nimesh S. Patel

Read only

Former Member
0 Likes
999

Hi,

If the internal tables used are without Header Line then CLEAR ITAB would do the same work as that of Refresh Itab.

Search for Clear as well.

Regards,

Lalit

Read only

Former Member
0 Likes
999

Well, in that case if its a Z program, then i would recommend to validate the same at the end of program.


if not itab[] is initial.
write :/ 'Internal table is not empty !' .
else.
write :/ 'Internal table is empty !'.
endif.

Read only

Former Member
0 Likes
1,000

This cant be achieved programmatically.