Application Development 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: 

Origin org unit in pnpobjid table

Former Member
0 Kudos

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!!!

8 REPLIES 8

Former Member
0 Kudos

Hi

Good

Which version of SAP you r working with bcz i am not getting any table named pnpobjid .

Thanks

M.Tripathy

0 Kudos

Hi,

I'm using version 6.4.

My report is using logical database called PNP, and pnpobjid belongs to it.

Thanks!

0 Kudos

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

0 Kudos

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!

0 Kudos

ok i will find out.

Regards

vijay

0 Kudos

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

0 Kudos

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.

0 Kudos

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