sap-gui

How to VBA wait for windows save dialogbox and sendkeys

▼魔方 西西 提交于 2021-02-17 06:50:09
问题 I'm creating a macro file that download and save extracted data from SAP old version 7.20 , when the save dialogbox is appear , the windows dialogbox is not detected since my client SAP version is old 7.20. now my resolution on this is the sendkeys but the problem is some of the data is containing large amount that getting unreliable time to send the keys. How to wait for the save dialogbox and when appear sendkeys. Sub test() waitTime (10000) Call SendKeys("{Enter}", True) End Sub Function

SAP GUI script how to test the presence of a message

白昼怎懂夜的黑 提交于 2021-02-11 14:30:12
问题 Below I have a pretty simple and straight forwards script for update Valid To date on Agreement/Contract in SAP. My script runs fine but if the date I want to change to is already the same then there is nothing to change/save and therefore the script stops... After this step session.findById("wnd[1]/usr/btnSPOP-OPTION1").press is performed the message from the system is No data changed and it's after this step the script stops. Message No. 06022 The recording part in the script is based on

Export SAP Data won't open workbook while running

六月ゝ 毕业季﹏ 提交于 2021-01-29 02:20:31
问题 I wrote a code to export data from SAP to an Excel workbook. To do that I open the transaction (IW28 in this case), export the file and save it to a specified location. When the file is opened, I want to copy the data from the exported sheet to my own sheet. The problem is that the exported sheet won't open while I'm running the macro. When I add a breakpoint in my code, the exported sheet opens when the macro stops. Without this breakpoint the exported sheets only opens after the macro had

Export SAP Data won't open workbook while running

喜夏-厌秋 提交于 2021-01-29 02:13:09
问题 I wrote a code to export data from SAP to an Excel workbook. To do that I open the transaction (IW28 in this case), export the file and save it to a specified location. When the file is opened, I want to copy the data from the exported sheet to my own sheet. The problem is that the exported sheet won't open while I'm running the macro. When I add a breakpoint in my code, the exported sheet opens when the macro stops. Without this breakpoint the exported sheets only opens after the macro had

SAP GUI scripting - Button press fails

别等时光非礼了梦想. 提交于 2021-01-24 07:17:40
问题 I am using a macro in an Excel file that runs the SAP GUI. There is a step where, when I click a button in SAP there will be another window that pops up. For that I have written a code like this: session.findbyid("wnd[0]/XX/btnXX").press session.findbyid("wnd[1]/XX/btnXXX").press There is a button ( btnXXX ) in the window ( wnd[1] ). But when I execute this query, I am getting an error object not found for findbyid . When I keep the break point and execute it, it is throwing error on 2nd line

SAP GUI scripting - Button press fails

守給你的承諾、 提交于 2021-01-24 07:15:59
问题 I am using a macro in an Excel file that runs the SAP GUI. There is a step where, when I click a button in SAP there will be another window that pops up. For that I have written a code like this: session.findbyid("wnd[0]/XX/btnXX").press session.findbyid("wnd[1]/XX/btnXXX").press There is a button ( btnXXX ) in the window ( wnd[1] ). But when I execute this query, I am getting an error object not found for findbyid . When I keep the break point and execute it, it is throwing error on 2nd line

How to return SAP error message in excel cell through VBA?

泄露秘密 提交于 2021-01-07 02:30:57
问题 I wrote an automation script that uses the following SAP GUI: objSess.findById("wnd[0]").Maximize objSess.findById("wnd[0]/tbar[0]/okcd").Text = "flqaf" objSess.findById("wnd[0]").sendVKey 0 objSess.findById("wnd[0]").sendVKey 17 objSess.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").CurrentCellColumn = "TEXT" objSess.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").SelectedRows = "0" objSess.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell")

How to close SAP pop-up windows with VBA?

我只是一个虾纸丫 提交于 2020-12-15 07:08:31
问题 I would have liked to have automated several extraction except that when I run the macro I have pop-up windows that annoy me terribly I can make them disappear by pressing enter. Public Sub RunGUIScript() Dim W_Ret As Boolean Dim Société As String Sheets("Extraction").Select Société = Range("b9") Application.SendKeys "{Enter}" ' Connect to SAP W_Ret = Attach_Session If Not W_Ret Then Exit Sub End If On Error GoTo myerr objSess.findById("wnd[0]").maximize objSess.findById("wnd[0]/tbar[0]/okcd"