‎2006 Dec 04 5:01 AM
I have two radiobuttons r1 and r2,
and i have two parameters p1 and p2.
Now,
when r1 is selected p2 should be disabled for input,
and when r2 is selected p1 should be disabled for output.
Right now i am using
**************************************************
AT SELECTION-SCREEN OUTPUT.
if r1 = 'X'.
LOOP AT SCREEN.
if screen-name = 'p2'.
screen-input = '0'.
MODIFY SCREEN.
endloop.
endif.
else.
LOOP AT SCREEN.
if screen-name = 'p1'.
screen-input = '0'.
MODIFY SCREEN.
endif.
endloop.
endif.
*********************************
The following code on execution,
only sets the default, but this event is not triggered on runtime.
How can we do this ??
‎2006 Dec 04 5:04 AM
Hi,
To hide:
PARAMETERS: r_copy RADIOBUTTON GROUP R1 default 'X' user-command rusr,
r_delete RADIOBUTTON GROUP R1,
p_copy(10) modif id Z1,
p_delete(10) modif id z2.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF ( r_copy = 'X' and SCREEN-GROUP1 = 'Z1' ) or
( r_delete = 'X' and SCREEN-GROUP1 = 'Z2' ) or
( screen-name CS 'R_COPY' ) or ( screen-name CS 'R_DELETE' ).
SCREEN-active = 1.
ELSE.
SCREEN-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
To Disable:
PARAMETERS: r_copy RADIOBUTTON GROUP R1 default 'X' user-command rusr,
r_delete RADIOBUTTON GROUP R1,
p_copy(10) modif id Z1,
p_delete(10) modif id z2.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF ( r_copy = 'X' and SCREEN-GROUP1 = 'Z1' ) or
( r_delete = 'X' and SCREEN-GROUP1 = 'Z2' ) or
( screen-name = 'R_COPY' ) or ( screen-name = 'R_DELETE' ).
SCREEN-input = 1.
ELSE.
SCREEN-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2006 Dec 04 5:58 AM
Hi,
Just copy and paste.This should work.
PARAMETERS: r1 RADIOBUTTON GROUP R1 default 'X' user-command rusr,
r2 RADIOBUTTON GROUP R1,
p1(10) modif id Z1,
p2(10) modif id Z2.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF ( r1= 'X' and SCREEN-GROUP1 = 'Z1' ) or
( r2 = 'X' and SCREEN-GROUP1 = 'Z2' ) or
( screen-name = 'R1') or ( screen-name = 'R2').
SCREEN-input = 1.
ELSE.
SCREEN-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2006 Dec 04 5:05 AM
hi,
chk this.
*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .
*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.
*-------------------------------------------
at selection-screen .
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.rgds
Anver
‎2006 Dec 04 5:24 AM
HI Anuj
Please note that the names you use for the parameter comparision should in UPPER CASE. Highlighted below are for your reference.
AT SELECTION-SCREEN OUTPUT.
if r1 = 'X'.
LOOP AT SCREEN.
if screen-name = '<b>P2</b>'.
screen-input = '0'.
MODIFY SCREEN.
endloop.
endif.
else.
LOOP AT SCREEN.
if screen-name = '<b>P1</b>'.
screen-input = '0'.
MODIFY SCREEN.
endif.
endloop.
endif.
Kind Regards
Eswar
‎2006 Dec 04 5:37 AM
hi everyone,
None of the above code is working.
The code is not executed when i change the selection of radiobutton.
are the events specified get called when a change is made??
‎2006 Dec 04 5:44 AM
Hi Anuj
Please check that you code resembles something like below:
parameters: r1 radiobutton group rad1 default 'X' user-command ABC,
r2 radiobutton group rad1.
parameters: p1(10) type c,
p2(10) type c.
at selection-screen output.
loop at screen.
case 'X'.
when R1.
case screen-name.
when 'P1'.
screen-input = 1.
when 'P2'.
screen-input = 0.
endcase.
when R2.
case screen-name.
when 'P1'.
screen-input = 0.
when 'P2'.
screen-input = 1.
endcase.
endcase.
modify screen.
endloop.Copy the above code to a temporary program and execute to check the same.
Hope this helps you.
Kind Regards
Eswar
‎2006 Dec 04 5:43 AM
Hi anuj,
just by putting code in the 'at selection-screen output.'. will not work.
you require to to trigger an event on radio button selection.
Try the following code with 2 radio buttons, it will work.
REPORT Y_TEMP_EXAMPLE.
tables: T001w.
parameters: p_radio1 radiobutton group serv default 'X' user-command
flag.
selection-screen begin of block radio1 with frame title text-001.
parameters: p_param type localfile modif id b1.
selection-screen end of block radio1.
parameters: p_radio2 radiobutton group serv.
selection-screen begin of block radio2 with frame title text-002.
select-options : s_plant for T001w-werks modif id b2.
selection-screen end of block radio2.
at selection-screen output.
loop at screen.
case screen-group1.
when 'B1'.
if p_radio1 eq space.
screen-input = 0. "disable file input parameter.
endif.
when 'B2'.
if p_radio2 eq space. "if report option not selected
screen-input = 0. "disable plant and prodh select options
endif.
endcase.
modify screen.
endloop.
‎2006 Dec 04 6:13 AM
Hi Anuj,
Your code is fine only thing u need to change in the code is:
<b> change Screen-name = 'p2' to screen-name cs 'p2'.</b>
AT SELECTION-SCREEN OUTPUT.
if r1 = 'X'.
LOOP AT SCREEN.
if screen-name <b>CS</b> 'p2'.
screen-input = '0'.
MODIFY SCREEN.
endloop.
endif.
else.
LOOP AT SCREEN.
if screen-name <b>CS</b> 'p1'.
screen-input = '0'.
MODIFY SCREEN.
endif.
endloop.
endif.
I hope this helps.
Regards,
Geeta