選擇螢幕上增加自定義按鈕

2021-07-31 15:07:21 字數 853 閱讀 8741

sap的選擇螢幕的標準工具欄上系統預先定義了5個按鈕,他們對應的功能碼是fc01-fc05,預設是不啟用的。使用者可以使用selection-screen function key i.來啟用這5個按鈕(這裡的i必須是1-5),這五個按鈕的文字放在sscrfields的對應的functxt_0i中。當使用者按下按鈕時,系統將觸發at selection-screen 事件,並將功能碼放到sscrfields的ucomm欄位中。

report  z_zcd_014.

tables sscrfields.                 "定義工作區

parameters: p_carrid type s_carr_id,

p_cityfr type s_from_cit.

selection-screen: function key 1,   "啟用按鈕

function key 2.

initialization.

sscrfields-functxt_01 = '@49@ 哈哈'.

sscrfields-functxt_02 = '@54@ 呵呵'.

at selection-screen.

case sscrfields-ucomm.          "處理按鈕命令

when'fc01'.

p_carrid = 'lh'.

p_cityfr = 'frankfurt'.

when 'fc02'.

p_carrid = 'ua'.

p_cityfr = 'chicago'.

endcase.

start-of-selection.

write / 'start-of-selection'.

ABAP 報表選擇螢幕上加自定義按鈕

tables sscrfields 該結構是必須的,sap共預留了5個按鈕 parameters p werks type marc werks obligatory.parameters fs dyns type rsds type no display.selection screen func...

選擇螢幕上做按鈕

report demo screen button.tables sscrfields.selection screen begin of block scr1 with frame title text 001.parameters p path type rlgrap filename defa...

選擇螢幕上做按鈕

report mysap fi04 tables sscrfields selection screen begin of block scr1 with frame title text 001 parameters p path type rlgrap filename default c up...