我有一些单选按钮,当我在它们之间进行更改时,一些块会出现/消失。
但是,如果我将参数设置为强制性或必需的,除非我填写它们,否则它们不会隐藏。我想让参数成为必需的,但是当我更改单选按钮选项时我需要隐藏它们。
我有一些单选按钮,当我在它们之间进行更改时,一些块会出现/消失。
但是,如果我将参数设置为强制性或必需的,除非我填写它们,否则它们不会隐藏。我想让参数成为必需的,但是当我更改单选按钮选项时我需要隐藏它们。
估计是选择画面...
启用或禁用块
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
* Radio button parameter = P_RADIO
* hide the parameter named "to_hide"
IF P_RADIO EQ 'X' AND SCREEN-NAME CS 'TO_HIDE'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
* display the parameter named "to_hide"
IF P_RADIO <> 'X' AND SCREEN-NAME CS 'TO_HIDE'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
If you use PARAMETERS ... OBLIGATORY
, this is an unconditional statement - this parameter is required regardless of the other settings. If you need a conditional check, you have to code it for yourself:
PARAMETERS p_chkbuk AS CHECKBOX.
PARAMETERS p_bukrs TYPE bukrs.
AT SELECTION-SCREEN ON p_bukrs.
IF p_chkbuk = abap_true AND p_bukrs IS INITIAL.
MESSAGE 'You need to enter something.' TYPE 'I' DISPLAY LIKE 'E'.
ENDIF.