cancel
Showing results for 
Search instead for 
Did you mean: 

In SAP Screen Personas scripting, how to find the value of a field?

mrajesh1
Explorer
0 Kudos
137

In SAP Screen Personas scripting, how to find the value of a field? For example I have varable 

var errorID = session.findById("wnd[0]/XXXXXXX"). Another variable 
var errortxt = errorID.text;
Now I want to see if errortxt field has a string starting with "S" or "E". How do we achieve this in Screen personas scripting?
View Entire Topic
Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

Seems like you are looking for a way to determine if there is a current error or success message on the screen. If so, I'd suggest querying the type of the message by 

if (session.findById("wnd[0]/sbar").messageType == "E"){
... do something
}
Otherwise, if you want to find out what a text starts with, then that is possible by using a simple JavaScript method and this should be applicable.
mrajesh1
Explorer
0 Kudos
Thanks Tamas, that Helps