cancel
Showing results for 
Search instead for 
Did you mean: 

Change user information,

Former Member
0 Kudos

Hi

I need to change user information (for example name and email). I find only class and methods that give user info, but nothing to set this informations.

Thanks

Andrea

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Are you using ABAP as your backend UME. Are u able to create users using the UNE interface available in java.

It might be that SAPJSF user has read-only authorizations.

Regards

Bharathwaj

Former Member
0 Kudos

Thank I found error. It's on initialization of

IUserFactory ufact = UMFactory.getUserFactory();

I have use IUserFactory ufact = null

Now I have this error on permissions:

com.sap.security.core.persistence.datasource.PersistenceException: BAPI_USER_CHANGE@EN4CLNT100: ID=01, NUMBER=492, MESSAGE=You are not authorized to change users in group SUPER

Some ideas?

thanks!

Former Member
0 Kudos

Hi Maksim,

thank for your answer.

I try this code:

try {

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

String userId = user.getUniqueName();

wdComponentAPI.getMessageManager().reportWarning(userId);

IUserFactory userfactory = null;

IUserMaint userMaint = userfactory.getMutableUser(userId);

userMaint.setEmail("aaa");

userMaint.commit();

}

catch (Exception e) {

wdComponentAPI.getMessageManager().reportWarning(e.toString());

}

but I have null pointer exception in row userfactory.getMutableUser(userId);

I verify that userId is set to "MYUSERNAME".

What's the problem?

Thank you very much!

Andrea

Former Member
0 Kudos

Here is the problem:

String userId = user.getUniqueName();

Should be

String userId = user.getUniqueID();

VS

former_member182372
Active Contributor
0 Kudos

Hello Andrea,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/user management engine - version 4.0/com/sap/security/api/iuserfactory.html

//Get a user object which can be modified. 
IUserMaint getMutableUser(java.lang.String uniqueId) 

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/user management engine - version 4.0/com/sap/security/api/iusermaint.html

//Sets the user's first name.
boolean setFirstName(java.lang.String firstname) 
//...
//Sets the user's default email address.
boolean setEmail(java.lang.String email)

Don`t forget to call IUserMaint.commit() method to commit changes.

Best regards, Maksim Rashchynski.