03-23-2009 6:58 AM
Hi,
my report uses the FM POPUP_TO_CONFIRM with a YES/NO option. The popup window should be closed when the user has choosen YES/NO. How can I close the popup window?
Steffen
03-23-2009 7:03 AM
HI,
The Pop-Up will closed as user click's any of the button displayed to the Pop-up. It is the default functionality of the Pop-Up.
You no need to do anything to handle this.
03-23-2009 7:05 AM
Hi Steff,
Try this way,
data:
w_string type string,
w_flag type c.
call function 'POPUP_TO_CONFIRM'
exporting
text_question = w_string
display_cancel_button = ' '
importing
answer = w_flag
exceptions
text_not_found = 1
others = 2.
if sy-subrc = 0.
if w_flag = '1'
or w_flag = '2'.
stop.
endif.
endif.
Regards,
Swapna.
03-23-2009 7:11 AM
Hi Steff,
When you use POPUP_TO_CONFIRM and select any option YES/NO.
It automatically sets the value of sy-ucomm according to the option selected and the popup automatically gets closed.
You need not to do any external coding for that.
Regards,
Nitin.
03-23-2009 7:49 AM
Hi,
to exemplify my problem I show you a shortcut of my coding:
REPORT ztest.
DATA: counter(2) TYPE n,
h_text type string,
answer(1) TYPE c.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Export'
text_question = 'popup text'
text_button_1 = 'YES'
text_button_2 = 'NO'
default_button = '1'
display_cancel_button = 'X'
start_column = 25
start_row = 6
IMPORTING
answer = answer.
DO 10 TIMES.
counter = sy-index.
CONCATENATE 'Counter:' counter '<<<<' INTO h_text SEPARATED BY space.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = h_text.
WAIT UP TO 1 SECONDS.
ENDDO.
My problem is that the popup is still visible during the processing of DO...ENDDO. This window should be closed right after the click on YES/NO (before processing of DO...ENDDO starts)
10-12-2022 4:13 PM
03-23-2009 12:41 PM
When '2'.
leave screen.
or u can use
FM : POPUP_CONTINUE_YES_NO
or
DATA:l_answer TYPE c .
CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'
EXPORTING
DEFAULTOPTION = '1'
diagnosetext1 = 'Caution'
textline1 = 'Enter YES or NO ! '
text_option1 = 'YES'
text_option2 = 'NO'
titel = 'Caution'
IMPORTING
answer = l_answer
.
IF l_answer EQ '1' .
Refers to YES
ELSE .
Refers to NO
ENDIF.