‎2008 Apr 08 9:35 AM
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
‎2008 Apr 08 9:39 AM
using default value will solve the problem but I an not supposed to use that.
Regards
Bikas
‎2008 Apr 08 9:39 AM
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.
‎2008 Apr 08 9:39 AM
using default value will solve the problem but I an not supposed to use that.
Regards
Bikas
‎2008 Apr 08 9:42 AM
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...
‎2008 Apr 08 9:44 AM
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.
‎2008 Apr 08 9:52 AM
Hi Prem,
Thanks a lot your reply
can you please explain me how to change the attribute of a parameter ?
Regards
Bikas
‎2008 Apr 08 10:15 AM
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.
‎2008 Apr 08 10:19 AM
‎2008 Apr 08 10:24 AM
hi thr....
thnx for the generous points... i hope im helping too....
‎2008 Apr 08 9:41 AM
In ur 1st field if u need to give a fixed value make it as default.
and then choose the second radio button
‎2008 Apr 08 9:43 AM
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
‎2008 Apr 08 9:46 AM
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.......................
‎2008 Apr 08 9:47 AM
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
‎2008 Apr 08 10:15 AM
Thanks a lot for prompt replies every answer was helpful , I have rewarded maximum points I could to almost every reply
Regards
Bikas