02-11-2010 6:51 AM
Hi,
I have 3 radiobuttons namely R1,R2 and R3. And also 2 checkboxes C1 and C2.
These are all placed in tab1.
Whenever i select R3,checkboxes should be visible and whenever i select R1 or R2,the check boxes should be
invisible.How to achive this?.
Thanks,
Sri
02-11-2010 9:20 AM
Hello,
Try this I have tested the same on a small program.
On your screen you have 3 radio buttons R1, R2 and R3 and 2 checkboxes C1 and C2. Define group on the radio buttons and assign a FCT code say F1 to it.
Now in the PBO inside the module code as follows
if r3 = 'X'.
loop at screen.
if screen-name = 'C1' or screen-name = 'C2'.
screen-invisible = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'C1' or screen-name = 'C2'.
screen-invisible = 1.
modify screen.
endif.
endloop.
endif.
When you click on R3 C1 and C2 will be visible but as soon as you select the R1 or R2 radiobuttons C1 and C2 will be invisible.
Regards,
Sachin
02-11-2010 6:58 AM
HI Sri,
Use the 'LOOP AT SCREEN' statement in the PAI event. Here is a sample code.
LOOP AT SCREEN.
if c1 = 'X'.
Screen-active = 'X'.
else.....
Go through the documentation of the statement also.
Regards,
Amuktha
02-11-2010 7:05 AM
Hi sri,
For this you wil have to logic in PBO of screen.
If R3 = X.
Loop at screen.
IF screen-name = 'C1'
OR Screen-name = 'C2'.
screen-invisible = 0.
Modify Screen.
Endif.
Endlop.
else.
Loop at screen.
IF screen-name = 'C1'
OR Screen-name = 'C2'.
screen-invisible = 1.
Modify Screen.
Endif.
Endlop.
Hoping this helps,
Thanks & Regards,
Komal
02-11-2010 7:20 AM
Hi all,
Wrote a module in PBO of the RB's and checkboxes located.
but no change.the check boxes are visible even if R1 or R2 is selected.
CLEAR UCOMM.
UCOMM = SY-UCOMM.
IF UCOMM = 'R3'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'C1' OR SCREEN-NAME = 'C2'.
SCREEN-INVISIBLE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF UCOMM = 'R1' OR UCOMM = 'R2'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'C1' OR SCREEN-NAME = 'C2'.
SCREEN-INVISIBLE = '1'.
SCREEN-ACTIVE = ''.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
02-11-2010 7:26 AM
Hi Sri
Instead of checking the UCOMM.
Try checking value in the radio button to be 'X'.
Thanks & Regards,
Komal Lakhwani
02-11-2010 7:32 AM
Hi,
Try this code.
IF R3 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'G1'. "Group both C1 and C2.
SCREEN-INVISIBLE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF R1 = 'X' OR R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'G1'.
SCREEN-INVISIBLE = '1'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Sri.
02-11-2010 8:32 AM
02-11-2010 9:03 AM
Hi Again ,
I gave my initial solution based on report eventing . But in module pool once you do a user action the processing will again load the contents from PBO so the check boxes will again be visible . I doubt if we can make them invisible immediately after the user action cause the place holders for check boxes will hold true. Never tried it but im waiting for a better alternative .
Br,
Vijay.
02-11-2010 7:02 AM
Hi Its simple..
REPORT ZEX_VIJ1.
PARAMETERS:r1 RADIOBUTTON GROUP gr1 USER-COMMAND ucom1 DEFAULT 'X',
r2 RADIOBUTTON GROUP gr1,
r3 RADIOBUTTON GROUP gr1.
PARAMETERS:c1 AS CHECKBOX,
c2 AS CHECKBOX.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF r1 = 'X' or r2 = 'X'.
IF screen-name = 'C1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'C2'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ELSEIF r3 = 'X'.
IF screen-name = 'C1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'C2'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
ENDIF.
Br,
Vijay.
02-11-2010 7:03 AM
Hello Sri,
Group the CheckBoxes, group1 with CHK, so that the loop process only the check box screen elements.
If RadioButtons have function code : RADIO,
write a PBO module :
DATA: r1(1) TYPE c, r2(1) TYPE c, r3(1) TYPE c.
CASE ok_code.
WHEN 'RADIO'.
IF r1 = 'X'.
LOOP AT SCREEN WHERE group1 = 'CHK'.
screen-active = '1'.
screen-invisible = '0'.
MODIFY SCREEN.
ENDLOOP.
ELSEIF r2 = 'X' or r3= 'X'.
LOOP AT SCREEN WHERE group1 = 'CHK'.
screen-active = '0'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
Cheers,
Remi
02-11-2010 7:03 AM
Hello,
Try something like mentioned below
Say RB1,RB2 and RB3 are the radio buttons and they are assigned a group g1. Also assign a function code the group say USR
If ch1 and ch2 are the checkboxes, double click on each and assign say 111 to group1 in the screen attributes.
Now in the PBO of the subscreen on which you have inserted the check box and radio buttons
PBO
module disable output.
In the module write
if rb3 = 'X'.
loop at screen.
if screen-group1 = '111'.
screen-invisible = 0.
modify screen.
endif.
endloop.
endif.
You may have to modify the code a little bit as I have not tested it yet but this is how it can be attained.
Regards,
Sachin
02-11-2010 7:04 AM
>
> Hi,
> I have 3 radiobuttons namely R1,R2 and R3. And also 2 checkboxes C1 and C2.
> These are all placed in tab1.
> Whenever i select R3,checkboxes should be visible and whenever i select R1 or R2,the check boxes should be
> invisible.How to achive this?.
>
>
> Thanks,
> Sri
Hi
You will have to use user comman and modif id in the selection screen build up
as below.
selection-screen begin of block blk0 with frame title text-000.
selection-screen begin of block blk1 with frame title text-001.
parameter : p_sbom as checkbox modif id sl1 user-command ucom.
selection-screen skip 1.
parameter p_file1(128) type c modif id sl1.
selection-screen end of block blk1.
selection-screen begin of block blk2 with frame title text-002.
parameter : p_rpbom as checkbox modif id sl2 user-command ucom.
selection-screen skip 1.
parameter p_file2(128) type c modif id sl2.
parameter p_file5(128) type c modif id sl2.
selection-screen end of block blk2.
selection-screen begin of block blk3 with frame title text-003.
parameter : p_sbom1 as checkbox modif id sl3 user-command ucom.
selection-screen skip 1.
parameter p_file3(128) type c modif id sl3.
*SELECTION-SCREEN SKIP 1.
*PARAMETER : p_active RADIOBUTTON GROUP pr,
* p_inact RADIOBUTTON GROUP pr.
selection-screen end of block blk3 .
selection-screen begin of block blk4 with frame title text-004.
parameter : p_mm as checkbox modif id sl4 user-command ucom.
selection-screen skip 1.
parameter p_file4(128) type c modif id sl4.
selection-screen end of block blk4.
selection-screen end of block blk0.
02-11-2010 7:06 AM
herez a rough solution,
in PBO, in loop at screen,
check the status of radiobutton R3.
if it is set, set a flag - say (rb3_flg = 1)
check the status of radiobutton R2.
if it is set, set a flag - say (rb2_flg = 1)
check the status of radiobutton R1.
if it is set, set a flag - say (rb1_flg = 1)
now when the loop comes on checkbox(c1),
if rb3_flg = 1.
c1 = inactive.
clear rb3_flg.
endif.
... same for c2.
endloop.
Regards,
Sumit
02-11-2010 9:19 AM
hi,
if r1 = 'X' or r2 = 'X'.
loop at screen.
if screen-name = 'C1'or screen-name = 'C2'.
screen-active = 0.
modify screen.
endif.
endloop.
else.
if screen-name = 'C1'or screen-name = 'C2'.
screen-active = 1.
modify screen.
endif.
endloop.
regards,
sakshi
02-11-2010 9:20 AM
Hello,
Try this I have tested the same on a small program.
On your screen you have 3 radio buttons R1, R2 and R3 and 2 checkboxes C1 and C2. Define group on the radio buttons and assign a FCT code say F1 to it.
Now in the PBO inside the module code as follows
if r3 = 'X'.
loop at screen.
if screen-name = 'C1' or screen-name = 'C2'.
screen-invisible = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'C1' or screen-name = 'C2'.
screen-invisible = 1.
modify screen.
endif.
endloop.
endif.
When you click on R3 C1 and C2 will be visible but as soon as you select the R1 or R2 radiobuttons C1 and C2 will be invisible.
Regards,
Sachin
02-11-2010 9:46 AM