"注意:1、在單選按鈕的時候,USER-COMMAND SINGLECLICK只能在第一個參數
SELECTION-SCREEN BEGIN OF BLOCK DEV1 WITH FRAME TITLE T1 .
PARAMETERS: PNO RADIOBUTTON GROUP X1 USER-COMMAND SINGLECLICK,
DEV RADIOBUTTON GROUP X1 DEFAULT ‘X‘ .
SELECTION-SCREEN END OF BLOCK DEV1 .
"2、每個塊後面需要帶上MODIF ID + 名稱,並且名稱不能有雙或者單引號
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS LGORT FOR MSEG-LGORT MODIF ID LG ."固定資產時的部門編號
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS KOSTL FOR MSEG-KOSTL MODIF ID KO. "非固定資產時的成本中心
SELECTION-SCREEN END OF BLOCK B2.
"3、初始化時,隱藏沒有選擇的那個塊
INITIALIZATION.
T1 = ‘請選擇下面選項‘.
"初始化時,這兩個界面是不顯示的
LOOP AT SCREEN.
IF SCREEN-GROUP1 = ‘KO‘.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
"在屏幕輸出時,根據選擇更新屏幕顯示
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF PNO = ‘X‘.
IF SCREEN-GROUP1 = ‘KO‘.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = ‘LG‘.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF PNO IS INITIAL.
IF SCREEN-GROUP1 = ‘KO‘.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
2、如果把SCREEN-ACTIVE 改成 SCREEN-INPUT的話就是可編輯和不可編輯相互切換。