Design the selection-screen as shown in the figure.
If the user select the sales radio button then sales field enable & rest of the fields are disabled. If the user select the company radio button then S_BUKRS is enabled and rest of the fields are disabled. If the user select the customer radio button then S_KUNNR is enable and rest of the fields are disabled.
PROGRAM:
*&---------------------------------------------------------------------*
*& Report ZR_MODIFY_SCREEN
*&
*&---------------------------------------------------------------------*
REPORT ZR_MODIFY_SCREEN.
Data V1 type VBAK-VBELN.
Data V2 type KNA1-KUNNR.
Selection-screen begin of block A with frame.
Select-options S_VBELN for V1 MODIF ID M1.
Parameter P_BUKRS type T001-BUKRS MODIF ID M2.
Select-options S_KUNNR for V2 MODIF ID M3.
Parameter p_sal radiobutton group B USER-COMMAND UC.
Parameter p_com radiobutton group B.
Parameter p_cus radiobutton group B default 'X'.
Selection-screen end of block A.
At selection-screen output.
If p_sal = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 1.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 0.
Modify screen.
Endif.
Endloop.
Elseif p_com = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 1.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 0.
Modify screen.
Endif.
Endloop.
Elseif p_cus = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 1.
Modify screen.
Endif.
Endloop.
Endif.
OUTPUT:
BY DEFAULT CUSTOMER IS SELECTED
If the user select the sales radio button then sales field enable & rest of the fields are disabled. If the user select the company radio button then S_BUKRS is enabled and rest of the fields are disabled. If the user select the customer radio button then S_KUNNR is enable and rest of the fields are disabled.
PROGRAM:
*&---------------------------------------------------------------------*
*& Report ZR_MODIFY_SCREEN
*&
*&---------------------------------------------------------------------*
REPORT ZR_MODIFY_SCREEN.
Data V1 type VBAK-VBELN.
Data V2 type KNA1-KUNNR.
Selection-screen begin of block A with frame.
Select-options S_VBELN for V1 MODIF ID M1.
Parameter P_BUKRS type T001-BUKRS MODIF ID M2.
Select-options S_KUNNR for V2 MODIF ID M3.
Parameter p_sal radiobutton group B USER-COMMAND UC.
Parameter p_com radiobutton group B.
Parameter p_cus radiobutton group B default 'X'.
Selection-screen end of block A.
At selection-screen output.
If p_sal = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 1.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 0.
Modify screen.
Endif.
Endloop.
Elseif p_com = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 1.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 0.
Modify screen.
Endif.
Endloop.
Elseif p_cus = 'X'.
Loop at screen.
If screen-group1 = 'M1'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M2'.
Screen-input = 0.
Modify screen.
Elseif screen-group1 = 'M3'.
Screen-input = 1.
Modify screen.
Endif.
Endloop.
Endif.
OUTPUT:
BY DEFAULT CUSTOMER IS SELECTED