cancel
Showing results for 
Search instead for 
Did you mean: 

Organization structure hierchy table determination in CRM

Former Member
0 Kudos

Hi there,

Can you please let me know in which table of CRM the organization hierchy structure is stored.

Quick response will be greatly appreciated.

Many thanks,

Kate

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can use table HRP1000 to get all the organization object ID's and then use function mod RH_STRUC_GET with act_weigd = appropraite evaluation path.

You can find the correct evaluation path in table T77AT

See example code:

SELECT SINGLE objid FROM hrp1000 INTO (i_objid)

WHERE short = i_orgdata.

IF sy-subrc EQ 0.

CALL FUNCTION 'RH_GET_ACTIVE_WF_PLVAR'

IMPORTING

act_plvar = lv_plvar

EXCEPTIONS

no_active_plvar = 1.

CALL FUNCTION 'RH_STRUC_GET'

EXPORTING

act_otype = 'O'

act_objid = i_objid

act_wegid = 'A002'

  • ACT_INT_FLAG =

act_plvar = lv_plvar

act_begda = sy-datum

act_endda = sy-datum

act_tdepth = 0

act_tflag = 'X'

act_vflag = 'X'

authority_check = 'X'

  • TEXT_BUFFER_FILL =

  • BUFFER_MODE =

IMPORTING

act_plvar = lv_plvar

TABLES

result_tab = result_tab

result_objec = result_objec

result_struc = result_struc

EXCEPTIONS

no_plvar_found = 1

no_entry_found = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT result_objec.

READ TABLE i_comp_org WITH KEY objid = result_objec-objid.

IF sy-subrc EQ 0.

it-reg = i_comp_org-stext.

EXIT.

ENDIF.

ENDLOOP.

REFRESH: result_tab,

result_objec,

result_struc.

Hope this helps!

Former Member
0 Kudos

Hi Chandrika,

I am not able to get the complete hierarchy in this table with the lowest level of nodes say BP.

Also I am not clear on what does act_weigd = appropraite evaluation path imply ? What should I enter the value for act_weid ? Can I also enter 'A002' for this.

And in this statement short = i_orgdata , what is the value stored in internal table that we are passing to short.

Your help will be greatly appreciated.

Kind Regards,

Kate

Former Member
0 Kudos

Hi Kate,

Please call the function RH_STRUC_GET with ACT_OBJID = object ID of the root organization from your org model. This will be the the very high level node in your org model. Pass ACT_WEGID = 'SAP_SORG'.

Example call:

ACT_OTYPE = O

ACT_OBJID = 50000000 (object ID of root node)

ACT_WEGID = SAP_SORG

ACT_INT_FLAG

ACT_PLVAR

ACT_BEGDA = 02/02/2006

ACT_ENDDA = 02/02/2006

ACT_TDEPTH = 0

ACT_TFLAG = X

ACT_VFLAG = X

AUTHORITY_CHECK = X

TEXT_BUFFER_FILL =

BUFFER_MODE

This should give you the object ID's for all the nodes (organization, position and the holders like business partners assined to positions)

Result tab of the above function will look like this :

OT OBJID

O 50000063

O 50000064

S 50000065

O 50000072

S 50000073

CP 50000427

where O corresponds to org object, S-> position and CP-> central person number of business partner (note: when you assign business partner to the postion, it stores the person number of the partner). So you would need to use the function BP_CENTRALPERSON_GET with IV_person_id = central person number (50000427) to get the user Id or partner number

Hope this helps.

Chandrika

Former Member
0 Kudos

Hi,

Many thanks for the answer.

I would like to know is there any function module other than

BP_CENTRALPERSON_GET to give us the BP number like(00000000587) instead of the

guid.

Once again thanks a ton for this answer.

Kind regards,

Kate

Former Member
0 Kudos

Hi Kate,

once you get the BP GUID from BP_CENTRALPERSON_GET, use function COM_PARTNER_CONVERT_GUID_TO_NO to convert GUID to partner number.

Hope this helps!

Chandrika