cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear a pop up screen text?

Former Member
0 Kudos

Hi All,

I have an ALV report and I have some pushbuttons. The user can select the output rows and click on one of these pushbuttons and a popup screen is called. The user is allowed to input some text and this text is written to the invoice. The problem I am having is that when I select a row the second time, the pop up box will appear on the screen with the previous text. How do I clear this screen. My code is something like call screen 100...

Before calling this screen the second(onwards) time..I want to refresh the screen..how do I do that?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Call the method SET_TEXT_AS_STREAM with a blank string as input or call another method DELETE_TEXT in PBO at the end of your subroutine INIT_TEXT_CONTROL.

text_control->DELETE_TEXT.

That should solve your problem.

Please mark helpful answers.

Regards,

Nagaraju Chidurupalli.

Message was edited by: Nagaraju Chidurupalli

Former Member
0 Kudos

Delete_text worked. Thanks a bunch

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Clear the text variable in the PBO of the pop up screen.

So next time when the screen is called, you would have the variables cleared.

Regards,

Tanveer.

Mark helpful answers.

Former Member
0 Kudos

It didnt work.

The following is the PBO code. They are using a method..within this method the pop up box will appear but with the previous text in it. I want to see a screen everytime empty.

MODULE status_0100 OUTPUT.

IF gv_text_required = 'Y'.

SET PF-STATUS 'ZSTATUS_REQ_TEXT'.

ELSE.

SET PF-STATUS 'ZSTATUS_NO_REQ_TEXT'.

ENDIF.

MOVE gv_text TO gv_textcaps.

TRANSLATE gv_textcaps TO UPPER CASE.

IF gv_textcaps CS 'REJECT'.

SET TITLEBAR 'REJECTIONREASON'.

ELSEIF gv_textcaps CS 'DISPUT'.

SET TITLEBAR 'DISPUTEREASON'.

ELSEIF gv_textcaps CS 'FORWARD'.

SET TITLEBAR 'FORWARDREASON'.

ELSEIF gv_textcaps CS 'APPROVE'.

SET TITLEBAR 'APPROVEREASON'.

ELSEIF gv_textcaps CS 'REVIEW'.

SET TITLEBAR 'REVIEWREASON'.

ELSE.

SET TITLEBAR 'GENERICREASON'.

ENDIF.

PERFORM init_text_control.

CALL METHOD text_control->set_readonly_mode

EXPORTING

readonly_mode = '0'.

CLEAR gt_txt_tbl. REFRESH gt_txt_tbl.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Form init_text_control

&----


  • text

----


FORM init_text_control.

IF text_control_cont IS INITIAL.

CREATE OBJECT text_control_cont

EXPORTING container_name = 'GT_TXT_TBL'.

ENDIF.

IF text_control IS INITIAL.

CREATE OBJECT text_control

EXPORTING parent = text_control_cont

wordwrap_mode = '1'

wordwrap_to_linebreak_mode = '0'.

CALL METHOD text_control->set_statusbar_mode

EXPORTING

statusbar_mode = '0'.

CALL METHOD text_control->set_toolbar_mode

EXPORTING

toolbar_mode = '0'.

ENDIF.

ENDFORM. " INIT_TEXT_CONTROL

THE FOLL is the PAI code

MODULE user_command_0100 INPUT.

CASE ok_code.

REFRESH gt_txt_tbl.

WHEN 'ENTR'.

PERFORM write_text_to_variable.

LEAVE TO SCREEN 0.

WHEN 'CANC'.

REFRESH gt_txt_tbl.

LEAVE TO SCREEN 0.

WHEN OTHERS.

REFRESH gt_txt_tbl.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form write_text_to_variable

&----


  • text

----


FORM write_text_to_variable.

CALL METHOD text_control->get_text_as_stream

IMPORTING

text = gt_txt_tbl.

ENDFORM. " write_text_to_variable

suresh_datti
Active Contributor
0 Kudos

try this..

Put the following two lines before the statement IF text_control_cont IS INITIAL in the FORM init_text_control.

FREE OBJECT text_control_cont.

FREE OBJECT text_control.

Regards,

Suresh Datti

Former Member
0 Kudos

The objects are defines as follows

DATA text_control_cont TYPE REF TO cl_gui_custom_container.

DATA text_control TYPE REF TO cl_gui_textedit.

When I put

FREE OBJECT text_control_cont.

FREE OBJECT text_control.

I am getting an error 'text_control_cont' cannot be a table, a reference, a string, or

Former Member
0 Kudos

Hi,

Clear the text variable used in the Screen before calling the screen.

Hope this helps.

Regards,

Nagaraju Chidurupalli.

Former Member
0 Kudos

Hi Rachana,

just try using

<b> FREE MEMORY.</b>

before the call screen.. it might work

regards

satesh

Former Member
0 Kudos

Are you using a text editor (CREATE_TEXT) in your popup screen? If yes, you might need to call a new CREATE_TEXT each time the popup is called (check whether its for the same line or different one).

If its a text box, wouldnt a CLEAR statement suffice? Again, you would need to check that the selected line is different from the one selected earlier.

Sudha