cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get text via SAP-Scripting from type GuiShell Subtype HTMLViewer

WStecher-77
Newcomer
0 Likes
219

I automate SAP with VBA and SAP-Scripting-Interface and I actually need your help, please

When a business partner is opened, SAP displays warnings in a separate bar, e.g., "Please clarify address." I would like to extract this text, but it doesn't seem to be embedded in the element's structure like it would be in a popup. This bar isn't present when there are no warnings, and when there is a warning, it consists of two child elements.

wnd[0]/shellcont[0]/shellcont/shell/shellcont[0]/shell --> The button to hide the entire bar
wnd[0]/shellcont[0]/shellcont/shell/shellcont[1]/shell --> The area containing the text

Some properties of the element containing the text:
BrowserHandle: Nothing
Children.Count: 0
Handle: 788884
ID: wnd[0]/shellcont[0]/shellcont/shell/shellcont[1]/shell
SubType: HTMLViewer
Text: SAP.HTMLControl.1
Type: GuiShell

What I have found so far in my research always leads to the solution of reading the InnerText of the document's body via the BrowserHandle, just as Google's AI does, for example

            Dim shellObj, browserObj, doc, text
         
            Set shellObj = session.FindById("wnd[0]/shellcont[0]/shellcont/shell/shellcont[1]/shell")
            Set browserObj = shellObj.BrowserHandle
            Set doc = browserObj.Document
            text = doc.body.innertext

That won't work for me because the BrowserHandle is set to Nothing.
For your information, since many posts I found mentioned problems with the BrowserHandle in SAP 770, I'm working with SAP 800, patch level 14.

Does anyone have any idea how I can access the text that is displayed in this element?

Accepted Solutions (0)

Answers (0)

Ask a Question