‎2006 Sep 04 6:25 PM
Hi All,
I have 2 blocks on my selection screen
First block has 3 radio buttons(a, b,c) and second block has 5 check boxes. When i select radio button 'C' 2 checks boxes of 2nd block should be activated (enabled).if RB 'C' is not selected those 2 chck boxes should be in disabled position. an any one help me in this regard.(logic)
Thanks in advance
P.D .Rao
‎2006 Sep 04 6:30 PM
Hi
Heres the logic to be placed(assuming CHK_BOX2 and CHK_BOX3 are to checked/unchecked based on radio button rb_2)
in
AT SELECTION-SCREEN OUTPUT.
if rb_2 = 'X'.
CHK_BOX2 = 'X'.
CHK_BOX3 = 'X'.
else.
CHK_BOX2 = ' '.
CHK_BOX3 = ' '.
endif.
Regards,
Raj
‎2006 Sep 04 6:46 PM
Please check the below code:
REPORT ypra_sample56.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
p_r2 RADIOBUTTON GROUP rg1,
p_r3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
PARAMETER: p_c1 TYPE c AS CHECKBOX,
p_c2 TYPE c AS CHECKBOX,
p_c3 TYPE c AS CHECKBOX,
p_c4 TYPE c AS CHECKBOX,
p_c5 TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK a2.
***********************************************************************
INITIALIZATION
***********************************************************************
INITIALIZATION.
PERFORM enable_fields.
***********************************************************************
AT SELECTION SCREEN OUTPUT
***********************************************************************
AT SELECTION-SCREEN OUTPUT.
PERFORM sel_screen_output.
&----
*& Form sel_screen_output
&----
Selection screen Output
----
FORM sel_screen_output.
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
PERFORM enable_fields.
ENDIF.
IF p_r3 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sel_screen_output
&----
*& Form enable_fields
&----
enable fields in selection screen
----
FORM enable_fields .
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " disable_fields
Use screen-input = '1' to enable and screen-input = '0' to disable the checkbox. And if u want to totally make that field disappear from screen use screen-active = '1' and '0'.
Regards,
Prakash.
Message was edited by: Prakash Ramu
‎2006 Sep 09 11:12 AM
hi prakash ramu,
ur logic helped me to solve my problem.i have one more extension to the same problem. i hope u will give me solution.
Extension: after enabling the check boxes , if i click any of the chk box , an input field in another block say "Blk3" to be poulated .where can i write code to initate values for i/o field and can i use user-command option with check boxes also to trigger action as in case of check radio button .
thanks in advance ,
P.D.Rao