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: 

Screen-Required and error messages

bryan_cain
Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

You could put a comment (say an asterisk) before or after fields which you want to be mandatory.

Rob

0 Kudos

That's a really good idea, thanks.

0 Kudos

Glad to help. I'm a firm believer in looking for simple solutions.

Rob

0 Kudos

So who gets the extra four points? You or Srinivas? He answered my question, but you gave me a solution. Hmm...

0 Kudos

In cases like this, I think you can mark it as "solved on your own". Or you can assign more points.

Rob

0 Kudos

Since I think you both gave equally correct answers, I will mark as solved on my own.

Thanks again.