|
原帖由 lhx20 于 2010-10-28 09:56 发表 ![]()
刚刚自己研究了一下。什么都不用再创建,直接用代码。
TYPE-POOLS icon.
TABLES sscrfields.
DATA functxt TYPE smp_dyntxt.
parameter p_matnr type mara-matnr.
selection-screen begin of block blk with frame.
parameter p_test type marc-werks modif id m1.
selection-screen end of block blk.
selection-screen function key 1.
initialization.
functxt-text = 'Expand'.
functxt-icon_text = 'Expand'.
functxt-icon_id = icon_expand.
sscrfields-functxt_01 = functxt.
at selection-screen.
case sscrfields-ucomm.
when 'FC01'.
perform f_change_functxt.
endcase.
at selection-screen output.
perform f_display using functxt-icon_text.
form f_change_functxt.
functxt = sscrfields-functxt_01.
if functxt-icon_text = 'Expand'.
functxt-text = 'Collapse'.
functxt-icon_text = 'Collapse'.
functxt-icon_id = icon_collapse.
sscrfields-functxt_01 = functxt.
else.
functxt-text = 'Expand'.
functxt-icon_text = 'Expand'.
functxt-icon_id = icon_expand.
sscrfields-functxt_01 = functxt.
endif.
endform.
FORM f_display using p_action.
LOOP AT SCREEN.
IF screen-group1 = 'M1'.
IF p_action = 'Expand'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDFORM.
ABAP好强,向你学习!俺还是菜鸟级的!路漫漫其修远兮,吾将上下而求索!哈哈..... |
|