cancel
Showing results for 
Search instead for 
Did you mean: 

Employee ID for contact/account: stored in which database table?

Wolfgang_Mayer
Active Participant
0 Kudos

Hello,

in CRM 2007 you can maintain an employee ID for an account or contact. This assignment is not stored as a relationship (like "has responsible employee"). I tried to figure out where this information is stored in the database using the F2 fieldinfos, however, didn't find it using the workbench BSP_WD_CMPWB nor in the GENIL_BOL_BROWSER or GENIL_OBJECT_BROWSER.

Does anyone know in which database table this information about the employee ID is stored? The standard relationships are stored in BUT050, however, as mentioned before, this information is not stored as relationship.

I checked the forum entries dealing with similar issues, however, didn't find the solution yet.

Many thanks & regards

Wolfgang

Accepted Solutions (0)

Answers (3)

Answers (3)

CarstenKasper
Active Contributor
0 Kudos

Hi Wolfgang,

SAP is a company as everyone else. There work people as everywhere else. People tend to be lazy. Why should they implement a different logic?

Have a look at view View BP_CONT/SalesEmployee. There is field Sales Employee at top right corner, which gets its data from /SALESEMPLOYEE/STRUCT.SALESEMPLOYEE.

Cause I am lazy, too, somtimes, I have a look at method ON_NEW_FOCUS() of the context node. As expected SAP employees try to reuse code to have more time for other things. The call the same method as in the EMPLOYEERESPONSIBLE node of the BP_HEAD view...

It should be clear now, that equal BOL objects mean equal implementation classes. This means -> same logic ->same FuBa -> same table.

Ok, SAP often does whimsical stuff in their coding, so I wanted to be on the safe side and had a look at method SET_SALESEMPLOYEE(). To my relieve nothing wired is done here either.

cheers Carsten

Wolfgang_Mayer
Active Participant
0 Kudos

Hi,

that sounds great, however, the data is not stored in the relationship table BUT050. I've maintained the BP number of my employee data in the field for the sales employee on the contact view and saved data --> no relationships are shown and nothing has been stored in table BUT050. The data is persistent, means, if I log off the web UI and re-logon, the number of my BP is still contained in the sales emp field.

Regards

Wolfgang

CarstenKasper
Active Contributor
0 Kudos

Moin Wolfgang,

did you set a breakpoint in front of the function module I mentioned in my first post? If I am right, the debugger should stop at it, while you open the transaction. There you can see for which keys an entry should have been written.

In case there is no entry in the BUT050, but the function module returns a result, there are more databases read inside the function module.

In case the function module is not called, I am on the wrong track and the data source is somewhere else.

cheers Carsten

Wolfgang_Mayer
Active Participant
0 Kudos

Hi Carsten,

fm BUPA_RELATIONSHIPS_GET is called but only for relationship category BUR001 (contact person), not for BUR011 or CRMH06 (assigned [sales] employee). However, I gave you another 2 points for your help.

Regards

Wolfgang

Wolfgang_Mayer
Active Participant
0 Kudos

Hello guys,

here's the answer from SAP support:

the employee responsible that is maintained for an account works

like you are expecting. If you are assigning an employee responsible

there a relationship 'is the emplyoee responsible of' directly

between the account and this employee is created, which is also

visible in BUT050.

The sales employee however is not assigned directly to an account,

nor directly assigned to a contact, but it is an attribute of the

'is contact person of' relationship between an account and a contact,

it is not a relationship by itself.

The sales employee assignment is therefore not visible in table

BUT050, but in table CRMM_BUT_SEMPL01.

The sales employee was delivered in SAP standard configuration of the

contact mainly because there is the corresponding entity in the ERP

customer master, there it is also an attribute of the contact person

and is normally exchanged with this CRM sales employee field.

If you are not using this sales employes in the ERP and if you want

to use the employee responsible instead of the sales employee on the

contact maintenance as well this should be changed in the configuration

of views BP_CONT/ContactDetailsOV, BP_CONT/ContactDetailsEF and

BP_CONT/ContactNewDetailsEF.

CarstenKasper
Active Contributor
0 Kudos

Heh, this is interesting. I really started wondering where this data would be.

I suspected it to be a relation on the account you specify with some kind of reference to the OneOrder. Having an extra table is by no doubt the cleaner solution.

Now I would like to know how they get the data in there

Thanks for posting the solution!

cheers Carsten

CarstenKasper
Active Contributor
0 Kudos

Hi Wolfgang,

I can not tell you which table it is, but maybe it will help you to know which function module is used to retrieve the value:

BUPA_RELATIONSHIPS_GET

importing parameters are:

businesspartnerguid with the BP guid

iv_relationship_category with BUR011

in ET_RELATIONSHIPS there is your Employee Responsible.

The BOL object does some additional authority check and removes some matches where the relation ship is in the wrong order.

cheers Carsten

Wolfgang_Mayer
Active Participant
0 Kudos

Hi Carsten,

once again - since I've mentioned it several times before - this information is not stored as a relationship (table BUT050). The function module you've mentioned deals only with these standard relationships.

Regards

Wolfgang

CarstenKasper
Active Contributor
0 Kudos

Hi Wolfgang,

a short explaination how I got the FuBa:

Hava a look at the field Employee Responsible in view BP_HEAD/AccountDetails. There you will find that the source for the information is the context node EMPLOYEERESPONSIBLE. This context node is related to the BuilHeader with relation BuilEmplResponsRel.

A quick look at the BP BOL model tells us that the corresponding object is BuilEmployeeResponsible with implementation class CL_BUPA_IL_EMP_RESPONSIBLE.

Now when I set a breakpoint in the READ method of the class (actually its super class) I saw this function module.

Now tell me why you believe it is not stored where SAP reads the data from?

cheers Carsten

CarstenKasper
Active Contributor
0 Kudos

Just found this in the setter method


        current->set_property( iv_attr_name = 'PARTNER1'
                               iv_value     = lv_partner1 ).
        current->set_property( iv_attr_name = 'RELATIONSHIPCATEGORY'
                               iv_value     = 'BUR011' ).
        current->set_property( iv_attr_name = 'PARTNER2'    "#EC NOTEXT
                               iv_value     = <nval> ).
        current->set_property( iv_attr_name = 'DEFAULTRELATIONSHIP'"#EC NOTEXT
                               iv_value     = abap_true ).

SAP likes to have hardcoded stuff in their implementations. Do not you dare changing relations 😛

cheers Carsten

Wolfgang_Mayer
Active Participant
0 Kudos

Hi Carsten,

thanks for your postings, this explains the behaviour for accounts, however, not yet for contacts. I actually was talking about contacts but thought it was the same for accounts as well - my fault.

In the contacts view you can assign an employee - after assigning an account - on the upper right (at least in the default settings). This is not stored as relationship.

Regards

Wolfgang

Former Member
0 Kudos

Hi Wolfgang,

The BP ID is held in table BUT0ID

Hope this helps

Regards,

David

Wolfgang_Mayer
Active Participant
0 Kudos

Hello David,

the employee ID assigned in the account view or contact view is unfortunately not stored in table BUT0ID.

Regards

Wolfgang

BGarcia
Active Contributor
0 Kudos

Hi Wolgang,

The relation is at HRP1001. To get it, try this:

1. Go to SE16, table HRP1001

2. Enter in SOBID the user name

3. Check for RELAT = 208, what is the objid

4. Go back, and now enter at OBJID the OBJID in step 3 (don't forget to erase the SOBID value)

5. Check the result for RELAT = 207. You'll find the BP number at field SOBID.

However, that are some FM to get this info like BUPA_CENTRAL_GET_DETAIL (get user by partner id) or BP_BUPA_SEARCH_BY_USER (get partner id by user). I think will be more useful to you.

Kind regards.

PS.: Think I misunderstood it. I though you wanted the user id... (it's friday...need weekend to rest ). You can find the employee ID using the same logic, but instead using RELAT = 208, use RELAT = 209.

Edited by: Bruno Garcia on Nov 7, 2008 10:01 AM

Wolfgang_Mayer
Active Participant
0 Kudos

Hello Bruno,

there seems to be some kind of misunderstanding: in the CRM 2007 web UI you're able to assign an employee to an account (company). This employee is some kind of responsible for this account (company). I'm not talking about storing SU01 user name and personell number of an employee itself, but this new field coming with the web UI. As mentioned before, this field seems to be like "responsible employee" but not storing a relationship for it. In this field you enter the BP number of the employee.

For the accounts, the F2 help tells this info:

component = BP_HEAD

context node = EMPLOYEERESPONSIBLE

view = AccountDetails

attribute = STRUCT.PARTNER2

Regards

Wolfgang

BGarcia
Active Contributor
0 Kudos

Hi Wolfgang,

Seems today I can't get it right

I'm using CRM5.0 and don't have available any 2007 CRM system here now.

But can you tell me if in BP t-code, you are able to find the field you want? If you can, can you tell me where and I'll try to help you locate it (if available also in this version).

Kind regards.

Wolfgang_Mayer
Active Participant
0 Kudos

Hello Bruno,

as I've mentioned before this field (assignment of an employee without using relationships) wasn't available in the GUI releases (<= 5.0), and - of course - not in the (meanwhile obsolete) GUI in CRM 2007.

Regards

Wolfgang