欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ABAP 中设置弹窗

程序员文章站 2022-05-30 23:41:30
...

ABAP 在删除或者保存时,常需要弹窗确认

FUNCTION:  POPUP_TO_CONFIRM

ABAP 中设置弹窗

2.在函数中按需要 设置button_1 ,button_2 ,以及弹窗内容 TITLEBAR,根据返回值写后面逻辑

 

FORM CHECK_SAVE .
  DATA lv_ANSWER   TYPE c. "接收返回值
  data len TYPE i VALUE '3' .

  CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
*     TITLEBAR                    = ' '
*     DIAGNOSE_OBJECT             = ' '
      TEXT_QUESTION               = 'this is popup' && len
     TEXT_BUTTON_1               = 'sure'(001)
*     ICON_BUTTON_1               = ' '
     TEXT_BUTTON_2               = 'cancel'(002)
*     ICON_BUTTON_2               = ' '
*     DEFAULT_BUTTON              = '1'
*     DISPLAY_CANCEL_BUTTON       = 'X'
*     USERDEFINED_F1_HELP         = ' '
*     START_COLUMN                = 25
*     START_ROW                   = 6
*     POPUP_TYPE                  =
*     IV_QUICKINFO_BUTTON_1       = ' '
*     IV_QUICKINFO_BUTTON_2       = ' '
   IMPORTING
     ANSWER                      = lv_ANSWER  " 1:btn1 2:btn2 A: 点叉号和取消
*   TABLES
*     PARAMETER                   =
*   EXCEPTIONS
*     TEXT_NOT_FOUND              = 1
*     OTHERS                      = 2
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

ENDFORM.

 

相关标签: ABAP