04-12-2006 11:37 AM
Hi all!
I'm working in HR module and I've problems to retrieve the organizational unit. From the selection screen is posible to select an org unit and all the units dependants from the first one. These units and groups are located into a table called pnpobjid and what I need is to retrieve which was the original one the 'mother' of all the other, because this pnpobjid table sort the them in an ascending way and the 'mother' is not always the smaller, so could be located in the middle of the table.
Does anybody know some FM or some way to retrieve this originary og unit from pnpobjid?????
Many thanks to all of you!!!
04-12-2006 11:45 AM
Hi
Good
Which version of SAP you r working with bcz i am not getting any table named pnpobjid .
Thanks
M.Tripathy
04-12-2006 11:51 AM
Hi,
I'm using version 6.4.
My report is using logical database called PNP, and pnpobjid belongs to it.
Thanks!
04-12-2006 11:56 AM
hi,
check this FM <b>RP_PNP_ORGSTRUCTURE</b>
<b> CALL FUNCTION 'RP_PNP_ORGSTRUCTURE'
EXPORTING
begda = begda
endda = endda
TABLES
pobjid = pnpobjid.</b>
Regards
vijay
04-12-2006 1:49 PM
Hi Vijay,
thanks for your help but I would need some function to retrieve the orga unit into some variable or something like this. The FM you told me is useful but it returns the result in a graphic way and I can not use it.
Thanks anyway!
04-12-2006 1:56 PM
04-12-2006 2:26 PM
Hi,
why can't you try to select it from infotype PA0001.
the field is <b>ORGEH</b>.
data: l_objid type PA0001-orgeh.
select single ORGEH
from PA0001
into l_objid
where pernr = pernr.
Regards
vijay
04-12-2006 4:23 PM
Hi Vijay,
I have thought also on that, but this method is not useful.
An Organisation Unit could have other Organisations inside and in the field P0001-ORGEH is located the Orga Unit 'son' not the 'mother' one .
Imagine; Orga Unit 430 with both 425 and 450 inside. Employee 000000 is asigned to 450 -> the field P0001-ORGEH for this employee will be 450. But I need to know that the original one is 430. I hope I had known explain it... it's a bit compicated.
Thanks.
04-12-2006 5:16 PM
Hi Gemma,
You will have to use the evaluation path 'O-O' to go all the way up the hierarchy of the Org Units. You can try the following..
Pick an Org Unit from the PNPOBJID table & pass it to the function module RH_PM_GET_STRUCTURE.. In the resultant STRUC_TAB table, the OrgUnit with highest PUP value will be the 'Mother' of all the Org Unnits in PNPOBJID.
Regards,
Suresh Datti