首页 > 解决方案 > 使用 Jacob 识别多个 sap 窗口会话

问题描述

当多个 SAP 应用程序窗口打开时,是否有办法使用 Jacob 来识别这些 SAP 会话。

我目前正在使用以下代码块来识别会话,并且它在仅打开一个 SAP 窗口时工作。

public ActiveXComponent getSapSession() {
    ComThread.InitSTA();
    this.SAPROTWr = new ActiveXComponent("SapROTWr.SapROTWrapper");

    try {
        this.ROTEntry = this.SAPROTWr.invoke("GetROTEntry", "SAPGUI").toDispatch();
        this.ScriptEngine = Dispatch.call(this.ROTEntry, "GetScriptingEngine");
        this.GUIApp = new ActiveXComponent(this.ScriptEngine.toDispatch());
        this.Connection = new ActiveXComponent(this.GUIApp.invoke("Children", 0).toDispatch());
        this.Session = new ActiveXComponent(this.Connection.invoke("Children", 0).toDispatch());
    } catch (Exception var2) {
        System.out.println(var2.getMessage().toString());
    }
    return this.Session;
}

在打开多个 SAP 窗口的情况下,Jacob 是否能够唯一识别这些窗口?

如果是这样,我们该怎么做?感谢您的回答。

标签: sapui5jacob

解决方案


推荐阅读