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: 

Issue with custom container destructor.

Former Member
0 Kudos

Hi Friends,

I have created a module pool program, which has a custom container and I have set up NOTES in this container.

Now, everytime I Press the back button after saving the transaction, I have the destructor code written.

the code is


  IF text_editor IS NOT INITIAL.
    CALL METHOD text_editor->free( ).
    FREE text_editor.
  ENDIF.

  IF editor_container IS NOT INITIAL.
    CALL METHOD editor_container->free( ).
    FREE editor_container.
  ENDIF.

* finally flush
  CALL METHOD cl_gui_cfw=>flush
    EXCEPTIONS
      OTHERS = 1.

But, in the same session , when i enter a different transaction number and come on the Notes screen, I see the

data of the previous transaction in notes. I have checked everything. It seems he issue is with the destructor.

Please advice.

Thanks,

sapper

Edited by: Neil Gardiner on Dec 8, 2010 9:17 AM

1 ACCEPTED SOLUTION

venkat_o
Active Contributor
0 Kudos

Hi,

Along with below code

IF text_editor IS NOT INITIAL.
    CALL METHOD text_editor->free( ).
    FREE text_editor.
  ENDIF.

Use one extra statement which i used in the below code.

IF text_editor IS NOT INITIAL.
    CALL METHOD text_editor->free( ).
    FREE text_editor.
    CALL METHOD text_editor->delete_text( ).
  ENDIF.

Regards,

Venkat.O

4 REPLIES 4

venkat_o
Active Contributor
0 Kudos

Hi,

Along with below code

IF text_editor IS NOT INITIAL.
    CALL METHOD text_editor->free( ).
    FREE text_editor.
  ENDIF.

Use one extra statement which i used in the below code.

IF text_editor IS NOT INITIAL.
    CALL METHOD text_editor->free( ).
    FREE text_editor.
    CALL METHOD text_editor->delete_text( ).
  ENDIF.

Regards,

Venkat.O

Former Member
0 Kudos

I had tried that ... but still the same issue ...

0 Kudos

If all you want to do is simply clear the text then all you need to do is call the delete_text method. There is no need to call the desctrutor or flush methods.

Clemenss
Active Contributor
0 Kudos

Hi d sappanese,

just make sure hat you do not fill it inadvertently with the same text as before: Make sure the old text is cleared in your program.

Regards,

Clemens