on 05-07-2009 10:40 PM
Hi experts,
I need to create a webdynpro with the following steps:
- View to login (two textinput with one button, the first textinput to put the username, the second textinput to put the pass, and the button to execute the login ). (This part it's clear)
The problem is in this part:
- The next view is to change the actual password, I will have three textinput ( first to put the actual password and the others to put the new password), the problem is I don't have idea how to do to it
Any idea?
Thanks in advance,
Jose Manuel
Hi,
With your code I had a mutable exception, I've solve the problem with this code
try{
IUserFactory userfact = UMFactory.getUserFactory();
//get user id of the user to change the password
String userId = wdContext.currentLicenceUsersOutputVNElement().getUserid();
//get user object
IUser specifiedUser = userfact.getUserByLogonID(userId);
//get user maintance object
IUserMaint userMaint = userfact.getMutableUser(specifiedUser.getUniqueID());
//get user account
IUserAccount uacc = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userId);
//create mutable user account
IUserAccount iuacc = UMFactory.getUserAccountFactory().getMutableUserAccount(uacc.getUniqueID());
iuacc.setPassword(wdContext.currentContextElement().getNewPassword());
iuacc.save();
iuacc.commit();
manager.reportSuccess("Password has been reset.");
}
catch (Exception e)
{
manager.reportException("error occured " + e , false);
e.printStackTrace();
}
thanks for you colaboration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jose,
Thanks for your collaborative reply...I'm not sure what you had to go through to come up with that final version of code (when I don't understand why the original version didn't work); but your version works a treat for my Portal Web Service when I ran into the same issue. Thanks.
Cheers,
Matt
Hi,
Following code will help you to start
IWDClientUser user1 = WDClientUser.getCurrentUser();
IUser user = user1.getSAPUser();
IUserAccount userAccount = user.getUserAccounts()[0];
userAccount.setPassword("newPassword");
userAccount.save();
userAccount.commit();
Regards
Ayyapparaj
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.