mukeshsharma Posted August 27, 2013 Share Posted August 27, 2013 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 Regards Mukesh Link to comment Share on other sites More sharing options...
Chimaera Posted August 27, 2013 Share Posted August 27, 2013 First thing i would post your code or a small reproducer so that people can understand what you are doing and then be able to advise If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
mukeshsharma Posted August 27, 2013 Author Share Posted August 27, 2013 #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 More sharing options...
mukeshsharma Posted August 29, 2013 Author Share Posted August 29, 2013 Whats up? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now