I have a set of scripts that basically log into SAP and run a transaction. They normally work great, but around the end of the month, we typically have system messages posted (where someone sends a message to every user that pops up prior to allowing anything else to be done). These pause the autoit script, and I haven't found a good way to work around them, mostly because they only pop up once a month, and once you acknowledge it, they never reappear. Below is an example script.
Has anyone come up with a solution to this?
Thanks!
Charles
Has anyone come up with a solution to this?
Thanks!
Charles
[ autoit ]
#include <SAP.au3> $username = "Username" $password = "Password" $SAPVersion = "SAP Logon 640" run("C:\Program Files\SAP\FrontEnd\SAPgui\SAPlogon.Exe") Sleep(2000) if WinActive($SAPVersion) = False Then $SAPVersion = "SAP Logon 710" EndIf $sapgui = ObjGet("SAPGUI") $sapapp = $sapgui.GetScriptingEngine $sapapp.openConnection("D50 [SAPPUBLIC]") _SAPSessAttach("SAP") _SAPObjValueSet("usr/txtRSYST-BNAME",$username) _SAPObjValueSet("usr/pwdRSYST-BCODE",$password) send("{Enter}") if not WinActive("SAP Easy Access","") Then WinActivate("SAP Easy Access","") WinWaitActive("SAP Easy Access","") EndIf ;tell it which transaction to run _SAPSessAttach("SAP Easy Access") $sap_session.findById("wnd[0]/tbar[0]/okcd").text = "/nCA51" _SAPVKeysSend("Enter")