on 04-04-2014 1:22 PM
Hi All,
We are using SAP Portal EP 7.02 SP12 portal. Our basis team added the custom ME field with name Date in the Customized tab inside User Admin role.
So when we search a user id in user admin role. Then we can see the Date ield with an input field inside customized tab. We can provide the date and save this information manually from user admin role.
Requirement is how can we read the custom UME attributeDate for a User using UME API and how can we set the custom field value to current date using UME API for a user in WDJ code?
Thanks & Regards,
Susmita
In order to access ume api you have to add an com.security.api.sda in the used Dcs i.e
DC MetaData - >Used Dcs -> right click and select Add Used Dc.. and then expand sap.com_Sap-JEE_1 and select com.security.api.sda .
Regards
Govardan Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Govardan Raj ,
We have checked the path for the NWA you have suggested. The Name space is not mentioned for the custom field created by basis team.
We will check with basis team and after getting name space name we can use the code as suggested by you, We will inform the test results after deploying code.
Thanks & Regards,
Susmita
hi Susmitha,
for updating the custom attribute value use the below code
//******************************Update****************************??
IUserFactory userFact = UMFactory.getUserFactory();
IUserAccountFactory accFact = UMFactory.getUserAccountFactory();
IUser myuser=userFact.getUserByLogonID(uid);
IUserMaint usermaint=userFact.getMutableUser(myuser.getUniqueID());
String customvaluetype[] = new String[1];
customvaluetype[0]= "xxxx"; xxx is the string value of custom attribute you wanted assign.
usermaint.setAttribute("com.sap.security.core.usermanagement","customval",customvaluetype);
usermaint.commit();
here customval is unique id that you can give for your custom attribute and now this is useful for retreiving the same/
//******************************Update****************************??
// Retreiving
String[] customvaluetype =null;
IUserFactory userFactory=UMFactory.getUserFactory();
IUser userInfo=userFactory.getUserByLogonID(uid); // where uid is login id
customvaluetype =userInfo.getAttribute("com.sap.security.core.usermanagement","customval");
--> now the value from customvaluetype will have the value "xxxx" that was updated above.
hope this code helps .
Regards
Govardan Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi susmita,
yes the name space name is always "com.sap.security.core.usermanagement"and attribute name for custom feild ***Date is the name which you are giving while updating.
In your case are you updating the feild through code or some one else is updating that.. ?
in that case ask them what is the name they have given for that.
Regards
Govardan Raj
Hi
The Custom field is created by basis team .They have followed the approach mentioned in the below link.
We need to update and also read this custom field using UME API code.
Thanks & Regards,
Susmita
hi susmita,
The above code that i have mentioned works, you can try that code, and try to create your own customer feild instead of date some other like department etc..for testing purpose.. and assign a value for that particular TestLoginID (userxxx), and later go to useradmin tab i.e log in as administrator to ep portal and navigate to user administration , search for the userxxx for whom u added this dept and open the customized information tab you can find the department attribute (customised one ) which you have added.
Regards
Govardan
hi susmita ,
you can login to nwa of your server, go to system administration-->administration-->identitymanagement--> click configuration-->select UserAdmin UI Tab.
here you can find
Custom attributes of the user profile
so find the name space your basis team as given and custom feild name that they have given
Like in my case
Administrator-Managed Custom Attributes
com.sap.security.core.usermanagement:Authentication ;Certificate SerialKey;typeofuser
here first one is name space and after that certificate serial key and typeofuser are the custom attribute values that i have created and from webdynpro code im accessing and updating same using above webdynpro code . so I guess it should work for you too.
Regards
Govardan Raj
See the respective chapter of the application help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.