on 11-30-2016 11:05 PM
in this case i have a License missing code
the message type should be "E"
and it still gose to NO ERROR on the if condition
if session.findById("wnd[0]/sbar").text= "E" then
MSGBOX "ERROR"
else
MSGBOX "NO ERROR"
end if
i want to be able to identify when there's an error on the Status BAR so i can stop the macro and fix that error manually, but i'm not able to get the message type or text.
The message type indicates the seriousness of a message and is visualized by an icon.
Stop: A Cancel
Red: E Error
Yellow: W Warning
Green: I/S Information/success message
no matter what message type i put in the IF condition it will always go to the "NO ERROR " MSGBOX
Hello Andrew,
you can read the MessageType:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If session.findById("wnd[0]/sbar").MessageType = "E" Then
'Your code here
End If
S = Success, W = Warning, E = Error, A = Abort and I = Information
Let us know your result.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stefan,
thank you for your help
i tried it already, but it doesn't seem to work,
i tryed it with all message types: S = Success, W = Warning, E = Error, A = Abort and I = Information
and it will go to "no error"
If session.findById("wnd[0]/sbar").MessageType = "E" Then
MsgBox " ERROR"
Else
MsgBox " NO ERROR
"EndIf
i tryed saving the message type in a variable to print it in an excel sheet but it turns out beeing empty.
MT = session.findById("wnd[0]/sbar").MessageTypeRange
("A2").value= MT
'i also tried
Range("A2").text= MT
Hello Andrew,
sorry, but in our systems is the software component Global Trade Services not available, so I can't trace it direct.
I use as example the SE80 with an error.
It has a splitter, like in your case, and a table beneath. The table is in this case a GridView. Is it possible for you to use Scripting Tracker to analyze your UI?
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew,
thanks for your reply. As far as I can see you don't want to read status bar, it seems that it is a table. Which transaction code do you use? Please describe your proceeding until you get the table with the error entries. So I can retrace your way.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew,
thanks for your reply. Good to hear the news, now you can get your messages.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.