cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Screen Personas 2.0 - IF statement on Maxlength attribute of Textfield

Former Member
0 Kudos

Hi SCN,

I've created a script button on the SMEN transaction that will go to transaction SU01D and get all the desired information.

Error handling is also foreseen, if a false username is entered into SU01D the error message will be copied and displayed in the SMEN transaction.

However there is no option to define a "Maxlength" attribute for the textfield resulting in an error when trying to look up a username that is longer than 12 characters:

How can this be integrated into the current functionality (already two IF statements for error handling) of my script button?

I've attached the script button code so you can view the current functionality in SAP Screen Personas.

Thanks in advance for the help!

Kind regards,

Niels De Greef

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You could perhaps have a primary script button that checks the entered string length using a JavaScript step and if the user name length > 12 then display an error message or alert, otherwise press the other script button which continues the regular processing.

So something like this:

former_member105930
Active Participant
0 Kudos

Hi Tamas,

I have been looking at how to get custom error messages to display as a pop up instead of just placing the message on a label field, and this is just the thing I was looking for. Works great.

Thank you

Ian

Former Member
0 Kudos

Hi Tamas,

Thank you for your solution, that does indeed solve my problem.

Kind regards,

Niels

Answers (0)