01-26-2007 7:40 PM
Hi all,
I have a question with the "screen-required" component of a selection screen. I have a checkbox (p_hist) that when checked, controls whether or not another field (pdate) is mandatory. The problem is, if you check p_hist accidentally and then uncheck it without populating pdate, SAP raises an error message that you need to populate all required fields.
Is there a way around this besides not using screen-required and instead just checking that the pdate is not initial if p_hist is not initial? I know that will work, but I'd rather give the user some visual clue that the field is now required before giving an error message.
Thanks
01-26-2007 7:51 PM
HI Brian,
try like...
At selection-screen.
if p_date is initial.
if not p_hist is initial.
throw error message.
else.
nothing to do cos check box is not selected.
endif.
endif.
Regards
SAB
01-26-2007 7:51 PM
HI Brian,
try like...
At selection-screen.
if p_date is initial.
if not p_hist is initial.
throw error message.
else.
nothing to do cos check box is not selected.
endif.
endif.
Regards
SAB
01-26-2007 7:54 PM
Hi Syed,
Yes, I thought of that. And I'll use it if I have to, but I prefer the idea of using the screen-required becuase that way when you check p_hist you can see on the screen that the field is now mandatory.
Thanks
01-26-2007 8:03 PM
Unfortunately once you make a parameter required, you cannot change it back to optional unless you enter a value in there. 'Required' property is checked even before calling at selection screen output.
01-26-2007 8:07 PM
You could put a comment (say an asterisk) before or after fields which you want to be mandatory.
Rob
01-26-2007 8:15 PM
01-26-2007 8:20 PM
Glad to help. I'm a firm believer in looking for simple solutions.
Rob
01-26-2007 8:38 PM
So who gets the extra four points? You or Srinivas? He answered my question, but you gave me a solution. Hmm...
01-26-2007 8:45 PM
In cases like this, I think you can mark it as "solved on your own". Or you can assign more points.
Rob
01-26-2007 8:46 PM
Since I think you both gave equally correct answers, I will mark as solved on my own.
Thanks again.