Jump to content
Sign in to follow this  

SAP System Messages causing issues with AutoIt

Recommended Posts


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?



#include <SAP.au3>

$username = "Username"
$password = "Password"

$SAPVersion = "SAP Logon 640"
run("C:\Program Files\SAP\FrontEnd\SAPgui\SAPlogon.Exe")
if WinActive($SAPVersion) = False Then
$SAPVersion = "SAP Logon 710"

$sapgui = ObjGet("SAPGUI")
$sapapp = $sapgui.GetScriptingEngine
$sapapp.openConnection("D50 [SAPPUBLIC]")

if not WinActive("SAP Easy Access","") Then
WinActivate("SAP Easy Access","")
WinWaitActive("SAP Easy Access","")
;tell it which transaction to run
_SAPSessAttach("SAP Easy Access")
$sap_session.findById("wnd[0]/tbar[0]/okcd").text = "/nCA51"

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this