on 07-26-2010 10:28 PM
I'm trying to write a few scripts to automate a few tasks for Basis admins, but I'm new to VBScript and SAP and am having some trouble getting my scripts to launch the SAP GUI. I have scripting enabled in the client and on the server. The souce of this code is from the forums, and may people seem to be able to make it work.
Here is what I have, and when I run it (With SAP Logon running in the background) it bombs out on line 3:
1 Set SapGui = GetObject("SAPGUI")
2 Set application = SapGui.GetScriptingEngine
3 Set connection = application.OpenConnection("MY_SID", True)
4 Set Session = connection.children(0)
5 session.findById("wnd[0]/usr/txtRSYST-BNAME").text = UNAME
6 session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = PWORD
7 session.findById("wnd[0]").sendVKey 0
And the error is:
Windows Script Host
Line: 3
Char: 1
Error: Error descripiton not available
Code: 800A03E8
Source: saplogon
Any help is greatly appreciated!
Hi Joe,
that's strange, as the syntax seems to be fine.
Only reason I could imagine is, that the "MY_SID" does not exist in SAPLogon...
Hope that helps,
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have solved this problem. What was happening is that I was entering an SID in the application.OpenConnection() method. It has to have the exact Description String as set in the SAP Logon gui.
Since this produces no readable error, I have sent a message reporting a bug.
Thank you to all who helped out, I apprecate your efforts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.