定义:
TABLES:sscrfields.
选择屏幕:
SELECTION-SCREEN FUNCTION KEY 1.
INITIALIZATION.
PERFORM frm_init_sel_screen.
FORM frm_init_sel_screen .
DATA: lv_functxt TYPE smp_dyntxt.
lv_functxt-icon_id = icon_change.
lv_functxt-icon_text = 'xxxx'.
sscrfields-functxt_01 = lv_functxt.
ENDFORM.
按钮功能实现:
AT SELECTION-SCREEN.
PERFORM frm_excue_button.
FORM frm_excue_button .
CASE sscrfields-ucomm.
WHEN 'FC01'.
PERFORM frm_but_fc01.
ENDCASE.
ENDFORM.
另外附一段隐藏选择屏幕执行按钮的代码:
FORM frm_init_sel_screen .
DATA: lt_exclude TYPE TABLE OF sy-ucomm.
lt_exclude = VALUE #( ( 'ONLI' ) ).
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_exclude.
ENDFORM.