cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle mandatory fields in SAP Screen Personas

nmkarthikeya
Active Participant
0 Kudos

Hi Experts,

I have created a custom field on MK01 transaction and marked it as mandatory. This field belongs to the second screen of MK01(Name) and if I dont fill this field in the standard transaction error message will be displayed in the status bar.

If this mandatory custom field is not populated I want to display error message in the first screen of MK01.

Is there any way to do this?

One more thing, on pressing enter in this transaction it goes to the next screen can we overwrite this standard behavior and make it stay in the initial screen itself?

Regards,

Karthikeya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Karthikeya,

I think the best way to handle your first question is to check and see if the mandatory field is empty using a script button and a custom error message label.  So the beginning of your script would look something like this:

IF fieldID is empty

     Enter Value "Please fill in all required fields" into your custom label field

IF fieldID is not empty

     Press Enter

     ... all other script steps

In order to override the enter key automatically advancing to the second page, you can link all the textboxes to a script button using the "Link" tool located next to the Color Palette.

Then, when the user presses Enter, it will trigger the button instead of going to the second page. To establish the links, click on a field, then click the Link icon, then select the script button you want to link the field to.

This linking capability, combined with the script piece above should give you what you need.

I hope that helps!  Let me know if you need further guidance.

~ Cheryl

Answers (2)

Answers (2)

0 Kudos

http://scn.sap.com/docs/DOC-35492

Hi Karthikeya,

In Personas you create screens with content merged together from different screens or even from different  transactions. Use If condition in your script to check the value of the mandatory field and depending on it write the following screen to display appropriate message.

Personas also allow you to store all user actions in a script. Here too, you record the user action (key pressed) in the script, Check with the If condition (Enter key) and display the screen accordingly.

0 Kudos

Hi Karthikeya,

You would need to handle the "custom" mandatory fields in your script. Please use "If empty" and populate a warning message for the user in a custom label.

On pressing enter: For working around standard behavior, you would be need scripting.

Staying in initial screen itself depends on your requirement. basically you can use scripting to do that for sure but it depends on so many other things.

Also, for any textbox, on pressing enter, you can invoke your script button by using pushOnEnter property.

Regars,

Sushant