cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Users in UME from Web Dynpro Application

Former Member
0 Kudos

Hi,

1. I have created one web dynpro application which creates portal users.

2. Users are getting created but somehow Login Id is not getting created.

3. Checked in Portal -- User Adiministration also.

4. Also I am not able to login using those username & pwd.

5. It shows all other details like first name, last name, unique name & display name except Login id.

What may be the problem?

Thanks in advance,

Best regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

creating a new user

IUserFactory userfact = UMFactory.getUserFactory();

IUserMaint userMaint = userfact.newUser("TestUser");

userMaint.setDisplayName("My Name");

userMaint.setFirstName("Test");

userMaint.setLastName("User");

userMaint.save();

userMaint.commit();

assigning a role (in this case 'administrator') to the user

IRole role = null;

role=UMFactory.getRoleFactory().getRoleByUniqueName("Administrator");

if(null!=role)

{

wdComponentAPI.getMessageManager().reportSuccess("Adding User::"userMaint.getName()" to role ::"+role.getDisplayName());

UMFactory.getRoleFactory().addUserToRole(userMaint.getUniqueID(),role.getUniqueID());

}

creating an account for the user

IUserAccountFactory accountFact = UMFactory.getUserAccountFactory();

IUserAccount account = accountFact.newUserAccount("MyLogonID",userMaint.getUniqueID());

account.setPassword("password");

account.save();

account.commit();

Now you will be able to login with user name 'MyLogonID' and password 'password'.

hope it wil help u.

Thanks

Abhilasha

Answers (3)

Answers (3)

Former Member
0 Kudos

I got the required result

Former Member
0 Kudos

Hi Nilesh,

go through this doc:[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0bd5112-4456-2b10-c28b-9654d5ae8111]

hpe it hlps

Regards

Khushboo

siddharth_jain
Active Contributor
0 Kudos

Hi,

Verify your code with code posted in the following WIKI :

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/createandeditEPuserwithJava+code

Siddharth