on 04-20-2016 4:15 PM
Hi all,
I am having trouble in a automation process that am doing. Since this was the first time in SAP scripting i was testing a automation in a test region Local configuration in SAP and the login script worked fine.But when i tried the same with the Production server(Messaging server) i am having trouble in login in. The code is as below
sap = CreateObject("SAPGUI.Scriptingctrl.1")
sapCon = sap.OpenConnectionByConnectionString(sapServer, False)
With sapSession
.FindById("wnd[0]/usr/txtRSYST-BNAME").Text = sapID
.FindById("wnd[0]/usr/pwdRSYST-BCODE").Text = sapPassword
.FindById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
'.FindById("wnd[0]").SendVKey(0)
'.FindById("wnd[0]/tbar[0]/okcd").text = "SE16"
'.FindById("wnd[0]").sendVKey(0)
End With
sapserver="xxxxx.xxxxx.xxx".
When i used it with the Prodution server i got the below error message Connection is refused
This was the first issue when i changed the the server in this format
sapserver="/M/xxxx.xxxxx.xxx/S//G/PG1"
i got this error msg
Logon Balancing parser error.
Can you guys please help me with this issue.Please i really need your help. I would really appreciate it if you guys could help me as soon as possible.
Hello bhagavath,
welcome in the Scripting Language forum.
The same problem is described here. The solution was in this case to add an entry in the hosts file, in the directory windows/system32/drivers/etc. Please check it and let us know your result.
Also interesting is to know if it is possible for you to ping the target system successfully.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello bhagavath,
for a basically check, if it is possible to connect the system, you could use the following VBS program:
'-Begin-----------------------------------------------------------
'-Sub Main------------------------------------------------------
Sub Main()
Set FunctionCtrl = CreateObject("SAP.Functions.Unicode")
Set SAPConn = FunctionCtrl.Connection
If Not SAPConn.Logon(0, False) Then
MsgBox "Logon failed"
Else
MsgBox "Logon successful"
SAPConn.LogOff
End If
End Sub
'-Main-----------------------------------------------------------
Main()
'-End--------------------------------------------------------------
If you work with a 64-bit environment, call it from a x86 console. In a normal case this program opens a tiny logon dialog and you can choose your system.
The connection string looks in my case like this:
Set Con = App.OpenConnectionByConnectionString( _
"/H/10.100.100.100/S/3200", True, False)
/H/IP-Address/S/32 + Systemnumber, to get the system number call FM GET_SYSTEM_NUMBER
In my case this works:
'-Begin------------------------------------------------------------
'-Sub Main-------------------------------------------------------
Sub Main()
sapServer = "/H/10.100.200.300/S/3263"
Set sap = CreateObject("Sapgui.ScriptingCtrl.1")
Set sapCon = _
sap.OpenConnectionByConnectionString(sapServer, True)
If IsObject(sapCon) Then
MsgBox "Connection successful"
Else
MsgBox "Connection failed"
End If
sapCon.Close
End Sub
'-Main-----------------------------------------------------------
Main()
'-End--------------------------------------------------------------
Hint: Don't forget to set the command Set in front of your lines 1 and 2. Also it is necessary to set the variable sapSession.
Let us know your result.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.