SAP ABAP选择屏幕(ACTIVE,INPUT,REQUIRED)
1.可见性:ACTIVE
示例:
PARAMETERS:p_name LIKE tab-name MODIF ID m1, "名字
p_age LIKE tab_age MODIF ID m2. "年龄
PARAMETERS:
p_radio1 RADIOBUTTON GROUP g1 USER-COMMAND sel DEFAULT 'X', "显示名字
p_radio2 RADIOBUTTON GROUP g1. "显示年龄
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_radio1 EQ 'X' AND SCREEN-GROUP1 = 'M1'.
SCREEN-ACTIVE = '1'. "显示
MODIFY SCREEN.
ELSEIF p_radio2 EQ 'X' AND SCREEN-GROUP1 = 'M2'.
SCREEN-ACTIVE = '0'. "隐藏
MODIFY SCREEN.
ENDIF.
ENDLOOP.
2.必输性:REQUIRED
示例:
PARAMETERS:p_name LIKE tab-name OBLIGETORY , "名字 OBLIGATORY必输,有勾且系统会自动校验
p_age LIKE tab_age, "年龄
p_class LIKE tab_age, "班级
p_grade LIKE tab_age. "分数
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_AGE'.
SCREEN-REQUIRED = '0'. "不必输,没有勾
MODIFY SCREEN.
ELSEIF SCREEN-NAME = 'P_CLASS'.
SCREEN-REQUIRED = '1'. "必输,有勾且系统自动校验,等价于OBLIGATORY
MODIFY SCREEN.
ELSEIF SCREEN-NAME = 'P_GRADE'.
SCREEN-REQUIRED = '2'. "不必输,有勾,但系统不会自动校验,需要手动校验
MODIFY SCREEN.
ENDIF.
ENDLOOP.
3.可输性:INPUT
示例:
PARAMETERS:p_name LIKE tab-name, "名字
p_age LIKE tab_age. "年龄
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_NAME'.
SCREEN-INPUT = '1'. "可输入
MODIFY SCREEN.
ELSEIF SCREEN-NAME = 'P_AGE'.
SCREEN-INPUT = '0'. "禁止输入
MODIFY SCREEN.
ENDIF.
ENDLOOP.