on 05-12-2015 10:32 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.