cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting in VBS, Problems with accessing tree

Former Member
0 Kudos

Hello together,

is there a sample-scripting for accessing a tree in vbs?

Here is my problem:

I want to know, whether the import of an imported list was successful. The tree looks like this:

here is my source code:

Set vtree = session.findById("wnd[0]/usr/subSUBSCREEN:SAPLSBAL_DISPLAY:0101/cntlSAPLSBAL_DISPLAY_CONTAINER/shellcont/shell/shellcont[0]/shell")

vtree.selectItem "1         1","001"

wscript.Echo "Subtype : " & vtree.subtype

wscript.Echo "Treetype: " & vtree.gettreetype      '2=Column tree

WScript.Echo "SelMode : " & vtree.getSelectionMode '2=Single Item

WScript.Echo "topNode : " & vtree.topNode

WScript.Echo "text1   : " & vtree.getNodeTextByPath("1")

WScript.Echo "itemtype: " & vtree.getitemtype(vtree.getNodeKeyByPath("1"), "000")

WScript.Echo "nodekey : " & vtree.getnodeKeybypath("1")

WScript.Echo "count   : " & vtree.getnodechildrencountbypath("1")

WScript.Echo "image   : " & vtree.getNodeAbapimage("1         1")

WScript.Echo "image   : " & vtree.getNodeAbapimage("2         2")

and the output:

Subtype : Tree

Treetype: 2

SelMode : 2

topNode : 1         1

text1   : Konsistenzprüfung der Sanktionslisten-Entitäten

itemtype: 0

nodekey : 1         1

count   : 500

image1  :

image2  :

How can I be sure that the import was successful?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I solved the problem with this piece of code:

session.findById("wnd[0]/usr/subSUBSCREEN:SAPLSBAL_DISPLAY:0101/cntlSAPLSBAL_DISPLAY_CONTAINER/shellcont/shell/shellcont[0]/shell").doubleClickItem "1     1","001"

Informationen ausblenden

session.findById("wnd[0]/usr/subSUBSCREEN:SAPLSBAL_DISPLAY:0101/cntlSAPLSBAL_DISPLAY_CONTAINER/shellcont/shell/shellcont[1]/shell").pressToolbarButton "%SEL_OTHR"

'verbleibende Zeilen abfragen

If session.findById("wnd[0]/usr/subSUBSCREEN:SAPLSBAL_DISPLAY:0101/cntlSAPLSBAL_DISPLAY_CONTAINER/shellcont/shell/shellcont[1]/shell").rowCount > 0 Then

    MsgBox("Verarbeitung fehlerhaft, Script wird abgebrochen!")

    WScript.quit

End If

Answers (0)