cancel
Showing results for 
Search instead for 
Did you mean: 

Update Supervisor/ manager of an employee

nilesh_bhayani2
Explorer
0 Kudos

Hi,

I want to develop a report/ interface to change supervisor/ manager of an employee using incoming file from third-party system.

I have checked different ways to update manager field and still the only way I find is update table HRP1001 but updating a standard table directly seems to be not a good idea and it is also not advisable. I didn't get any BAPI/ FM to achieve this output.

Is there any BAPI/ FM which can be used to update manager id for an employee?

Regards,

Nilesh

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Nilesh,

Try using FM RH_RELATION_MAINTAIN to update HRP1001. Using this you can achieve updating Manager  ID.

thanks,

naren

nilesh_bhayani2
Explorer
0 Kudos

Hi Naren,

Thanks for the information. I have checked in HRP1001 table and there is an employee: 50000003 with Object Type: 'O', relationship A002, with SOBID: 50000001, so with use of RH_RELATION_MAINTAIN it has updated SOBID, is that sufficient to change manager of an employee?

Regards,

Nilesh

0 Kudos

It depends on your design how you utilize this FM. Are you trying to change the chief of the Org unit where Emp belongs to or moving Position of the emp to the org unit where new supervisor is chief?

nilesh_bhayani2
Explorer
0 Kudos

Hi Naren,

As per functional consultant requirement, these both scenario might come. It depends on Incoming file data that whether employee will be moved to new Org. Unit or Manager of same Org. Unit will be changed.

0 Kudos

Then it works fine.. Check PA0001 record too once update done.

nilesh_bhayani2
Explorer
0 Kudos

so this FM will work in both scenario or is there any other FM, I might have to use, any idea?

If you have implemented similar requirement in past then can you please share sample code, how you achieved it?

0 Kudos

Yes, it works in both the scenario. I'm functional consultant and I have done similar requirement in my previous organisation. I do not have sample code but I can guide you in implementing it.

nilesh_bhayani2
Explorer
0 Kudos

Hi Naren,

I am using FM RH_RELATION_MAINTAIN to change manager of an employee (for requirement to assign manager of different Org. unit).

I am passing details as given below and

1. it is adding a new record in HRP1001 table with Start date: sy-datum and end date:      31.12.9999 (same as passed to FM)

2. It is updating already existing current record End date with: sy-datum - 1 (as we passed sy-datum in FM)

Is this the only thing we need to update to change manager of an Org. Unit?

CALL FUNCTION 'RH_RELATION_MAINTAIN'
EXPORTING
act_fcode                       
= 'INSE'                                
act_plvar                        
= '01'                                     
act_otype                      
= 'O'                                      
act_objid                        
= objid                                  " HRP1001 - OBJID
act_istat                          
= 1                                       
act_rsign                         
= 'A'                                      
act_relat                         
= '002'                                  
act_sclas                         
= 'O'                                      
act_sobid                       
= sobid                                 " HRP1001-SOBID - ID of Related Object(manager id)
act_begda                      
= sy-datum                        
act_endda                     
= '99991231'     
act_priox                        
= priox                                 "HRP1001-PRIOX
IMPORTING
rel_istat                          
= rel_istat
rel_rsign                         
= rel_rsign
rel_relat                          
= rel_relat
rel_sclas                          
= rel_sclas
rel_sobid                        
= rel_sobid
rel_begda                      
= rel_begda
rel_endda                      
= rel_endda
EXCEPTIONS
maintainance_failed  
= 1
others                                = 2.

0 Kudos

Hi Nilesh,

Let me understand what you are trying to do functionally. Are you moving org unit in Emp's PA0001 record to new org unit where new supervisor is manager. Is my understanding correct?

nilesh_bhayani2
Explorer
0 Kudos

Hi Naren,

I am trying to change manager of an Org. Unit where employee belongs to. This way if manager if an Org. Unit changed all employee will report to the new manager, right?

Do you see any extra steps/ relationship needs to change to achieve above requirement?

0 Kudos

yes. If you chnage the manager of the org unit, it chnages for all employees under that org unit.

For this you need to map below relationship in this FM,

act_otype                       = 'O'                                      
act_objid                        
= objid                         " Org unit ID
act_istat                          
= 1                                       
act_rsign                         
= 'B'                                      
act_relat                         
= '012'                                  
act_sclas                         
= 'S'                                      
act_sobid                       
= sobid                " new manager's position number 

nilesh_bhayani2
Explorer
0 Kudos

Hi Naren,

So here in this case, Do I need to first create new position and then assign New manager to that position or directly passing manager(PERNR) to act_sobid will be sufficient?

0 Kudos

you will get position of manager from field PLANS of table for Manager ID. use that as sobid.

nilesh_bhayani2
Explorer
0 Kudos

okay, I checked it in system, so this means it will directly assign position to Org. Unit and as this position is for manager all employee will directly report to it, rgt?

But I don't see any change in previous B012 relationship(for previous manager), there should be some change in that records also, rgt?

0 Kudos

Can you share the screenshot of HRP1001 record pls.

ChrisSolomon
Active Contributor
0 Kudos

There are sooooooo many considerations you need to make and questions Narendra is not asking (or just assuming).

1. Are you sure you have OM-to-PA synchronization turned on?

2. Do you re-use positions or are you trying to create a new position, move the manager there and then updated relations off that "new" position?

3. Do you use inheritance in OM?

4. Do you allow multiple "chiefs" per employee?

5. Do you allow managers to be "chief" of multiple orgs? (ie. if assigning them as manager of another org, do you have to end date all other "chief" assignments they hold?

.....and that's just a few off the top of my head as I am waking up with my morning coffee.

I think for you initial question....what function to use....you got your answer. Past that, you requirements and own configuration will dictate a lot more. Just curious....have you looked at HCM Processes and Forms to handle this and put some control around the process? It also has "mass change" capabilities you might want as well. Even if coming from a 3rd party interface, you could have that "kick off" your HCM P&F process.

nilesh_bhayani2
Explorer
0 Kudos

PFB screenshot, highlighted in yellow color are previous records(before change) and others are new records added using FM still old records have same Start Date and End Date, is that fine?

0 Kudos

Pls refer the questions by Christoper which are very much important to follow.

If everything is in sync then ask your functional consultant to maintain valid time constraint (1 or 2) for O to S B012 relationship in table T777Z.

Answers (0)