SAP GUI脚本无法获取列名称

2020-08-23 17:06发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 我正在使用tcode /...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

我正在使用tcode /nppoma_crm。 在下面的图片中,我想获取诸如 Assignment Path(CRM),代码,ID,业务部件等之类的列标题,并且我还希望获取诸如 Buyers,Steve Newell,,以便我可以进一步处理数据以查找买方名称是否与其余名称匹配。

下面是我的代码:

如果不是IsObject(application),则
    设置SapGuiAuto = GetObject(" SAPGUI")
    设置应用程序= SapGuiAuto.GetScriptingEngine
 万一
 如果不是IsObject(connection)然后
    设置连接= application.Children(0)
 万一
 如果不是IsObject(session)然后
    设置会话= connection.Children(0)
 万一
 如果IsObject(WScript)然后
    WScript.ConnectObject会话,"打开"
    WScript.ConnectObject应用程序,"打开"
 万一
 session.findById(" wnd [0]")。maximize

 buy_tree = session.findById(" wnd [0]/usr/subMAINSCREEN:SAPLOM_NAVFRAMEWORK_OO_OBJ:1200/subWORKSPACE:SAPLOM_NAVFRAMEWORK_OO_OBJ:0200/subOVERVIEW:SAPLOM_GEN_OVERVIEW:1000/cntlTREE_CONTAINERyShelltlet.shellcont。
 '获得正确的列2减1
 topNode = CStr(buy_Tree.TopNode):键= topNode
 MsgBox(topNode)
 col_CRM = buy_tree.GetListTreeNodeItemCount(" 1")


 MsgBox(col_CRM)
 '设置col_sub_CRM = Tree.GetColumnCol(colName)


 '获取最高节点


 'topNode = CStr(buy_tree.TopNode)
 'cntSubNodes = Tree.GetNodeChildrenCountByPath(topNode)
 'MsgBox(cntSubNodes)
 '对于i = 1到cntSubNodes


 '子节点的路径是1/1、1/2等。


 'NodeName = Tree.GetNodeTextByPath(topNode&"/"&CStr(i))
 'MsgBox(NodeName)
 ' 下一个
 'MsgBox(CStr(buy_tree))
 'i_text = buy_tree.GetItemText(" 2"," ORG_OBJID")
 'MsgBox(i_text)
 '设置name_col = buy_tree.GetColumnNames.Item(" 0")
 '设置Col_items = Tree.GetColumnCol(name_col)
 'intnameCount = name_col.Count
 '设置col_title = buy_tree.GetColumnTitles.Item(" 0")
 'MsgBox(col_title(2))
 'Msgbox("内部购买者")
 'MsgBox(intNameCount)
 'MsgBox(buy_tree.GetColumnTitleFromName(" REL_BUPA"))
 'Msgbox("然后是买家")
 'Msgbox(intnameCount-1)
 '对于i = 0至8'intnameCount-1
 'MsgBox(Col_items.Item(CStr(y)))
 'MsgBox(CStr(i))
 'MsgBox(buy_tree.GetColumnTitleFromName(name_col(y)))
 ' 下一个




 'colName1 = col2_tree.GetColumnNames.Item(" 0")
 'col_name1 = col2_tree.GetColumnTitleFromName(colName1)
 'MsgBox(col_name1)
 'MsgBox(colName)
 'colName2 = col2_tree.GetColumnNames.Item(" 1")
 'col_name2 = col2_tree.GetColumnTitleFromName(colName2)
 'MsgBox(col_name2)
 'MsgBox(colName)
 'ctnodes = Tree.GetNodeChildrenCountByPath(topNode)
 'MsgBox(ctnodes)
 'ctnodes = Tree.GetListTreeNodeItemCount(" 1")
 'MsgBox(ctnodes)
 'MsgBox(Col.Item(" 0"))


 'MsgBox(topNode)
 'cntSubNodes = Tree.GetNodeChildrenCountByPath(topNode)
 'MsgBox(cntSubNodes)
 'itemtext = tree.GetItemText(Key,"&Hierachy")
 'MsgBox(itemtext)
 'GetItemText("&Hierachy")
 'MsgBox(obj.getColumnNames()。get(0))
 'MsgBox()


 

(79.2 kB)