cancel
Showing results for 
Search instead for 
Did you mean: 

Sap logon connection entry not found - It was working earlier

Former Member
0 Kudos

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

0 Kudos

Hello Everyone,

Did anybody get a chance to work on the issue? Please provide me the solution to fix the issue.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sap Gurus,

We've got the exact same isssue.

Did you find anything else since ?

Thanks,

script_man
Active Contributor
0 Kudos

Hi Vamsi,

maybe that's useful for you:

https://scn.sap.com/thread/3793207

Regards,

ScriptMan

Former Member
0 Kudos

Hi Script Man,

We have the ini file at same location as mentioned. Still not working.

Thanks

V

script_man
Active Contributor
0 Kudos

Hi Vamsi,

than I would argue that the connection "XX2 [public]" in fact does not exist or is misspelled.

Regards,
ScriptMan

Former Member
0 Kudos

Hi Scriptman,

It was working earlier and no changes to the connection details. It is same but not working from recent days.

Thanks,

Vamsi