ABAP-彈出對話方塊函式-'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION =
* TEXT_BUTTON_1 = 'Ja'(001)
* ICON_BUTTON_1 = ' '
* TEXT_BUTTON_2 = 'Nein'(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 =
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
我的例子:
DATA: WL_ANSWER TYPE C.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TEXT_QUESTION = TEXT-S07 "確定要刪除嗎?
ICON_BUTTON_1 = TEXT-S08 "是
ICON_BUTTON_2 = TEXT-S09 "否
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = 'X'
START_COLUMN = 25
START_ROW = 6
IMPORTING
ANSWER = WL_ANSWER
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
TEXT_QUESTION :它的功能就是寫入要顯示給使用者的資訊。
ICON_BUTTON_1 :按鈕上顯示資訊 返回值是1
ICON_BUTTON_2 :按鈕上顯示資訊 返回值是2
DEFAULT_BUTTON :呼叫函式後哪個按鈕被預設選中
DISPLAY_CANCEL_BUTTON :顯示取消的按鈕並可用
START_COLUMN ;TART_ROW :這兩個是一對的控制對話方塊在畫面上顯示的位置
ANSWER :這個很重要是存放你選擇哪個BUTTON返回值的,定義為一位的CHAR型就可以了,可以根據返回值進行操作