但實際使用 PUSHBUTTON 後,會發現按下按鈕後,只會執行 AT SELECTION-SCREEN. 無法再進入 START-OF-SELECTION,如下圖,按執行的 ICON 才會進入 START-OF-SELECTION,但只按 PUSHBUTTON 並不會進入 START-OF-SELECTION。
REPORT Z_ABAP_22_PBTN_TRIGGER_START.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (40) W_BUT1 USER-COMMAND BUT1.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
W_BUT1 = 'PUSHBUTTON'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'BUT1'.
MESSAGE 'AT SELECTION SCREEN' TYPE 'I'.
ENDCASE.
START-OF-SELECTION.
MESSAGE 'START-OF-SELECTION' TYPE 'I'.
END-OF-SELECTION.
REPORT Z_ABAP_22_PBTN_TRIGGER_START.
TABLES sscrfields.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (40) W_BUT1 USER-COMMAND BUT1.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
W_BUT1 = 'PUSHBUTTON'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'BUT1'.
sy-ucomm = 'ONLI'.
sscrfields-ucomm = 'ONLI'.
MESSAGE 'AT SELECTION SCREEN' TYPE 'I'.
ENDCASE.
START-OF-SELECTION.
MESSAGE 'START-OF-SELECTION' TYPE 'I'.
END-OF-SELECTION.
沒有留言:
張貼留言