cancel
Showing results for 
Search instead for 
Did you mean: 

Function that return Company Code given an Org Unit ID

Former Member
0 Kudos

Hi folks,

As per subject, is there any such function?

I seem unable to find. Straightforward way is just select bukrs from hrp1008 using the Org Unit OBJID. However, that table only stores direct assignment. I.e. many Org Unit actually have the company code inherited from parent OU. So if my OU doesn't have account assignment, must go to its parent OU to find, if parent OU doesn't have, again must go up and search. And so on..

If there's already such function, I don't want to re-invent the wheel.

Thanks!

Regards,

Olyvia

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I know it's an old topic, but the answer could be helpful for others:

use RH_STRUC_GET as suggested, standard WEGID OMACC_U will return the objects maintained in 1008 (including BUKRS, WERKS, BTRTL).

Former Member
0 Kudos

Thanks for the reply.

After debugging PPOSE screen, I have found the function to get inherited BUKRS, it is RH_ACC_FIND_OM.

For those OUs without Inheritance, just get direct from table HRP1008.

former_member201275
Active Contributor
0 Kudos

The function you need is: RH_STRUC_GET.

You will have to play around with the evaluation path (WEGID) to get exactly information you require.