Application Development and Automation 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: 
Read only

Radio button issue

Former Member
0 Likes
932

Hi All,

I have added two radio buttons on a particular screen. But I have to define it some where. Actually I have to write a logic in the PBO/PAI Module by which I can check one radio button on fulfilling a condition and the other on another condition.

suppose the names of the radio buttons are r_one,r_two.

how do I define the same and where do I define the same ?

thx..

paul

9 REPLIES 9
Read only

anversha_s
Active Contributor
0 Likes
897

hi,

chk this.

<b>AT selection-screen.</b>

selection-screen begin of block group with frame title text-s04.

parameters: r_one type c radiobutton group sel.

parameters: r_two type c radiobutton group sel.

selection-screen end of block group.

*u can chk here

<b>AT selection-screen output.</b>

if r_one is initial. " not clicked

endif.

if r_two is initial. " not clicked

endif.

rgds

anver

if hlped mark points

Read only

anversha_s
Active Contributor
0 Likes
897

hi,

chk this.

<b>AT selection-screen.</b>

selection-screen begin of block group with frame title text-s04.

parameters: r_one type c radiobutton group sel.

parameters: r_two type c radiobutton group sel.

selection-screen end of block group.

*u can chk here

<b>AT selection-screen output.</b>

if r_one is initial. " not clicked

endif.

if r_two is initial. " not clicked

endif.

rgds

anver

if hlped mark points

Read only

anversha_s
Active Contributor
0 Likes
897

suppose the names of the radio buttons are r_one,r_two..

hi,

if u r in a module pool.

u can chk like this.

in the PBO.

if r_one = 'X'. "cheked

do ur manipulation

endif.

if r_two = 'X'. "cheked

do ur manipulation

endif.

u can also give like this,

TABLES SSCRFIELDS.

.....RADIOBUTTON GROUP group [USER-COMMAND fcode]

so in the PAI.

inside the module user_command u can chk like this.

if sy-ucomm = focde.

endif.

hope this hlped u.

if so mark points

rgds

anver

Read only

Former Member
0 Likes
897

If u want to group 2 radiobuttons..so that the user can select only one.

press Shift key and select two buttons...right click...generate...radio button group..trhis will ask function code and it will be assigned to both the buttons.so that u can select only one.

No need to define seperatel;y.Give in chain statement.

PAI.

Chain.

Field:R_One,

R_Two.

endchain.

Else define in the report prog..

Data:R_One type c,

R_Two type c.

Read only

Former Member
0 Likes
897

U need to write the code to set/reset the same in PBO module.

Module set_reset_rdb output.

if condition1 = TRUE.

r_one = 'X'.

r_two = SPACE.

elseif condition2 = TRUE.

r_one = SPACE.

r_two = 'X'.

endif.

endmodule.

Read only

Former Member
0 Likes
897

Goto Screen create radio button say r_1 r_2. Select both the radio button and make a right click on that Radio button group -> Define. Assign a FCODE for the radio button. If u assign the fcode it will automatically triggers the PAI/PBO. So in the PAI write the code like

if r_1 eq 'X'.

**Proceed as per logic

elseif r_2 eq 'X'.

**Proceed as per logic

endif.

Regards,

Prakash.

Read only

0 Likes
897

hi,

I suppose yours is a module pool program.

So goto the screen and create radio button- r1 and r2. Select both the radio buttonh-> right click _>radio button group -> Define. Assign FCODE for the radio button.Once it is done goto the PAI ..

if condition1 = true.
 r1 eq 'X'.
 "logic1
elseif condition2  = true 
  r2 eq 'X'.
 "logic2
endif.

Regards,

Richa

Regards,

Richa.

Read only

Former Member
0 Likes
897

Create two parameters as

parameters: r_one type c radiobutton group sel.

parameters: r_two type c radiobutton group sel.

Now on PAI module you can simply check the value of these variable in a if condition and continue with your processing.

or you can define radio buttons through screen painter.

Read only

Former Member
0 Likes
897

If you want to group two radio buttons in your dialog screen,

1. Select the defined two radio buttons

2. goto menu Edit->Grouping->Radio button group->Define.

Now two radio buttons will be grouped.

Regards,