cancel
Showing results for 
Search instead for 
Did you mean: 

Custom User Attributes for Company Codes

Former Member
0 Kudos

Hi all,

I am trying to create a custom attribute in the user profile for company codes.

I am trying to incorporate the same in the master head iView, and depending on this selection I should be changing the content in the content area.

I cannot use client-side eventing as my framework is light and needs to be like that to support high speed portal usage.

Hence I have come up with this approach of user profile attributes, but here I have only observed a way to get the attribute values but not set the values in the code. Can anybody please suggest how can I achieve this?

Thanks,

Harika

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Following code is used to set the custom attribute

API:http://help.sap.com/javadocs/nw04s/sps09/se/com/sap/security/api/IPrincipalMaint.html#setAttribute%28java.lang.String,%20java.lang.String,%20java.lang.String[]%29



IUserFactory userFact = UMFactory.getUserFactory();
IUserMaint modUser = userFact.getMutableUser(<<UNIQUE ID>>);
modUser.setAttribute("com.test", "Custom Param", value );

Regards,

Ayyapparaj

Former Member
0 Kudos

Thanks Ayyapparaj,

If I am to set the existing SAP attribute how should I know the namespace of it?

former_member182598
Active Contributor
0 Kudos

Hi,

The SAP standard attributes will have there own setter methods.

For example

IUserFactory userFactory = UMFactory.getUserFactory();

IUserMaint modUser=userFactory.getMutableUser("<unique ID");

modUser.setTelephone("123456");

modUser.commit();

Thanks

Prashant

Former Member
0 Kudos

Hi,

For standard attributes you can use the setter and getter for that attribute.

If you still want to know the namespace for SAP attributes, as per sap documentation "com.sap.security.core.usermanagement"

Regards,

Ayyapparaj

Answers (0)