Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Radio Button...

Former Member
0 Kudos

Hi Experts,

I have two radio buttons and two parameters regarding to the buttons.Example: r1 p1

r2 p2

if i click r1 radio button ,should disable p2 parameter...

if i click r2 radio button , disable p1 parameter..

how can achieve it....

Thanks,

priya

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code.

parameters : r1 radiobutton group g1 default 'X' user-command RAD ,

p1(3) modif id RA2,

r2 radiobutton group g1,

p2(3) modif id RA1.

at selection-screen output.

loop at screen.

if ( ( screen-group1 = 'RA1' and r1 = 'X' ) or

( screen-group1 = 'RA2' and r2 = 'X' ) ).

screen-input = 0.

modify screen.

endif.

endloop.

Kindly reward points by clicking the star on the left of reply,if it helps.

14 REPLIES 14

former_member188685
Active Contributor
0 Kudos
parameters : r1 radiobutton group g1 user-command 'ABC',
             r1 radiobutton group g1.

at selection-screen output.
if r1 = 'X'.

loop at screen.
if screen-filed = 'P1'.
screen-input = '0'.
clear p1.
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-filed = 'P2'.
screen-input = '0'.
clear p2.
endif.
modify screen.
endloop.

endif.

former_member188685
Active Contributor
0 Kudos

reverse the P1 and P2...sorry for that

parameters : r1 radiobutton group g1 user-command 'ABC',             
r1 radiobutton group g1.

at selection-screen output.
if r1 = 'X'.
loop at screen.
if screen-filed = 'P2'.
screen-input = '0'.clear p2.
endif.
modify screen.
endloop.
else.
loop at screen.
if screen-filed = 'P1'.
screen-input = '0'.
clear p1.
endif.
modify screen.
endloop.endif.

Message was edited by: Vijay Babu Dudla

0 Kudos

Hi Vijay,

parameters should disable when i click radio button.

parameters : r1 radiobutton group g1 user-command ABC,

r2 radiobutton group g1.

PARAMETERS: p1 TYPE d default sy-datum.

select-options p2 for sy-datum.

at selection-screen output.

if r1 = 'X'.

loop at screen.

if r1 = 'P2'.

screen-input = '0'.

clear p2.

endif.

modify screen.

endloop.

else.

loop at screen.

if r2 = 'P1'.

screen-input = '0'.

clear p1.

endif.

modify screen.

endloop.

endif.

Cheers,

priya

0 Kudos

Hi priya,

You cannot compare R1 with 'P1' and R2 with 'P2'.

You have to work with screen-name while looping at screen.

parameters : r1 radiobutton group g1 user-command ABC,

r2 radiobutton group g1.

PARAMETERS: p1 TYPE d default sy-datum.

select-options p2 for sy-datum.

at selection-screen output.

LOOP AT SCREEN.

IF r1 EQ 'X'

AND ( screen-name EQ 'P2-LOW'

OR screen-name EQ 'P2-HIGH' ).

REFRESH p2.

screen-input = 0.

MODIFY SCREEN.

ELSEIF r2 EQ 'X' AND screen-name EQ 'P1'.

CLEAR p1.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

0 Kudos

parameters : r1 radiobutton group g1 user-command ABC,

r2 radiobutton group g1.

PARAMETERS: p1 TYPE d default sy-datum.

select-options p2 for sy-datum.

at selection-screen output.

if r1 = 'X'.

loop at screen.

<b>if screen-field = 'P2-LOW'.

screen-input = '0'.

clear p2-LOW.

endif.</b>

modify screen.

<b>if screen-field = 'P2-HIGH'.

screen-input = '0'.

clear p2-HIGH.

endif.

modify screen</b>.

endloop.

else.

loop at screen.

if <b>SCREEN_FIELD</b> = 'P1'.

screen-input = '0'.

clear p1.

endif.

modify screen.

endloop.

endif.

check thiss....

0 Kudos

Hi Priya,

See my corrected code ...

for select options you need specify low and high also..

reward for helpful answers...

regards

vijay

0 Kudos

Hi sri,

It is not working for R1 radio button.If click r1 Radio Button, should disable p2 parameter select option...

It is ok for r2 Button ,disabling the parameter p1.....

parameters : r1 radiobutton group g1 user-command ABC,

r2 radiobutton group g1.

PARAMETERS: p1 TYPE d default sy-datum.

select-options p2 for sy-datum.

at selection-screen output.

LOOP AT SCREEN.

IF ( r1 EQ 'X' AND screen-name EQ 'P2' )

OR ( r2 EQ 'X' AND screen-name EQ 'P1' ).

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

0 Kudos

Hi Priya,

If you Still have any problem please let me know...

and try to close the thread if it solved...

vijay

0 Kudos

Is that a Obliagtory field then you need to enter some thing and check ....

regards

vijay

0 Kudos

Hi all

Thanks for all the replies.

Points granted

priya

0 Kudos

hi

please award and close the thread..

vijay

former_member188685
Active Contributor
0 Kudos

Hi Priya,

If you got the solution please try to close the thread.

if you don't know how to close just let me know..

reward for helpful answers..

vijay

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code.

parameters : r1 radiobutton group g1 default 'X' user-command RAD ,

p1(3) modif id RA2,

r2 radiobutton group g1,

p2(3) modif id RA1.

at selection-screen output.

loop at screen.

if ( ( screen-group1 = 'RA1' and r1 = 'X' ) or

( screen-group1 = 'RA2' and r2 = 'X' ) ).

screen-input = 0.

modify screen.

endif.

endloop.

Kindly reward points by clicking the star on the left of reply,if it helps.

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Priya,

try this code and it will work when u press select radio button and press enter, if u want to trigger when radio button is selected then u have to handle selection screen events...

TABLES : VBAP.
parameters: vbeln type vbak-vbeln modif id VB1.
Parameters: VB1 type VBAP-VBELN MODIF ID PP1.
parameters : r1 radiobutton group rg1,
r2 radiobutton group rg1.
*****event 1 PBO OF SELECTION-SCREEN
at selection-screen output.
loop at screen.
if r1 = 'X'.
if screen-group1 = 'VB1'.
screen-active = '0'.
modify screen.
endif.
elseif r2 = 'X'.
if screen-group1 = 'PP1'.
screen-active = '0'.
modify screen.
endif.
endif.
endloop.

Regards,

Sridhar Reddy k