SAP GUI 脚本 - 列出 SAP 树节点中的项目/元素 - SM59

问题描述 投票:0回答:0

我想获取 SM59 中“ABAP Connections”文件夹中的项目列表,我有以下代码来检测主文件夹“ABAP Connections”。但是我无法列出文件夹中存在的项目,尝试了here的多种功能,没有运气。

TotalNodes = self.session.findById("wnd[0]/usr/../../shell[1]").GetAllNodeKeys()
    for i in range(0, TotalNodes.Count):
        NodeText = self.session.findById("wnd[0]/usr/../../shell[1]").GetNodeTextByKey(TotalNodes(i))
        if(NodeText == 'ABAP Connections'):
            ChildCount = self.session.findById("wnd[0]/usr/../../shell[1]").getNodeChildrenCount(TotalNodes(i))
            print(ChildCount.real)
        else:
            pass

上面的代码给我输出 0,我需要得到 1 或 2 的输出。

python vbscript sap sap-gui sapscript
© www.soinside.com 2019 - 2024. All rights reserved.