cancel
Showing results for 
Search instead for 
Did you mean: 

How to get user attributes from an iView

Former Member
0 Kudos

Hi,

I am looking forward to know how can i get username from an iView.

EP6.0 SP2.

Thnaks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Julián,

you'll have the IPortalComponentRequest an hand, and with this it's as easy as follows:


IUser user = req.getUser();
String logonID = user.getLogonUid();
String firstName = user.getFirstName();
String lastName = user.getLastName();

Hope it helps

Detlev

PS: Take care to use com.sap.security.api.IUser.

Former Member
0 Kudos

Hi,

I don't know where i should put that code to get it.

I need to know that info, username, firstname..., because in EP60 every user have a unique user but systems that connect EP to R/3 and CRM uses a generic user and BAPIS in R3 and CRM don't know who is the request's user if i don't tell it explicit.

In conclusion, what i need is:

+ to get user info in a BSP iView

+ to call a BSP telling all the parameter i need.

+ BSP call BAPIS and RFC telling them which user (and other info) is in action.

Former Member
0 Kudos

Hi,

if you are using AbstractPortalComponent put that block of code in your doContent method, if you are using JSPDynPage, put that in doInitialization method. Basically you can retrieve the user information in any method wherever you have the IPortalComponentRequest object in hand. This will return info about the current user only. If you want to retieve info about users other than the logged in user you have to use the UME API for that.

Hope this helps!!!

Shubhadip

Former Member
0 Kudos

Hi,

Thank you a lot!

But i would like only use standard iViews and i don't wanna edit iViews:

When i create a new BSP iView there is a field named application parameters and i thought it could help me. Maybe there are other ways to pass user info without editting the iViews, no?

Thank you again.

detlev_beutner
Active Contributor
0 Kudos

Hi Julián,

in fact, I've never worked with BSP iViews and so I don't know if there is a direct way to achieve what you want. Maybe you should ask within BSP forum...

A possibility would be to create a proxy iView around the BSP iView (in fact: before the BSP AppIntegrator component) which reads the user names and passes this as application params to the BSP component. But this is

Beginner

Medium

Advanced

Also see http://help.sap.com/saphelp_nw04/helpdata/en/16/1e0541a407f06fe10000000a1550b0/frameset.htm

Hope it helps

Detlev