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.