亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在C#中的SAP GUIContainerShell上設置當前單元格?

如何在C#中的SAP GUIContainerShell上設置當前單元格?

C#
開心每一天1111 2021-05-20 18:19:52
目前,我正在使用SAP GUI腳本使我的工作自動化,并且在嘗試重新創建記錄的宏時,我在某個特定點遇到了一個問題,該問題我不知道如何翻譯。session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell").setCurrentCell 1,"MAKTX2"session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell").doubleClickCurrentCellsession.findById("wnd[1]/tbar[0]/btn[0]").press我已經閱讀了SAP GUI Scripting API pdf,并且正在努力查看如何操作該.setCurrentCell 1,"MAKTX2"零件。我正在通過以下方式訪問容器單元:GuiContainerShell materials = (GuiContainerShell)session.FindById("wnd[0]/shellcont/shell/shellcont[1]/shell");如何使“材料”雙擊“ MAKTX2”?編輯:完整的SAP GUI腳本:SapROTWr.CSapROTWrapper sapROTWrapper = new SapROTWr.CSapROTWrapper();object SapGuilRot = sapROTWrapper.GetROTEntry("SAPGUI");object engine = SapGuilRot.GetType().InvokeMember("GetScriptingEngine", System.Reflection.BindingFlags.InvokeMethod, null, SapGuilRot, null);GuiApplication GuiApp = (GuiApplication)engine;GuiConnection connection = (GuiConnection)GuiApp.Connections.ElementAt(0);GuiSession session = (GuiSession)connection.Children.ElementAt(0);GuiFrameWindow frame = (GuiFrameWindow)session.FindById("wnd[0]");GuiTextField jobsite = (GuiTextField)session.FindById("wnd[0]/usr/subSA_0100_1:SAPMZCX_CSDSLSBM5001_OFS_OTS:2410/subSA_2410_1:SAPMZCX_CSDSLSBM5001_OFS_OTS:2510/ctxtKUWEV-KUNNR");jobsite.Text = "I033";frame.SendVKey(0);GuiLabel aggregates = (GuiLabel)session.FindById("wnd[1]/usr/lbl[12,3]");aggregates.SetFocus();GuiFrameWindow frame2 = (GuiFrameWindow)session.FindById("wnd[1]");frame2.SendVKey(1);GuiContainerShell materials = (GuiContainerShell)session.FindById("wnd[0]/shellcont/shell/shellcont[1]/shell");
查看完整描述

1 回答

?
慕標5832272

TA貢獻1966條經驗 獲得超4個贊

老實說,我無法為您提供C#的幫助,但也許SAP接口足夠通用。session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell")事實是,您可以引用GuiShell或GuiContainerShell類型的對象或任何被調用的對象。在此參考上,您可以調用為此類型定義的方法。因此,當您這樣做時


session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell").setCurrentCell 1,"MAKTX2"

您只需要先獲得引用,然后setCurrentCell在同一行上應用該方法即可。


當您在C#中執行操作時


GuiContainerShell materials = (GuiContainerShell)session.FindById("wnd[0]/shellcont/shell/shellcont[1]/shell");

您給此引用起了一個名字materials,并提供了正確的行,我想您現在可以說:


materials.setCurrentCell(1, "MAKTX2")

materials.doubleClickCurrentCell


查看完整回答
反對 回復 2021-05-23
  • 1 回答
  • 0 關注
  • 410 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號