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: 

Using cl_gui_textedit, text blocks always display prior document.

Former Member
0 Kudos

We have two containers and we're using two instances of cl_gui_textedit.

On the first call to the text screen, we see the two texts that we should see.

The user saves the data and backs out to the selection screen, which contains an ALV display of documents.

The user selects the next document to process. During initialization, we attempt the FREE destructor but it does not destroy the text editor ref to cl_gui_textedit. We can initialize with clear and free as ABAP statement. Upon entry to the PBO, we can see that we have forcibly cleared the ref to cl_gui_textedit. It's 0: INITIAL for both text editors. We watch the table being built and the internal tables contain the correct text. After our set read_only true or false, we get a beep, and then arrive at our text screen without any error message.

What is on the screen at that point will be the texts from the prior document. We've tried inserting lifetime parameters for our custom container. We've tried CALL METHOD cl_gui_cfw=>flush (which appears to always be necessary in PAI when we get the unprotected portion and the indices, etc.). Neither of these alter the behavior of the screen and the erroneous content of the text editor blocks.

Question: is there a method or something that anyone can suggest to "force" the text blocks to contain the data that was in the table, rather than the data that was in the table for the prior transaction?

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Did you try calling the method DELETE_TEXT of the CL_GUI_TEXTEDIT before setting up the next text.

This is how I get rid of the existing text:


* Delete the Text
  me->o_editor->delete_text( ).

* Set the new text
  me->o_editor->set_textstream( EXPORTING text = iv_text ).

Regards,

Naimesh Patel

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

Did you try calling the method DELETE_TEXT of the CL_GUI_TEXTEDIT before setting up the next text.

This is how I get rid of the existing text:


* Delete the Text
  me->o_editor->delete_text( ).

* Set the new text
  me->o_editor->set_textstream( EXPORTING text = iv_text ).

Regards,

Naimesh Patel