Jump to content
Sign in to follow this  

Sap Logon

Recommended Posts

Hi All,

        I have created one script in this i logon to sap but i want first logon then log off and then logon and log off.My code working for one time logon and log off but its not working multiple.


Please help me




Share this post

Link to post
Share on other sites

#include <Misc.au3>
#include <SAP.au3>
#include <IE.au3>

$SAPVersion = "SAP Logon 640"
run("C:Program FilesSAPFrontEndSAPguiSAPlogon.Exe")
if WinActive($SAPVersion) = False Then
$SAPVersion = "SAP Logon 720"
Local $file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")

; Read in lines of text until the EOF is reached
While 1
   Local $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    MsgBox(0, "Line read:", $line)


WinActivate("Log Off")
_SAPSessAttach("Log Off")



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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...