粉妮常常收到user需求---
嘿~Tiffany,我想要某某程式,勾選這個另一個欄位不能選擇,請幫我鎖定,不然我們助理會選錯…(姊立馬翻白眼到頭頂 )
話不多說現在來分享如何撰寫,才能達到效果
這時候就要在 AT SELECTION-SCREEN OUTPUT.
內修改畫面的值
範例: 1.選擇 「Sreach Single Material」時,顯示Material 、 Plant.....等欄位條件,下載格式可選擇「BOM List」或「SAP Upload List」。
2.選擇「Sreach most of Material」時,下載格式不可選擇「BOM List」或「SAP Upload List」。
首先定義欄位
*=====select-options=====*
<Radiobutton>
PARAMETERS: p_red3 RADIOBUTTON GROUP rad4 DEFAULT 'X' USER-COMMAND rad, "Sreach Single Material
p_red4 RADIOBUTTON GROUP rad4 . "Sreach Most of Material
註:記得要在後方加上USER-COMMAND才會啟用喲! 否則需按下ENTER才會動作。
<輸入條件>
PARAMETERS:p_matnr TYPE mast-matnr MODIF ID m5. (MODIF ID M5 為畫面群組)
SELECT-OPTIONS:p_werks FOR mast-werks NO-EXTENSION NO INTERVALS MODIF ID m5,
p_chgrp FOR aenr-aenbe DEFAULT '0100' NO-EXTENSION NO INTERVALS.
NO-EXTENSION:只能填寫區間
NO INTERVALS:只能多筆填寫
NO-EXTENSION & NO INTERVALS:只能填單筆
後續的欄位就省略囉!接下來要更改畫面
在畫面的迴圈內,使用SCREEN-GROUP1來區分,
用WHEN 'M1'來說明,在M1的群組內,若P_disp1的值為'X',畫面則隱藏
SCREEN-ACTIVE用來控制畫面的顯示(1)或隱藏(0)
用WHEN 'M6'來說明,在M6的群組內,若P_red4的值為'X',該畫面反灰不可修改
SCREEN-INPUT用來控制畫面能否修改,反灰(0),可修改(1)。
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'M1'.
IF p_disp1 = 'X'.
screen-active = '0'.
ELSEIF p_red2 = 'X'.
screen-active = '0'.
ELSE.
screen-active = '1'.
ENDIF.
WHEN 'M2'.
IF p_disp1 = 'X'.
screen-active = '0'.
ELSEIF p_ext1 = 'X'.
screen-active = '0'.
ELSE.
screen-active = '1'.
ENDIF.
WHEN 'M3'.
IF p_red1 = 'X'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
WHEN 'M4'.
IF p_red2 = 'X'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
WHEN 'M5'.
IF p_red4 = 'X'.
screen-active = '0'.
ELSE.
screen-active = '1'.
ENDIF.
WHEN 'M6'.
IF p_red4 = 'X'.
screen-input = '0'.
p_red1 = 'X'.
p_red2 = ''.
ELSE.
screen-input = '1'.
ENDIF.
WHEN 'M7'.
IF p_red4 = 'X'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
結果畫面
以上,分享完畢,若有錯誤,歡迎大家指教告知,謝謝
留言列表