on 09-17-2015 1:25 AM
Dear Scripting experts,
Thanks for the posts on the VBA coding to connect to SAP. Below is the code we were using based on your posting. It was working fine till recent days. Suddenly it was not working and not sure what the issue is.When I debug, coding is ended at Set oConnection = SapGuiApp.OpenConnection("XX2 [public]", True) with an error message "1000: Sap logon connection entry not found". Please let me know if you come across any cases recently. We are on GUI 730. Appreciate your help
Sub Logontrial()
Dim SapGuiApp As Object
Dim oConnection As Object
Dim session As Object
Dim SAPCon As Object, SAPSesi As Object
Dim SAPGUIAuto As Object, SAPApp As Object
'Dim sapConnection As Object
sapID = Sheet1.Cells(i, 1)
sapPassword = Sheet1.Cells(i, 2)
tcode = Sheet1.Cells(i, 3)
Path = Sheet1.Cells(i, 4)
If SapGuiApp Is Nothing Then
Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If oConnection Is Nothing Then
'Application.DisplayAlerts = False
Set oConnection = SapGuiApp.OpenConnection("XX2 [public]", True)
End If
If SAPSesi Is Nothing Then
Set SAPSesi = oConnection.Children(0)
End If
Application.DisplayAlerts = False
With SAPSesi
.FindById("wnd[0]/usr/txtRSYST-MANDT").Text = "100"
.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[1]/usr/pwdRSYST-NCODE").Text = tcode
.FindById("wnd[1]/usr/pwdRSYST-NCOD2").Text = tcode
.FindById("wnd[1]/usr/pwdRSYST-NCOD2").SetFocus
.FindById("wnd[1]").SendVKey 0
Hi Sap Gurus,
We've got the exact same isssue.
Did you find anything else since ?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.