on 03-31-2006 3:02 AM
Dear friends.
I am working with SAP.Net So i am wondering how to solve the first time login for SAP using .Net as front end.
Moreover in the SAP Passwords will be changed every 3 months i would like to know how to handle such scenarios using .net to handle those changes in the SAP.
Cheers
Mark
For non-interactive clients you could use an account where the password never expires or you use one of the SSO features.
For interactive clients you can also use a SSO technique (recommended) or you use the connection string paramter "NEWPASS" to set it during logon. Here is the description of the paramter from the RFC SDK (saprfc.hlp is installed automatically with SAPGUI):
NEWPASS
Changes the password during the logon !!!On SAP system kernel older than 46C the password is sent in clear text on the network!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Reiner,
Nice to hear from you. you mentioned something "NewPASS" right is that other parameter other then password.
When the program connects to SAP with a temp password i am wondering how it will be able to know abt that.
PS: I want to give some points for the information. As i am new to this forum i couldnt can some one tell how i could give points
Regards
mark
NEWPASS is the new password, PASSWD the old one, e.g.
"ASHOST=sap.mycompany.com CLIENT=000 SYSNR=12 USER=user1 PASSWD=old NEWPASS=new". Of cause you need to know the old password, even if it is a temporary one.
I don't know how you find out if or when an account is in the "must change password" state. I assume that you get some exceptions, e.g. a SAPLogonException with some specific argument. I recommend to try it.
Hi Reiner,
Sorry I am kinf of busy so couldnt come to this post. Actually i checked with my abap programmer. He view is that as if the user entered using SSO RFC wont be able to change the password, becoz it opens new window with New password and retype password.
SO do u think RFC has capability to change the password in SAP.
Regards
Sorry, but I don't understand your question.
If you use SSO, you don't need to care about passwords at all. The password would anyway not be used.
Else, if you do use passwords, you can change it via RFC as I described before. I don't think that LIBRFC32 or SAPGUI would bring up a dialog. If you want such a dialog, you can create it on your own.
I assume you want a code sample? Here you are (untested, so consider it as pseudo-code):
SAPProxy proxy = new SAPProxy();
Destination dest = new Destination();
// initialize your Desitnation accordingly here
...
proxy.Connection = Connection.GetConnection(dest);
bool repeat = false;
do
{
try
{
proxy.Connection.Open()
// Note: I think that the need to change password causes an exception here, but I'm not sure. So better try..
}
catch(Exception ex)
{
// Check if the exception was because of password needs to be changed
PasswordDialog passDlg = new PasswordDialog(dest.Password);
passDlg.ShowDialog();
string passwordChangingConnectionString = dest.ConnectionString + " NEWPASS=" + passDlg.NewPassword;
proxy.Connection.Dispose();
proxy.Connection= Connection.GetConnection (passwordChangingConnectionString);
repeat = true;
}
} while(repeat);
proxy.Call();
HI,
Thankx for the code, but i am not looking for .net version i am looking for SAP (RFC code to change the password). we can pass the password along wiht the other variables but when the RFC recieves it, it should provide some mechanism to interact with SAP and change its password.
I guess u got what i am saying
Thanks for the help
regards
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.