on 02-16-2008 2:58 AM
I am tired of searching and finding no clear answers.
So here is the situation. I have a vbscript file that automates the SAP GUI. My issue is that I need to get the status text from the status bar after every input is made.
I have tried using findById("wnd[0]/sbar").text, but it does not capture every warning or error message.
Does the status bar object have any other properties besides text?
Any type of response would be greatly appreciated.
-Thanks
Hi there -
the Statusbar has also some "Status" Tags like "Warning, Error, Information"
This can be captured by using this little script:
Set sStatusBar = sapsession.findById("wnd[0]/sbar")
If sStatusBar.Messagetype = "W" Or sStatusBar.Messagetype = "E" Then 'Warning or Error
' Do Something
end if
Set sStatusBar = Nothing
Secondly every Message shoul have an ID
This can be handled by sStatusbar.MessageID and returns Integer Value
Greetings
Thomas B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, the object to look for is type GuistatusBar
here is a VB sample
Function getStatus() As String
If IsNothing(sess) Then
Return "session is not connected"
Else
Return Me.sess.ActiveWindow.FindByName("sbar", "GuiStatusbar").text
End If
End Function
the demo examlpe in my script automation tool sends a /$TAB okcode to a sapgui and the retrieves the text in the statusbar
The tool is in SF is called lbscript
Regards
Btw, there is also a dumpscreen method which creates a text file with all the screen or window elements so you can retrieve them later on.
Here is the line which contains the statusbar message and type
"/app/con[0]/ses[0]/wnd[0]/sbar Name: sbar Type: GuiStatusbar Value: TAB buffer reset Read only Children:7"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW...
I created an error trap which resolved to show the SAP status bar text just fine. You could just as well direct this a txt log file:
On Error GoTo errSAP
~~your code~~
errSAP:
errMessage = session.FindById("wnd[0]/sbar").Text
MsgBox errMessage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, please refer to the thread Andreas is mentioning. Here you will find some examples.
Good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.