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: 

Radio button for Inboxes

Former Member
0 Kudos

Dera SAP Seniors,

I have to create 2 radio button for a Select-options. How can I do that.

To be more clear.

I need to Create 2 select-options, but User can select any one of them and

1) InBox to Enter Materail Number

or

2) inbox to Enter Creation date.

Please let me kno, how can I do that.

Thanks & Regards

Venkat

7 REPLIES 7

Former Member
0 Kudos

Rather than adding complexity, why not just have both select-options on the screen, but make sure that only one is filled in (in the AT SELECTION-SCREEN event). This way, your users won't have to <b>both</b> press the radio button <b>and</b> fill in the select-option.

Rob

0 Kudos

Dear Rob,

Thanks for your reply.

Actually I am newbie in ABAP, So dont know much !! So I am planning with radiobutton. Moreover It makes users to Understand that they could either give any of the one information in either of the Inboxes.

moreover code will also be easy to handle.

I just want to write

If Radio1 = 'X'

select ...

Elseif Radio2 = 'X'

select...

Endif.

please let me know, if this idea is correct. Also let me know how can I create radioButton on Inboxes.

I guess you can do that with

Begin of line ...Statement but not sure.

Thanking you!!

Regards

Venkat

0 Kudos

You cannot order SELECT-OPTIONS between SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN END OF LINE because several objects are generated on the selection screen for a SELECT-OPTION (e.g. fields for the lower and upper limits of ranges).

You can create 2 radio buttons for 2 different options by graying out one field for each radiobutton selected

PARAMETER p_rad1 RADIOBUTTON GROUP rad1 DEFAULT 'X'.

SELECT-OPTIONS p_fld1 FOR vbak-vbeln modif id 'ABC'.

selection-screen skip 2.

PARAMETER p_rad2 RADIOBUTTON GROUP rad1.

SELECT-OPTIONS p_fld2 FOR vbap-posnr modif id 'XYZ'.

Then u can use

At selction-screen output.

if p_rad2 is initial.

loop at screen.

if screen-group = 'XYZ'

screen-input = '0'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-group = 'ABC'

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

Former Member
0 Kudos

hi venkat

by paramet yu can use it for example

p_matnr TYPE c RADIOBUTTON GROUP rbl1 default 'X'.

p_date TYPE c RADIOBUTTON GROUP rbl1 default 'X'.

regards

warun

Former Member
0 Kudos

Hi there. I would actually separate the radio buttons from the select options. Here's some sample code:

SELECTION SCREEN BEGIN OF BLOCK b01.

PARAMETER p_matrl RADIOBUTTON GROUP rad1 DEFAULT 'X'.

SELECT-OPTIONS p_matin FOR materialnumberfieldname.

PARAMETER p_cdate RADIOBUTTON GROUP rad1.

SELECT-OPTIONS p_cdtin FOR creationdatefieldname.

SELECTION SCREEN END OF BLOCK b01.

Then in your code under "AT SELECTION SCREEN." check to see that the correct select-option is filled out for the radiobutton that is selected. Hope this helps.

- April King

messier31
Active Contributor
0 Kudos

Hi,

Try this

parameter : a_radio as radiobutton group r1.

selec-option : s_option1 for ....

parameter : b_radio as radiobutton group r2.

selec-option : s_option2 for ....

After decalaring above make few valid in following events

<b> AT SELECTION ON a_radio </b>

Check if a_radio is selected then s_option2

shud be initial here s_option1 can also be

initial but since a_radio is selected it will

be taken as all possible values for s_option1

<b> AT SELECTION ON b_radio</b>

Check if b_radio is selected then s_option1

shud be initial here s_option2 can also be

initial but since b_radio is selected it will

be taken as all possible values for s_option2

And in ur program u can select data for that select option whose radio button is checked.

Let me know if u need more inputs on this...

Enjoy SAP.

Pankaj Singh.

Former Member
0 Kudos

Hi Kumar, King & Pankaj,

Thank you very much for your inputs. I believe this is great help. I can move forward. However I have one more doubt, Can I put both Radiobutton and selction options in oneline and Add Comment so that Radio button name is not displayed.

I will let you guys know, If I need any further help.

I am alloting points for your efforts.

Thanks once again.

Regards

Venkat.

Message was edited by: venkat Kumbham