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

problem in the selection screen

Former Member
0 Likes
1,279

Hi Experts,

In the selection screen there are 4 parameters out of that only 2 will be activated at a time based on the radio button selected by the user this I have done this

But problem is one parameter is mandatory and when user select the next radio button it give message “fill all required fields”

Please help

Fast response will be highly rewarded .

Regards

Bikas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,253

using default value will solve the problem but I an not supposed to use that.

Regards

Bikas

13 REPLIES 13
Read only

Former Member
0 Likes
1,253

hi there...

wat you can do is that never deactivated the mandatory field of the press of any radio button. or if u want to deactivate the field in some case, then on the press of the radio button, assign a value to that parameter by hard coding.

This is as per wat i understood ur problem was. if still have troubles, do get back.. reward if helpful.

Read only

Former Member
0 Likes
1,254

using default value will solve the problem but I an not supposed to use that.

Regards

Bikas

Read only

0 Likes
1,253

remove the Obligatory clause from the field....

and at run time check whether value is entered into field or not...

if value is not entered then give error message to prompt user...

Read only

0 Likes
1,253

ok... in that case, do this thing. on the press of the radio button, change the attribute of the parameter to not mandatory and on the press of any other radio button, reset the attribute to mandatory. i hope this helps..

Do reward if helpful.

Read only

0 Likes
1,253

Hi Prem,

Thanks a lot your reply

can you please explain me how to change the attribute of a parameter ?

Regards

Bikas

Read only

0 Likes
1,253

hi thr...

use screen end screen statement.

screen has many attributes of which , mandatory is also one. chk out by pressing f1 on screen.

once u use screen, all the parameters are considered as elements of the screen. so u can set the property of the element within the screen end screen statements.

i hope it helps, do reward if it does.

Read only

0 Likes
1,252

I have rewarded u highest

Read only

0 Likes
1,252

hi thr....

thnx for the generous points... i hope im helping too....

Read only

Former Member
0 Likes
1,252

In ur 1st field if u need to give a fixed value make it as default.

and then choose the second radio button

Read only

former_member386202
Active Contributor
0 Likes
1,252

Hi,

Do the validation in start of selection event ,becoz while using loop at screen obligatory doesn't work, there is no other option

refer this code

START-OF-SELECTION.

PERFORM sub_validate_screen.

&----


*& Form sub_validate_screen

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sub_validate_screen .

IF p_pres EQ c_x.

IF ( p_pifile IS INITIAL ).

MESSAGE i368(00) WITH text-012 .

LEAVE LIST-PROCESSING.

ELSEIF ( p_pefile IS INITIAL ).

MESSAGE i368(00) WITH text-013.

LEAVE LIST-PROCESSING.

ENDIF.

ELSEIF p_appl EQ c_x.

IF ( p_aifile IS INITIAL ).

MESSAGE i368(00) WITH text-012.

LEAVE LIST-PROCESSING.

ELSEIF ( p_aefile IS INITIAL ).

MESSAGE i368(00) WITH text-013.

LEAVE LIST-PROCESSING.

ENDIF.

ENDIF.

ENDFORM. " sub_validate_screen

Regards,

Prashant

Read only

Former Member
0 Likes
1,252

There is only one way you could eradicate this problem.

Don't declare the parameter as obligatory in declaration part. Instead handle this at event level.

That means in AT SELECTION-SCREEN ON FILED event......

chech that parameter value is not empty like as follows....

AT SELECTION_SCREEN ON P_FILED.

if P_FILED is INITIAL.

display error message.

endif.

reward if useful.......................

Read only

Former Member
0 Likes
1,252

Hi Bikas,

I can sugest you one alternative.May b you can try this.

Put a default value in the mandatory parameter.

Now when you are firing the select query before that just check for which radio button is active. Delete the value from the mandatory parameter if your choice of radio button is second one. After the retreival of data , again populate the parameter with the original value.

Hope this will help.

Regards

Sourabh Verma

Read only

Former Member
0 Likes
1,252

Thanks a lot for prompt replies every answer was helpful , I have rewarded maximum points I could to almost every reply

Regards

Bikas