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

Screen-Required and error messages

bryan_cain
Contributor
0 Likes
1,289

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
Read only

Former Member
0 Likes
1,182

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

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,183

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

Read only

0 Likes
1,182

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

Read only

Former Member
0 Likes
1,182

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.

Read only

Former Member
0 Likes
1,182

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

Rob

Read only

0 Likes
1,182

That's a really good idea, thanks.

Read only

0 Likes
1,182

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

Rob

Read only

0 Likes
1,182

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

Read only

0 Likes
1,182

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

Rob

Read only

0 Likes
1,182

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

Thanks again.