Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help required in HR/OM Module

Former Member
0 Likes
874

hi

Iam very new to abap hr and om module in hr.

I have a query.My requirement is that i need to get the manager for the employees in the organisation.

Also i need to get the manager last name,first name from pa0002 through nachn,vorna .There is a relationship mentioned for this field in the mapping. Relationship A012 to employee's organisation unit.Using the above information how can i get the manager information for a person in the organisation?Can anyone help me out in this regard?

hi

Iam very new to abap hr and om module in hr.

I have a query.My requirement is that i need to get the manager for the employees in the organisation.

Also i need to get the manager last name,first name from pa0002 through nachn,vorna .There is a relationship mentioned for this field in the mapping. Relationship A012 to employee's organisation unit.Using the above information how can i get the manager information for a person in the organisation?Can anyone help me out in this regard?

6 REPLIES 6
Read only

Former Member
0 Likes
845

>FUNCTION zhr_get_manager.

>*"----


>""Local Interface:

>*" IMPORTING

>*" VALUE(FI_PLANS) TYPE PLANS OPTIONAL

>*" EXPORTING

>*" VALUE(FE_NACHN) TYPE NACHN

>*" VALUE(FE_VORNA) TYPE VORNA

>*" VALUE(FE_PERNR) TYPE PERSNO

>*" EXCEPTIONS

>*" NO_REPORT_TO

>*" NO_POSITION_HOLDER

>*" NO_NAME_FOUND

>*"----


> DATA : lv_sobid LIKE hrp1001-sobid,

> lv_pernr LIKE hrp1001-sobid.

>

>

> 1) Get report-to position.

> SELECT SINGLE sobid FROM hrp1001 INTO lv_sobid WHERE

> otype EQ 'S' AND

> objid EQ fi_plans AND

> plvar EQ '01' AND

> relat EQ '002' AND

> rsign EQ 'A' AND

> sclas EQ 'S' AND

> begda LE sy-datum AND

> endda GE sy-datum.

> IF sy-subrc NE 0.

> RAISE no_report_to.

> ENDIF.

>

>* 2) Get position holder (Manager ID)

> SELECT SINGLE sobid FROM hrp1001 INTO lv_pernr WHERE

> otype EQ 'S' AND

> objid EQ lv_sobid AND

> plvar EQ '01' AND

> relat EQ '008' AND

> rsign EQ 'A' AND

> sclas EQ 'P' AND

> begda LE sy-datum AND

> endda GE sy-datum.

> IF sy-subrc NE 0.

> RAISE no_position_holder.

> ENDIF.

>

>fe_pernr = lv_pernr.

>

>* 3) Get Manager First Name and Last Name.

> SELECT SINGLE vorna nachn FROM pa0002 INTO (fe_vorna, fe_nachn) WHERE

> pernr EQ fe_pernr AND

> begda LE sy-datum AND

> endda GE sy-datum.

> IF sy-subrc NE 0.

> RAISE no_name_found.

> ENDIF.

>

>ENDFUNCTION.

There are other standard functions which you can use as well.

>RH_GET_MANAGER_ASSIGNMENT

Read only

Former Member
0 Likes
845

Thanks a lot.But i have a doubt. why is the relationship A-012 is mentioned? Any ways we are getting the manager by position to position(002) and position to person relationship.

Read only

0 Likes
845

Here are the steps to get the manager.

1. First step is to get the Reports to Relationship via A0002. This will give you the position number of the Manager whom the employee reports to.

2. After you have the position of the manager you need to get the holder of the position with realtionship type A0008. Which will give you the personnel number of the manager.

3. After you have personnel number of the manager you need to get his name from the IT0002.

If you still have doubts let me know.

Never used A012 relationship type. ? Better would be to ask your functional expert about this,

Aman

Read only

0 Likes
845

Thanks a lot. I understood your program and the steps you explained clarified the doubts I have.I need to get the number of successors for each position in the organization. It is to be retrieved from the table HRP5139 with object_status=5. How do i do it?

Read only

0 Likes
845

I don't find this table in ECC 5.

A

Read only

0 Likes
845

Yes i think you will be able to view this table in ECC 6.0

We are working with ECC 6.0.Any ways thanks a lot.