10-15-2007 3:52 PM
Hi All,
I want to disable an input field when a particular radiobutton is checked on the selection screen.
Whatever solutions I have tried (like loop at screen) etc., only disable the field after I press enter on the selection screen, also the modification done is parmanent. That is, after checking the said radibutton when I check any other radiobutton after that, the field still remains disabled.
Please let me know any solutions regarding this.
Thanks and regards
Baradakanta Swain.
10-15-2007 6:25 PM
Hi
Check this sample codes and see
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
pa_vkorg TYPE vbak-vkorg MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
s_date FOR gs_lfa1-erdat MODIF ID def,
s_augru FOR gs_vbak-augru MODIF ID def,
s_vbeln FOR gs_vbak-vbeln MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b3.
IF pa_rep EQ gc_x.
LOOP AT SCREEN.
IF screen-group1 = gc_abc.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_def.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF pa_upd EQ gc_x.
*For Reprocessing
LOOP AT SCREEN.
IF screen-group1 = gc_def.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_abc.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
CLEAR pa_upd.
ENDLOOP.
ENDIF.
***********************************************************
REPORT zrich_001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
user-command chk,
p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
s_datum2 FOR sy-datum MODIF ID d2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'
AND screen-group1 = 'D2'.
screen-active = '0'.
ENDIF.
IF p_rad2 = 'X'
AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Reward if useful
Anji
10-15-2007 3:53 PM
Add a user command to your radio button...
this will solve the problem
10-15-2007 6:25 PM
Hi
Check this sample codes and see
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
pa_vkorg TYPE vbak-vkorg MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
s_date FOR gs_lfa1-erdat MODIF ID def,
s_augru FOR gs_vbak-augru MODIF ID def,
s_vbeln FOR gs_vbak-vbeln MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b3.
IF pa_rep EQ gc_x.
LOOP AT SCREEN.
IF screen-group1 = gc_abc.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_def.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF pa_upd EQ gc_x.
*For Reprocessing
LOOP AT SCREEN.
IF screen-group1 = gc_def.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_abc.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
CLEAR pa_upd.
ENDLOOP.
ENDIF.
***********************************************************
REPORT zrich_001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
user-command chk,
p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
s_datum2 FOR sy-datum MODIF ID d2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'
AND screen-group1 = 'D2'.
screen-active = '0'.
ENDIF.
IF p_rad2 = 'X'
AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Reward if useful
Anji
10-17-2007 7:18 AM
hi,
u will have to add a function code to the radio button in the screen layout and then do the corresponding coding in the pai...
regards,
sagar