繁体   English   中英

SAP Tree GetAbapImage 为不同的图标返回相同的值,如何解决?

[英]SAP Tree GetAbapImage returns same value for different icons, how to solve?

我有 3 种不同的图标来表示记录的状态。 我需要以编程方式(使用 SAP 脚本)读取行并了解它们的状态: 在此处输入图片说明

方法GetAbapImage(key, name)为错误(红色)和成功(绿色)状态返回相同值@5的问题。 对于未处理,它返回值@B

演示我的方法的示例代码片段如下:

Dim container
Set container = session.findById("wnd[0]/usr/cntlMAIN_CONTAINER/shellcont/shell/shellcont[0]/shell/shellcont[2]/shell")
WScript.echo TypeName(container)        'returns: ISapTreeTarget
WScript.echo container.GetTreeType()    'returns: 2
WScript.echo container.GetAbapImage("        230", "STATUS")        'returns: @B
WScript.echo container.GetAbapImage("        235", "STATUS")        'returns: @5
WScript.echo container.GetAbapImage("        243", "STATUS")        'returns: @5

其中 ID 230、235 和 243 分别是屏幕截图上显示的三行的 ID。

非常欢迎关于如何更正确地获取行状态的建议!

作为一个小建议,我只能列出 SAP GUI 脚本环境中的一个解决方案。

例如:

myICON = container.getcellvalue (0, "%_ICON")
if left(myICON,3) = "@5C" then msgbox "red"
if left(myICON,3) = "@5B" then msgbox "green"
if left(myICON,3) = "@BZ" then msgbox "other"

问候, ScriptMan

SAP 树的修改变体可能如下所示:

myICON = container.getitemtext (" 21","STATUS")
if left(myICON,3) = "@5C" then msgbox "red"
if left(myICON,3) = "@5B" then msgbox "green"
if left(myICON,3) = "@BZ" then msgbox "other"

参数“21”是可变的。 当它查看其他颜色时,您会以熟悉的方式注意到。

问候, ScriptMan

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM