Wednesday, November 24, 2010

To get business role of user


To get business role of user

http://forums.sdn.sap.com/thread.jspa?messageID=9084510#9084510

 

 CL_CRM_UI_PROFILE

 and the method GET_PROFILE


 if it asks for a authorization role check this function module

 SUSR_USER_AUTH_FOR_OBJ_GET


 V_PROFILE ?= CL_CRM_UI_PROFILE=>GET_INSTANCE( ).

CALL METHOD V_PROFILE->IF_CRM_UI_PROFILE~GET_PROFILE
RECEIVING
RV_RESULT = V_ROLE.



Determine the current WebClient Profile

APR 8TH

Posted by johanvz in ABAP Code

No comments

Sometimes you need to determine the WebClient Profile of the logged in user.  The code below you allows you to accomplish this.

In CRM 4.0:
data: lv_profile type crmc_ic_profile .
lv_profile = cl_crm_ic_services=>get_customizing_profiles( ).

In CRM 5.0 and beyond:
data: lr_prof type ref to if_ic_profile,
lv_prof type string.
lr_prof = cl_ic_profile_service=>get_instance( ).
lv_prof = lr_prof->get_profile( ).

ABAP Code, IC WebClient


I dont remember from where i got the below code.. thanks to the author who posted it there..


The relationship of BP(Employee) to Username is as follows:
Tcode: SE16 , In Table HRP1000
Field OTYPE = CP
Field UNAME = Provide Employee username (Should be maintained in Tcode BP, Role= Employee in tab identification)
You'll get OBJID.

Use the OBJID from above in table HRP1001.
OTYPE = CP
OBJID = OBJID (from HRP1000)
RELAT = 207
You'll get the BP number in field SOBID.

 use FM BP_CENTRALPERSON_GET to get BP from USERName and vice versa.


4 comments:

  1. This was a good help for me, thank you.

    ReplyDelete
  2. 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 .?

    ReplyDelete
  3. SAP CRM Functional Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/sap-crm-functional-online-training-48.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, IT Support, Corporate Training institute in India - +919000444287 - +917386622889 - Visakhapatnam,Hyderabad SAP CRM Functional Online Training, SAP CRM Functional Training, SAP CRM Functional, SAP CRM Functional Online Training| SAP CRM Functional Training| SAP CRM Functional| "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"

    ReplyDelete
  4. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor led live training in SAP CRM , kindly Contact GRONYSA
    Click for SAP CRM Course details SAP CRM
    GRONYSA Offer World Class Virtual Instructor led training on SAP CRM. We have industry expert trainer. We provide Training Material and Software Support. GRONYSA has successfully conducted 10,000 + trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    GRONYSA
    E-mail: nitesh.kumar@gronysa.com
    Ph: +91-9632072659/ +1-2142700660
    www.GRONYSA.com


    ReplyDelete