Hi,
Setting a wait statement didn't correct the bug.
For the hwnd, i copied the code you provided but it didn't worked. Maybe i didn't implement it correctly however. I'm not really sure.
Setting a wait statement didn't correct the bug.
For the hwnd, i copied the code you provided but it didn't worked. Maybe i didn't implement it correctly however. I'm not really sure.
Code:
'Step1: Simulate your action to bring the popup window
'Click on the OK button in Login window which will simulate the popup window.
SystemUtil.Run "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe","","C:\Program Files (x86)\SAP\FrontEnd\SAPgui",""
Dialog("SAP Logon 730").WinListView("SysListView32").Activate DataTable("Server", dtGlobalSheet)
'Step 2: Get the HWND of the popup window (assuming that the popup window is the top most window)
'Declare the extern
extern.Declare micLong,"GetForegroundWindow","user32.dll","GetForegroundWindow"
'Get the top most window hwnd
hwnd = extern.GetForegroundWindow()
'Step 3: Assign the HWND value to the Object in OR.
'set the hwnd value in object repository
SAPGuiSession("Session").SetTOProperty "hwnd",hwnd
'Step 4: Continue working with popup window as usual
'perform operation on the top most window objects.
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Client").Set DataTable("Client", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("User").Set DataTable("User", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Password").Set DataTable("Password", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Logon Language").Set DataTable("Language", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SendKey ENTER