[ABAP] Selection Screen 按钮管理

1. 隐藏执行按钮

在这里插入图片描述

initialization.
  data btab type table of sy-ucomm.

  append 'ONLI' to btab.
  call function 'RS_SET_SELSCREEN_STATUS'
    exporting
      p_status  = sy-pfkey
    tables
      p_exclude = btab.

2.添加按钮(Tool Bar)

在这里插入图片描述

tables: sscrfields.


selection-screen begin of line.

  selection-screen function key 1.
  selection-screen function key 2.

selection-screen end of line.

initialization.

  sscrfields-functxt_01 = icon_execute_object.
  sscrfields-functxt_02 = icon_graphics.

3. 添加按钮(Screen)

在这里插入图片描述

selection-screen:
begin of line,

pushbutton 2(10) but01 user-command cli1,

end of line.

完整代码(可执行)


tables: sscrfields.


selection-screen begin of line.

  selection-screen comment 1(5) text-001 for field p1. "starting from 12

  parameters : p1 type matnr. " this will take 10

  selection-screen comment 50(10) lv_icon. "starting from 12

  selection-screen function key 1.
  selection-screen function key 2.




selection-screen end of line.

selection-screen skip 1.

selection-screen:
begin of line,

pushbutton 2(10) but01 user-command cli1,

end of line.


initialization.

  sscrfields-functxt_01 = icon_execute_object.
  sscrfields-functxt_02 = icon_graphics.

  data btab type table of sy-ucomm.

  append 'ONLI' to btab.
  call function 'RS_SET_SELSCREEN_STATUS'
    exporting
      p_status  = sy-pfkey
    tables
      p_exclude = btab.



  if lv_icon = ''.
    lv_icon = icon_led_yellow.
  endif.

  but01 = '测试按钮'.


at selection-screen.

  if sy-ucomm = 'FC01'.
    lv_icon = icon_led_green.
  elseif sy-ucomm = 'FC02'.
    lv_icon = icon_led_red.
  elseif sy-ucomm = 'CLI1'.
    lv_icon = icon_message_warning.
  endif.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值