cancel
Showing results for 
Search instead for 
Did you mean: 

Set user as employee responsible at account creation

Former Member
0 Kudos

Dear all,

Currently, in CRM 2007 i have a customized IC profile, that uses the component IUICMD for account creation.

When an account is created by an IC agent, the employee responsible is not set, and the relationship (is employee responsible) is not created between the USER and the ACCOUNT.

I would like to know how to set this relationship in customizing. Otherwise, if it has to be coded, is there a FM i can use?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello everyone,

In the end, i implemented EH_ONSAVE, in component IUICMD/CreateOrg , IUICMD/CreatePerson , to create the relationship, using the following FM :

CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CREATE'

           EXPORTING

             BUSINESSPARTNER1               = lv_bp

             BUSINESSPARTNER2               = lv_bp_user

             RELATIONSHIPCATEGORY           = 'BUR011'

             .

     

" Then it is necessary to call this FM to commit the changes.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

Thank you all for your replies.

Cheers.

Answers (2)

Answers (2)

former_member206281
Active Participant
0 Kudos

Could you check if this BADI is called when an account is created.

Badi : BADI_CRM_BP_UIU_DEFAULTS

Create an implementation for BADI_CRM_BP_UIU_DEFAULTS

Method : IF_UIU_BP_DEFAULTS~GET_DEFAULT_VALUES

Try if this method is being called in your case(IUICMD ) . If it is being called then you can code here

Hope it helps

Regards

Chandrakant Kulkarni

0 Kudos

Hi Blaz,

You have to create an account first. Then you have to attach your user as an employee to this account. For that, you need to select the BP role employee in bp transaction. Then go to the identification tab->employee data, enter your employee number and user name.

Best Regards,

Leon

Former Member
0 Kudos

Hi Leon,

Thanks for your reply. Actually what i am trying to achieve here is that for every new account created, the employee responsible is the user that is creating it.

This happens for instance when i log in with SALESPRO profile. The creation of new account is in component BP_HEAD, and by default there is a field employee responsible, that contains the current user.

Any idea?

Thanks again. 

Former Member
0 Kudos

Hi Blaz,

If you want to default the user as an employee responsible to the account, then in the DO_PREPARE_OUTPUT method of view BP_HEAD/AccountDetails, get the current entity of context node EMPLOYEERESPONSIBLE and set the partner2 value ( check out partner1 if its filled then fill partner2 else vice versa)

Regards,

Nithish

Former Member
0 Kudos

Hi Nithish,

Thanks for your reply. The thing is, i am not using component BP_HEAD. Instead im using IUICMD for account creation. And it does not have a context node EMPLOYEERESPONSIBLE.


Former Member
0 Kudos

Sorry Blaz. I missed out your earlier post.

If you want to replicate the same , then first you need to identify the view where Account creation is happening . Probably in the DO_PREPARE_OUTPUT of the view , you have to create the employee relationship entity via relation  BuilEmpRelationRel .

Check out the method ON_NEW_FOCUS of context node EMPLOYEERESPONSIBLE in BP_HEAD.  There you can see many checks are being performed. You can replicate the same and create the child entity and finally set the values in the created entity.

Regards,

Nithish