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 and mandatory fields

Former Member
0 Likes
3,216

Hello,

I have obligatory field in the selection screen . I have 3 radio buttons on the selection screen.

My requirement is

When I press radio button, make entry in required fields message should not come.

How can we do that ?

Regards,

Satya

Hello,

I have obligatory field in the selection screen . I have 3 radio buttons on the selection screen.

My requirement is

When I press radio button, make entry in required fields message should not come.

How can we do that ?

Regards,

Satya

9 REPLIES 9
Read only

matt
Active Contributor
1,513

Instead of making the field obligatory, put some validation on it. This will give you greater control.

Read only

former_member195383
Active Contributor
0 Likes
1,513

use condition for error message...

suppose the select option u are using for entering value is so_num.

if rad_b NE 'X'.

if so_num-high is initial.

(use error message< Enter value>)

endif.

Endif.

then only when radio button is not checked the error message will come..

no need to use mandatory in selectoption..

Edited by: Craig Cmehil on Jul 7, 2008 9:08 AM

Read only

peter_ruiz2
Active Contributor
0 Likes
1,513

hi,

take a look at this code.

report test.

parameters:

p_1 radiobutton group rb1 user-command RB1,

p_2 radiobutton group rb1.

at selection-screen output.

if p_1 eq 'X'.

message i999(z0) with 'This is a test.'.

endif.

regards,

Peter

Read only

Former Member
0 Likes
1,513

Hi,

Remove the obligatory for the field on the selection screen,

and in the event "AT SELECTION SCREEN " handle it.

Example:

AT SELECTION SCREEN .

if w_field1 eq SPACE.

give some ERROR Message.

endif.

Regards,

Jaya Vani

Read only

Former Member
0 Likes
1,513

Hi,

Remove the obligatory for the field on the selection screen,

and in the event "AT SELECTION SCREEN " handle it.

Example:

AT SELECTION SCREEN .

if w_field1 eq SPACE.

give some ERROR Message.

endif.

Regards,

Jaya Vani

Read only

Former Member
0 Likes
1,513

Hi,

In The Event

AT SELECTION-SCREEN.

write-

if radiobutton1 = 'X' Or radiobutton2 = 'X' or radiobutton3 = 'X' and parameter is initial.

message 'Make entry in Mandatary field' type 'E'.

Endif.

Give the Message type E.

If you Do Not want The Message to Come The Remove the OBLIGATORY addition from screen field.

Regards,

Sujit

Edited by: Sujit Pal on Jul 4, 2008 9:28 AM

Read only

Former Member
0 Likes
1,513

Hi Satya,

Remove the obligatory option. Unless you remove the obligatory option, you are going to get the message.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,513

Hi Naga.

This can be the possibility.

At selection-screen.

Case sy-ucomm. 

When 'Radio 1'.

MESSAGE i<NNN>(CCC) WITH text-001 sscrfields-ucomm. "NNN - Msg no, CCC - Msg class.

When 'Radio 2'.

.......

When 'Radio3'.

...................

Endcase.

Start-of-selection.

write:/------.

Regards

Harsh

Edited by: Craig Cmehil on Jul 7, 2008 9:08 AM

Read only

Former Member
0 Likes
1,513

hi,

you hav made all three fields obligatory.

as they are obligatory system will give an error message till all the three values r entered..

there are 2 possibilites..

1

if your requirement is like you have three fields and three radiobuttons.

but only for one radiobutton all the three fields need to be entered.

if this is ur req then at selction screen

if rd1 = 'X'.

then enter all the three values.."give message if any of them is initial.

2

if for all three radiobuttons all three values need to be entered then the logic of obligatory is correct..leave it as it..