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

How do you remove an object

Former Member
0 Likes
2,300

I have some code:

CREATE OBJECT manager

EXPORTING

is_object = obj

ip_no_commit = 'R'

EXCEPTIONS OTHERS = 1.

but when you leave the screen the object stays on the screen. Is there a way to delete the object int he program?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,725

It is not possible to delete the object that you created for a class. The object is valid with in the internal session.

Destructor method is not available for external use. You may use a method just to clear off variables that you use in the class. Call the method before exiting the screen, this will clear all variables.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,725

Sure..

clear manager.
free manager.

Where "manager" is your object reference.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,726

It is not possible to delete the object that you created for a class. The object is valid with in the internal session.

Destructor method is not available for external use. You may use a method just to clear off variables that you use in the class. Call the method before exiting the screen, this will clear all variables.

Read only

Former Member
0 Likes
1,725

I just managed to figure it out.

CALL METHOD manager->unpublish.

Read only

0 Likes
1,725

Hi David,

im having the same problem

i create a dinamic ALV, with the following class.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT g_grid

EXPORTING i_parent = g_custom_container.

when i exit the screen and try to create a new one, the programs shows the same as before,

i try clear, and free, but is not working, I also triyed

CALL METHOD g_containrer->unpublish.

=(