cancel
Showing results for 
Search instead for 
Did you mean: 

Joining PA and HRP tables

Former Member
0 Kudos

Hi,

I need to join PA0001 or PA0105 with HRP1000 so I can get a record that lists the employee name (SNAME) with their  a object name (STEXT). Would this be done by filtering HRP1000 to object type = P and then joining the object id with the personnel number (PERNR)? this is somewhat urgent.


Cheers,

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

Yes. The object id in HRP1000 for object type "person" is the employee ID from PA0001.

....and you can make your life easier by using any one of the several functions/methods that will "match" the two for you.

Former Member
0 Kudos

Thanks, that is very helpful. As for why I am not using the function, I am processing the data externally and only have direct table connections so I have to specific the joins.

ChrisSolomon
Active Contributor
0 Kudos

If you have direct table access, then by finding the "employee" HRP1000 record and making use of "begin data" and "end date", you should then be able to find all the other "relations" that will interest you. This of course assume PD/OM-to-PA integration is "on". This is where knowing OM will come in handy.

  • Find the employee in HRP1000 as described.
  • Find the employee's position by finding the "related" position in table HRP1001.
  • If you want to know the "job" related to the position, again "walk the relations table" HRP1001 and find the job-to-position relation.
  • With the employee's position known, you can then find where it fits in the org chart by finding the related org unit.....yep....do the HRP1001 dance again and find the "position belongs to org unit" relation.
  • With the org unit known, you can then also find out who manages that org unit...in SAP terms, this is the "chief". So again, using the HRP10001 dance steps, you find the "chief" that manages the org unit.
  • Finally, you may want to find the next level up (and upwards still) of where the org unit fits into the larger org chart puzzle. Guess what? Yep...HRP1001 dance again! This time org unit to org unit.

ALL of the HRP10001 dancing will depend on the object type of the "from" and "to" object as well as the "relation" information you will have to look for...for example, the position for the employee(ie."holder") would be relation "B002" looking from holder->to->position.

After that, you can use the other HRP tables to find details (like text/title, abbreviation, related employee group/subgroup, cost center/company code, etc). All of this dancing should match up exactly to table PA00001 for the employee for the same period of time (begin date to end date). Have fun!

Former Member
0 Kudos

Wow I have a lot of work to do now don't I! thank you for the in depth answer!

Answers (2)

Answers (2)

Former Member
0 Kudos

Read PA0105 matching on USRID and Subty = 0001 plus dates.  You get a match then use the PERNR from the matching 105 to read another PA table for that PERNR.

former_member225631
Active Contributor
0 Kudos

Normally Person data 'P' is not maintained in HRP1000. What data would you like to fetch from HRP1000?

Former Member
0 Kudos

I am trying to get the position/rank of an individual. ie executives, analyts management etc. I thought it was in STEXT field.

former_member225631
Active Contributor
0 Kudos

Position text is maintained is table T528T, also we can get from HRP1000, using Otype 'S'.

Former Member
0 Kudos

how do I join t528t with PA0105 or PA0001 as I need to be able to join position with username. (USERID)

antoine_foucault
Active Contributor
0 Kudos

Charles,

Don't join them, join is rather FI or SD abap style... HR is just a lil cleaner do cascade fetching.

1. IT0001

2. IT0105

3. IT1000 or T528T

You can use HR_READ_INFOTYPE function for PA infotype (IT0001 and IT0105), and RH_READ_INFTY_1000 for PD infotype (IT1000) or CL_HR_T528T if you go for T528T. For your scenarios I'd recommend fetching from T528T. For USERID don't forget to evaluate the subtly field for structure P0105 and consider that some subtype are customized to be kept under the _LONG field.

If you use PNP or PNPCE logical DB in the your program you can even forget about HR_READ_INFOTYPE and just declare INFOTYPES: 0001, 0105 in the global area in oder to be able to automatically fetch p0001 and p0105 and loop to access each entries.

Best,

Antoine

Former Member
0 Kudos

Hi Antoine,

As much as I would love to I am using a third party application that only allows connections to tables, so I am still looking for a way to join, from any table frnakly, a user name or personnel number with their position.


Cheers,


Charles

antoine_foucault
Active Contributor
0 Kudos

Oops!!! in that case.... between IT0001 and IT0105 you need to consider

PERNR ENDDA BEGDA; and between IT0001 and T528T consider PLANS.

antoine_foucault
Active Contributor
0 Kudos

Just being curious what third party software are you dealing with?.... let me know if this was enough fields to make your table join working.... and fetching data

Former Member
0 Kudos

A program called ACL