简体   繁体   中英

How to close a modal popup window when pressing the escape key

I have an ABAP Z-report which shows a modal popup window(screen). Is it possible to close it when user presses an escape key?

I'm showing the popup using the next screen call

call screen 0100 STARTING AT 10 10 ENDING AT 110 30.

The screen has the next PAI module:

MODULE USER_COMMAND_0100 INPUT.

  clear gv_ok.

  case sy-ucomm.

      when 'BTN_OK'.
          gv_ok = 'X'.    
          LEAVE TO SCREEN 0.

    when 'BTN_CANC'.
      perform clean.
      LEAVE TO SCREEN 0.
  endcase.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

But the PAI module is not called whe the user presses an escape key.

The flow logic section is

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.
  module exit at exit-command.

Nothing from PAI modules is called while Esc key is being pressed.

Here is what you have to check in the GUI status:

GUI状态

The escape key is assigned automatically to this, you only need to assign the command (BUT_CANC, it is ZCANC in my example).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM