Using the LC LSX to change your password

You can use the LC LSX to create a new SAP password or change your existing password.

  • Change an SAP password that has expired using the NewPassword property.
  • Change a password that has not expired using the ChangePassword property.

Changing an expired password

You can change your expired password using the NewPassword property. This function is only available using the LC LSX.

The following sample script shows how to use this feature:
Dim notessession As New NotesSession
	Dim session As New lcsession()
	Dim target As New LCConnection("sap")
	
	Dim logon As Variant
	
	
	target.Database = "BAPI_REQUISITION_CREATE"
	target.Userid = "user"
	target.Password = "foobar"
	target.Client="800"
	target.Destination="IBM"
	target.SystemNo=03
	target.Language="EN"
	target.Server="is0008"	
	
	On Error Goto logonhandler
	
	logon = True
	Do
		target.Connect	
		If target.Isconnected Then
			logon = False
		End If
	Loop While (logon)
	
	On Error Goto errorhandler
	
	Dim fldLst As New LCFieldList
	Dim fldresult As New LCFieldList
	Dim field As LCField
	Dim number As New LCNumeric
	
	...
	
	Exit Sub
	
errorhandler:
	
	Dim Msg As String
	Dim Msgcode As Long
	Dim status As Integer
	Dim result As String
	
	If session.status <> LCSUCCESS Then
		status = session.GetStatus(result, Msgcode, Msg)
	End If
	Msgbox result
	Exit Sub
	
logonhandler:
	
	If session.status <> LCSUCCESS Then
		status = session.GetStatus(result, Msgcode, Msg)
	End If
	If Msg = "PASSWORD EXPIRED" Then
		target.newpassword = Inputbox$("Please enter new password",
                          "Your SAP password has expired")
		logon = True
		Resume Next
	End If
	If Msg = "INVALID NEW PASSWORD" Then
		target.newpassword = Inputbox$("Please enter new password
                   again","Your new SAP password is not allowed")
		logon = True
		Resume Next
	End If
	
	Msgbox Msg

Changing a non-expired password

You can change your non-expired SAP password using the ChangePassword property. This function is only available using the LC LSX.

The following sample script shows how to use this feature:
Dim notessession As New NotesSession
	Dim session As New lcsession()
	Dim target As New LCConnection("sap")
	
	Dim logon As Variant
	
	target.Database = "BAPI_REQUISITION_CREATE"
	target.Userid = "muster"
	target.Password = "ides"
	target.Client="800"
	target.Destination="IBM"
	target.SystemNo=0
	target.Language="EN"
	target.Server="sapaix.lotus.com"
	
	target.changepassword = "ides"  'This will generate an error, 
							'Because the new password cannot
							'be like the previous 5 passwords.
	
	On Error Goto logonhandler
	
	logon = True
	Do
		target.Connect	
		If target.Isconnected Then
			logon = False
		End If
	Loop While (logon)
	
	On Error Goto errorhandler
	 ...

logonhandler:
	
	If session.status <> LCSUCCESS Then
		status = session.GetStatus(result, Msgcode, Msg)
	End If
	If Msg = "INVALID NEW PASSWORD" Then
	  target.changepassword = Inputbox$("Please enter new password again", _
				           "Your new SAP password is not allowed")
		logon = True
		Resume Next
	End If
	
	Msgbox Msg