有什么功能可以模拟 sapgui 上的回车按钮吗?

is there any function that I can simulate the enter button on sapgui?

我有我的 GuiSession。 该数据仅在按下输入按钮时保存。 然后我想知道是否有任何我接受发送按钮命令的功能。无需模仿。因为 window 不会总是在焦点上。

我使用 C# .net 5.1 使用 SAPFEWSELib;用于自动化

            var savebutton = guiSession.FindById("/app/con[0]/ses[0]/wnd[0]/tbar[0]/btn[11]") as GuiButton;
            savebutton.Press();
            var aaaa = guiSession.FindById("/app/con[0]/ses[0]/wnd[0]/") as GuiStatusPane;
            //here enter press
            // example: Guisession.SendKey("enter");

sao 只有在我按下回车键时才会保存。如果我按下按钮保存此返回错误,因为不允许

您需要搜索一个 gui 框架 window。 并设定焦点; 这存在一个函数 SendVKey(); 示例:

                GuiFrameWindow tosendenter = guiSession.FindById("/app/con[0]/ses[0]/wnd[0]/") as GuiFrameWindow;

            Console.WriteLine("Simulando enter");
            tosendenter.SetFocus();
            tosendenter.SendVKey(00);

对不起我的英语