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: 

POPUP_TO_CONFIRM + close popup window after selection

steffen_brauner
Explorer

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

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member

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.

0 Kudos

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)

0 Kudos

Hi Steffen, I have the same problem, did you solve it?

Former Member
0 Kudos

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.