How check if exists the field? SAP GUI Scripting

Nicholas Giudice picture Nicholas Giudice · May 12, 2014 · Viewed 10.8k times · Source

How check if exists the field? I tried it:

If session.findById("wnd[1]").setFocus Then

Answer

ScriptMan picture ScriptMan · May 22, 2014

you can try e.g. the following:

on error resume next
session.findById("wnd[1]").setfocus
if err.number = 0 then
   msgbox "The SAP GUI element exists."
else
   msgbox "The SAP GUI element does not exist."
end if
on error goto 0

Regards, ScriptMan