cancel
Showing results for 
Search instead for 
Did you mean: 

SAPLogon problem in Excel VBA: Password length restriction ?

Former Member
0 Kudos

Hi All,

In my application i am using a silent logon to the R/3 server.

First time the user enters the credentials:

Set Functions = CreateObject("SAP.Functions")

Set conn = Functions.Connection

.

.

IF conn.logon(0, 0) = True Then 'Saves the username n password temporarily

userlogin = conn.User

userPass = conn.Password

End IF

during the flow of application in some parts the conn.logoff() is called.

After that when there's a need for login the following code's used:

IF conn.logon(1, 1) = True Then 'silent login with the previous user & passowrd

Open_connection = True 'Login success

End If

This works perfectly when the password is less than 8 characters. but silent login fails when the password is more than 8 characters. Could somebody tell me if there's any restriction on the pswd length ? Is there any way to resolve the issue

The variable userpass is long enough to hold any length. I believe issue is with conn.Password - the password property of the connection object.

Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rithesh,

maybe using SAP Logon Tickets is an option for you.

The first time you log on you retrieve the ticket, store it and use it for subsequent logons.

The usage is described in the following thread:

Best regards,

André

Former Member
0 Kudos

Thanks Andre, this sounds interesting. But dint find enough support for Logon tickets in Excel VBA :-(. maybe in .NET we can do it.

Former Member
0 Kudos

Hi Rithesh,

how are you doing ?

earlier systems before 4.6c were limited to an 8 character password

i use a crm 3.2 system which has a similar issue

i just keep the password within 8 chars and all is well, i dont find any justification to spend effort on resolving the issue as it will not yeild any tangible benefits

with respect,

amit

Former Member
0 Kudos

Thanks a lot amit. I wanted to make sure that there's nothing much i can do in excel code to resolve this issue. So this could be because of the password restriction you mentioned.Am new to this field and this's a valuable info.thanks.

now i think if somebody's desparate to resolve this i will have to accept the password in a VB input box. save it in a String and do silent logons always using this string.

Thank you,

Former Member
0 Kudos

Hi Ritesh,

how are you doing ?

thank you for the contribution points.

>>now i think if somebody's desparate to resolve this i will have to accept

>>the password in a VB input box.

>>save it in a String and do silent logons always using this string.

rather than just saving the password, try this,

create the entire connection string once and store in a memory structure [macro, if vba], which can be accessed for the length of that session, which will be lost at it's end

[that is how the .NET web applciation does it as well, and is a simpler policy than storing it on the sheet and reading the sheet every time u need to make a call, and then constructing the connection string, and also if u store it in clear text, it is not really a password now )]

with respect,

amit