ABAP螢幕狀態按鈕控制
新增帶圖示的功能按鈕及觸發事件
include:
TABLES: sscrfields.
INITIALIZATION.
DATA lw_functxt TYPE smp_dyntxt.
lw_functxt-text = '@[email protected]維護'.
lw_functxt-quickinfo = '維護篩選條目'.
sscrfields-functxt_01 = lw_functxt.
lw_functxt-text = '@
lw_functxt-quickinfo = '顯示篩選內容'.
sscrfields-functxt_02 = lw_functxt.
排除執行ONLI狀態按鈕
AT SELECTION-SCREEN OUTPUT.
DATA lt_exclude TYPE TABLE OF sy-ucomm.
APPEND 'ONLI' TO lt_exclude.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_exclude.
事件控制
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'FC01'.
PERFORM frm_get_data.
PERFORM frm_layout_build." 設定表格樣式
CLEAR gt_edit_field.
gw_edit_field-fieldname = 'EFFECTIVEEND'.
APPEND gw_edit_field TO gt_edit_field.
PERFORM frm_field_edit TABLES gt_edit_field. " 建立表頭資料
PERFORM frm_data_out.
WHEN 'FC02'.
PERFORM frm_get_data.
PERFORM frm_layout_build." 設定表格樣式
PERFORM frm_field_show. " 建立表頭資料
PERFORM frm_data_out.
ENDCASE.