cancel
Showing results for 
Search instead for 
Did you mean: 

Finding out logged in Org Unit?

amarnath_kathi
Active Contributor
0 Kudos
218

If a user is assigned to multiple org units within a single business role, he/she is given the option to select among the org units when Web UI is launched. After selecting, in the subsequent screens, how to find out dynamically which particular Org Unit he/she logged in through?

I appreciate your time. Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Amar

to get the Business role or profile using user name, pls use the class CL_CRM_UI_PROFILE_DETERM and use the method DETERMINE_PROFILE_VIA_ORG_MGMT.

to determin the logged in role and its organiztion unit proceed as follows

1) Get the user orgunit and roles list using the above said class - methoid which returns table

2) once you got the result get the Business role the user is currently loged in by using the parameter id CRMT_UI_PROFILE it will return the current business role.

3) now read the table in point 1 with this busineess role where u will get the orgunit.

more over there is no static method for the class CL_CRM_UI_PROFILE_DETERM so either you have to create the instance for this class or simply copy the code in the method DETERMINE_PROFILE_VIA_ORG_MGMT and use the same code some where else in the other class method.

Hope this resolves your issue.

Thanks & Regards

Raj

amarnath_kathi
Active Contributor
0 Kudos

Raj,

Thanks for the response but I am looking for a solution in a scenario where mutilpe org units are assigned to a user through a single business role.

laercio_azevedo
Active Participant
0 Kudos

Hi Amarnath,

Did you find any way to solve this issue?

I have the same requirement so I would like to know if you could share your solution for this matter.

Thank you in advanced for any input.

Lalas

BGarcia
Active Contributor
0 Kudos

Hi Amar,

Try to call static method GET_ORG_UNIT of class CL_CRM_IC_SERVICES.

I think it will give the information you need

Kind regards,

Garcia

amarnath_kathi
Active Contributor
0 Kudos

Bruno,

I tried it and also CL_CRM_AUI_SERVICE. They don't return anything. I am calling them in message.htm in component CRMCMP_IC_FRAME/Message. Is this because the method is static?

BGarcia
Active Contributor
0 Kudos

Hi Amar,

In that particular view, I've already had some difficulties to read the org. unit. At the time, I was trying to display the org.unit name in the message area. Since the time wasn't much, we leaved that idea, and only displayed the user name. Seems when the applications loads that view, it loads in a separate process where you don't have any information about the webui user.

In other components, the code I've supplied to you, works perfectly.

Maybe someone else can help you, with a different approach for there.

Kind regards and good luck,

Garcia