cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Screen Personas 2.0 Validate one field

Former Member
0 Kudos

Hello,

I want to insert the username/usuario, click on "Find/Buscar" and after that appears the name/nombre and the surname/apellido.

It works fine but I want to validate it:

- If the field is empty appears a message saying "Field Empty/Nombre Vacio"

- If the user doesn't exist apperar the message saying "User doesn't Exist/Usuario no existe"

This is my Script:

My problem is in line 8 to below,

How can I check if the user does not exist?

To catch the information about the user I don't have problems. The problem is to know if the user exist or not.

With those lines of the script:

if the field is empty appers the message "Field Empty/Nombre Vacio" OK

if I write an existing username it goes to the screen with the user OK

if I write an false username it goes to the next screen without returning to the main screen saying the error message "User does not exist/Usuario no existe" NO OK

Best regards.

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

There are two possibilities to handle this:

- If the user name is not empty and your logic goes to the next screen, your script needs to check if an error message appears after step 8. So just Refresh Screen and check the content of ses[0]/wnd[0]/sbar and if you have an error message there, then simply add a script step, returning to your first screen and display the message "User doesn't exist".
- Alternatively, you could also call a webRFC before step 6 and check whether the user exists. If it doesn't, then don't continue to SU01 and display an appropriate error message.

Going with the first option seems to be simpler... and it doesn't require ABAP coding so that would be my recommendation.

shane_kelly2
Participant
0 Kudos

Hi Tamas - do you have any documentation on how to go the webRFC route?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shane,

I don't have specific documentation on this particular use case, but if all you need is to check whether the user exists, then it is very simple to create a WebRFC wrapper for function module BAPI_USER_EXISTENCE_CHECK, for instance. Detailed WebRFC instructions for Personas have been posted here on SCN by Sebastian Steinhauer and Steve Rumsby, so an ABAP developer can take care of this easily.

Tamas.

shane_kelly2
Participant
0 Kudos

Are there any Personas consultants you would recommend to help us with this problem?  I don't have internal resources that know Personas and WebRFCs to help.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm sure that could help with this.

Former Member
0 Kudos

HI,

i can assist.   little busy now. I'll post a solution either later today or tomorrow.

cheers

rich

Answers (0)