在工具栏上新增功能按钮,该按钮定义保存在系统结构体SSCRFIELDS中,N为一个整数类型的序号例如当N等于1时,按钮描述保存在字段SSCRFIELDS-functxt_01中,按钮的功能代码将默认赋值为‘FC01’,保存在字段SSCRFIELDS-UCOMM中,其使用方法如下例所示。注意:本例中共有两个按钮由于按钮属于屏幕元素的一部分,多以必须定义好屏幕再对按钮字段进行赋值。
1 REPORT ztest_sum. 2 TABLES:mara. 3 TABLES sscrfields. "引用屏幕字段属性 4 5 PARAMETERS rarm LIKE mara-matnr. 6 SELECTION-SCREEN FUNCTION KEY 1.
DATA functxt TYPE smp_dyntxt. INITIALIZATION. CLEAR functxt. functxt-icon_id = '@UI@'. "图标来自程序SHOWICON functxt-icon_text = '税代码维护'. functxt-quickinfo = '税代码维护'. sscrfields-functxt_01 = functxt.
AT SELECTION-SCREEN. IF sscrfields-ucomm = 'FC01'. PERFORM frm_view. ENDIF.
FORM frm_view . CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING ACTION = 'U' VIEW_NAME = 'ZFIT006' EXCEPTIONS CLIENT_REFERENCE = 1 FOREIGN_LOCK = 2 INVALID_ACTION = 3 NO_CLIENTINDEPENDENT_AUTH = 4 NO_DATABASE_FUNCTION = 5 NO_EDITOR_FUNCTION = 6 NO_SHOW_AUTH = 7 NO_TVDIR_ENTRY = 8 NO_UPD_AUTH = 9 ONLY_SHOW_ALLOWED = 10 SYSTEM_FAILURE = 11 UNKNOWN_FIELD_IN_DBA_SELLIST = 12 VIEW_NOT_FOUND = 13 MAINTENANCE_PROHIBITED = 14 OTHERS = 15. ENDFORM. " FRM_VIEW
效果如下:
点击后跳转到维护视图