Jump to content

Sap Logon


Recommended Posts

#include <Misc.au3>
#include <SAP.au3>
#include <IE.au3>
_IEErrorHandlerRegister()


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

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

; 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)
sleep(1000)

_SAPSessAttach("SAP")
 ;_SAPObjValueSet("usr/txtRSYST-MANDT","200")
_SAPObjValueSet("usr/txtRSYST-BNAME","test")
_SAPObjValueSet("usr/pwdRSYST-BCODE","password")

_SAPVKeysSend("Enter")
WinActivate("Log Off")
_SAPSessAttach("Log Off")

WEnd

FileClose($file)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...