headershadow

How to determine the Business Role of a User that logs on in the SAP CRM WEBUI?

Print Friendly

Recently I have been catching up a bit with my CRM knowledge (functional and technical) :-) by doing a google search on SAP CRM blogs, reading SDN topics/posts, diving into interesting questions @ Sapfans.com and using many other useful resources.
One of the questions I found back was the following:
How can I check via debugging what business role a certain user is using to logon to the SAP CRM WEBUI?
In some circumstances it is useful to know the business role a user is using to logon to the SAP CRM WEBUI as you may want to influence the system behavior based on this.
If you look at the class CL_CRM_UI_PROFILE there is a method called IF_CRM_UI_PROFILE~GET_PROFILE
If you set a breakpoint in this method, you can collect this information:

As an example, when I logon with my User ID and password, I get to see all existing business roles (due to using the User Parameter CRM_UI_PROFILE with value *.

Therefore I see the following:

Now as I just set an “external session breakpoint” , when clicking on the business role IC_AGENT, debugging shows me the following result:

 

From my point of view this information is very useful if you want to change the system behavior based on the Business Role a User had logged on with in the SAP CRM WEBUI. As a functional consultant I now can also describe what kind of class/method a developer can use to perform a certain check when writing out my Functional Specification.

 

Davy has been working as an SAP Consultant since 2000 and started working in the SAP IS-U Module , but as of 2002 he has mainly worked as functional SAP CRM consultant and SAP Authorizations consultant.
More about

5 thoughts on “How to determine the Business Role of a User that logs on in the SAP CRM WEBUI?


Comment author said

By Madhav on 18 June 2014 at 13:43

Thanks Davy for the information....
but the business role is blank, if i use the same part of code in the background job.
If i run the same code in the foreground, I am able to fetch the business role.
The only problem is with Background.
Can you please help me on this .?

 

Comment author said

By balarasn on 7 October 2014 at 04:59

Hi Davy,

I would like to know, the Business role at which user is working on after he/she logged into WebUI

thanks
Balarasn

 

Comment author said

By Davy Pelssers on 8 October 2014 at 21:49

Well, there are a couple of options:
either you ask the user (in CRM release 7.0 there is in the right hand bottom of the screen a blue hyperlink on which the user can click, which will call up technical details such as the user who is logged on, the Business role he is using and some other stuff.

OR, if you know his UserID, and are using business role assignment through organizational model assignment, then you can look up to which org unit and position he is assigned, and see what business role is assigned to it.

cheers
Davy

 

Leave a Reply


*