2007 Mar 28 10:27 PM
hello,
I have three blocks in my selection screen.
in the first block i have one select-option
and in the second and third blocks i have 2 , 6 radio buttons respectively
depending on the select-option i give in block one,block 2 or block 3 any one of them has to get displayed.
if block 2 is active then block 3 should not get displayed and vice versa.
Plz let me know if any one have idea on this.
Thanks
Kumar
2007 Mar 28 10:52 PM
Hi,
Pls try this.
<b>selection-screen begin of block bl2.
parameters : rd1 radiobutton group rad1 default 'X' modif id ID1,
rd2 radiobutton group rad1 modif id ID1.
selection-screen end of block bl2.
selection-screen begin of block bl3.
parameters : rd3 radiobutton group rad2 default 'X' modif id ID2,
rd4 radiobutton group rad2 modif id ID2,
rd5 radiobutton group rad2 modif id ID2 ,
rd6 radiobutton group rad2 modif id ID2,
rd7 radiobutton group rad2 modif id ID2,
rd8 radiobutton group rad2 modif id ID2.
selection-screen end of block bl3.
at selection-screen output.
loop at screen.
case screen-group1.
when 'ID1'.
if (specify your condition for block2 to be active here).
screen-active = 1.
else.
screen-active = 0.
endif.
when 'ID2'.
if (specify your condition for block3 to be active here).
screen-active = 1.
else.
screen-active = 0.
endif.
modify screen.
endloop.</b>
Hope this helps. please reward points if helpful.
Thanks
Pranati.
2007 Mar 28 10:30 PM
Please try to mimik this program. Check in Debug mode you might get an Idea.
ITs for check boxes.
Shreekant.
REPORT ZASH_SCREEN .
PARAMETERS: P_C1 AS CHECKBOX USER-COMMAND USR1.
PARAMETERS: P_C2 AS CHECKBOX USER-COMMAND USR2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_C1 = 'X' AND SCREEN-NAME = 'P_C2'.
SCREEN-INPUT = '0'.
ENDIF.
IF P_C2 = 'X' AND SCREEN-NAME = 'P_C1'.
SCREEN-INPUT = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
2007 Mar 28 10:32 PM
Hi,
Welcome to SDN.
Please check this sample code to get an idea.
parameters: p_rad1 radiobutton group grp1 default 'X'
user-command check.
parameters: p_rad2 radiobutton group grp1.
parameters: p_field1 type c,
p_field2 type c.
at selection-screen output.
loop at screen.
if ( p_rad1 = 'X' and screen-name = 'P_FIELD2' )
or ( p_rad2 = 'X' and screen-name = 'P_FIELD1' ).
screen-input = '0'.
endif.
modify screen.
endloop.
Regards,
Ferry Lianto
2007 Mar 28 10:40 PM
Hi friends,
Thanks for your reply.
Its nothing with check boxes, my question is if i have three blocks,how to activate or deactivate a particular block depending on the value entered in select-option or parameter defined in the other block.
Thanks,
kumar
2007 Mar 28 10:52 PM
Hi,
Pls try this.
<b>selection-screen begin of block bl2.
parameters : rd1 radiobutton group rad1 default 'X' modif id ID1,
rd2 radiobutton group rad1 modif id ID1.
selection-screen end of block bl2.
selection-screen begin of block bl3.
parameters : rd3 radiobutton group rad2 default 'X' modif id ID2,
rd4 radiobutton group rad2 modif id ID2,
rd5 radiobutton group rad2 modif id ID2 ,
rd6 radiobutton group rad2 modif id ID2,
rd7 radiobutton group rad2 modif id ID2,
rd8 radiobutton group rad2 modif id ID2.
selection-screen end of block bl3.
at selection-screen output.
loop at screen.
case screen-group1.
when 'ID1'.
if (specify your condition for block2 to be active here).
screen-active = 1.
else.
screen-active = 0.
endif.
when 'ID2'.
if (specify your condition for block3 to be active here).
screen-active = 1.
else.
screen-active = 0.
endif.
modify screen.
endloop.</b>
Hope this helps. please reward points if helpful.
Thanks
Pranati.
2007 Mar 28 11:02 PM
You have to do this in AT SELECTION-SCREEN OUTPUT. If you deactivate all the parameters and select-options within a block, the block will automatically disappear. An empty block will not show up on the screen. So put all the parameters/select-options in block 2 in one MODIF group and put those of block 3 in another group. In AT SELECTION-SCREEN, depending on your block 1 value, activate or deactivate these groups.
2007 Mar 28 11:06 PM
I see one issue in that you have radio-buttons in both these blocks (2 and 3). Even if you deactivate the block, you will still have a value of 'X' for the default radiobutton of the blocks. You will have to take care of it while doing your selections or whatever functionality these buttons have.