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: 

Transaction with 3 Radio Buttons

Former Member
0 Kudos

Hi All,

In a transaction i have a three radio buttons in which

When the user selects first radio button, the field under first radio button should be input-enabled. Else, they should be input disabled. User should enter only one of the two fields.

When the user selects second radio button, the field should be input-enabled. Else, it should be input disabled.

When the user selects Third radio button, the field should be input-enabled. Else, it should be input disabled.

There should be a pushbutton on the screen, The text on the pushbutton should vary depending on the radio button checked.

could any one please help me

Regards,

sathish

6 REPLIES 6

Former Member
0 Kudos

hi,

When you tab into a set of enabled radio buttons, you always tab to the currently selected radio button. To move between the radio buttons in the set, use the Up and Down Arrow keys. Note that moving to a different radio button activates that radio button. To leave the radio button set, press Tab (the radio button that has the focus when you leave the set remains selected).

When you tab into a set of disabled radio buttons, you can move between the radio buttons in the set using the Tab key.

LOOP AT SCREEN.

IF r1 = 'X' AND screen-group1 = 'M2'.

screen-input = 0.

MODIFY SCREEN.

endif.

IF r2 = 'X' AND screen-group1 = 'M1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

anversha_s
Active Contributor

Former Member
0 Kudos

Here is the sample code provided with two radio buttons ...

For this I used MODIFID and in loop.

Also here id number s important....it is for indicating the group.

Which Group number is given then the below mentioned changes will be taken in tat particular group . Hope u got it..

Try it once with ur aprameters.

I dint gvethe code for the other requirment u asked for. I will provide u as soon as I get.

-


selection-screen:begin of block b1 with frame title text-001.

parameters: matnr radiobutton group rad1 default 'X' user-command uc,

material type mara-matnr modif id one,

ersda radiobutton group rad1,

date type mara-ersda modif id two.

selection-screen:end of block b1.

--


at selection-screen output--

at selection-screen output.

if matnr = 'X'.

loop at screen.

if screen-group1 ='TWO'.

screen-invisible = '1'.

screen-input ='0'.

screen-intensified = '0'.

modify screen.

endif.

endloop.

elseif ersda ='X'.

loop at screen.

if screen-group1 ='ONE'.

screen-invisible = '1'.

screen-input ='0'.

modify screen.

endif.

endloop.

endif.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 3:16 PM

Former Member
0 Kudos

Hi,

Find the below.....code ........i think it helps u to create a push button in selection screen and required functionality.

PARAMETERS: p_r1 RADIOBUTTON GROUP g1 USER-COMMAND ucom.

PARAMETERS: p_pr1(10) type c modif id r1.

PARAMETERS: p_r2 RADIOBUTTON GROUP g1 .

PARAMETERS: p_pr2(10) type c modif id r2.

PARAMETERS: p_r3 RADIOBUTTON GROUP g1 .

PARAMETERS: p_pr3(10) type c modif id r3.

selection-screen begin of line.

SELECTION-SCREEN: PUSHBUTTON 2(40) p_pusr USER-COMMAND pus1

VISIBLE LENGTH 15.

selection-screen end of line.

at selection-screen output.

if p_r1 eq 'X'.

loop at screen.

if screen-group1 = 'R2' or screen-group1 eq 'R3'.

screen-active = 0.

MODIFY SCREEN.

endif.

endloop.

p_pusr = 'R1 clicked'.

endif.

if p_r2 eq 'X'.

loop at screen.

if screen-group1 = 'R1' or screen-group1 eq 'R3'.

screen-active = 0.

MODIFY SCREEN.

endif.

endloop.

p_pusr = 'R2 clicked'.

endif.

if p_r3 eq 'X'.

loop at screen.

if screen-group1 = 'R1' or screen-group1 eq 'R2'.

screen-active = 0.

MODIFY SCREEN.

endif.

endloop.

p_pusr = 'R3 clicked'.

endif.

Regards,

Vamshidhar

Former Member
0 Kudos

Hi,

Use the below code.

selection-screen: begin of block blk1 with frame.

selection-screen: begin of line.

parameters: p_r1 radiobutton group rad1 default 'X' user-command rusr.

selection-screen position 10.

parameters: p_text1(20).

selection-screen: end of line.

selection-screen: begin of line.

parameters: p_r2 radiobutton group rad1.

selection-screen position 10.

parameters: p_text2(20).

selection-screen: end of line.

selection-screen: begin of line.

parameters: p_r3 radiobutton group rad1.

selection-screen position 10.

parameters: p_text3(20).

selection-screen: end of line.

selection-screen: end of block blk1.

DATA flag(1) TYPE c.

SELECTION-SCREEN:BEGIN OF LINE.

SELECTION-SCREEN:PUSHBUTTON 2(10) v_text USER-COMMAND cli1.

SELECTION-SCREEN:END OF LINE.

at selection-screen output.

v_TEXT = 'Rad1'.

if p_r1 = 'X'.

v_TEXT = 'Rad1'.

clear: p_text2, p_text3.

loop at screen.

if screen-name = 'P_R1' or

screen-name = 'P_R2' or

screen-name = 'P_R3'.

continue.

endif.

if screen-name = 'P_TEXT2' or

screen-name = 'P_TEXT3'.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

if p_r2 = 'X'.

v_TEXT = 'Rad2'.

clear: p_text1, p_text3.

loop at screen.

if screen-name = 'P_R1' or

screen-name = 'P_R2' or

screen-name = 'P_R3'.

continue.

endif.

if screen-name = 'P_TEXT1' or

screen-name = 'P_TEXT3'.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

if p_r3 = 'X'.

v_TEXT = 'Rad3'.

clear: p_text1, p_text2.

loop at screen.

if screen-name = 'P_R1' or

screen-name = 'P_R2' or

screen-name = 'P_R3'.

continue.

endif.

if screen-name = 'P_TEXT1' or

screen-name = 'P_TEXT2'.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

if p_r1 = 'X'.

clear: p_r2, p_r3.

loop at screen.

if screen-name = 'P_TEXT2' or

screen-name = 'P_TEXT3'.

screen-input = 0.

elseif screen-name = 'P_TEXT1'.

screen-input = 1.

endif.

modify screen.

endloop.

elseif p_r2 = 'X'.

clear: p_r1, p_r3.

loop at screen.

if screen-name = 'P_TEXT1' or

screen-name = 'P_TEXT3'.

screen-input = 0.

elseif screen-name = 'P_TEXT2'.

screen-input = 1.

endif.

modify screen.

endloop.

elseif p_r3 = 'X'.

clear: p_r1, p_r2.

loop at screen.

if screen-name = 'P_TEXT1' or

screen-name = 'p_TEXT2'.

screen-input = 0.

elseif screen-name = 'P_TEXT3'.

screen-input = 1.

endif.

modify screen.

endloop.

endif.

Former Member
0 Kudos

Finds the solution