cancel
Showing results for 
Search instead for 
Did you mean: 

Searching the Org. structure

Former Member
0 Kudos

Hi all,

SRM 5.0, R/3 ECC 6.0

I'm working on the n step BADI for the approval workflow for SC.

The requirement is that I need to search the org structure to get the superiors of the creator of the shopping cart.

The approach should be a bottom up approach where I start looking from the position of the creator and go searching upwards. I though of using the FM RH_STRUC_GET but we need to provide the user which is mandatory. There could be a case where there could be no immediate superior say no managers but there could be senior managers who are a level above. in that case I won't be able to use the above mentioned FM.

Are there any tables or FMs where we can perform this kind of search?

Regards

Kishan

Accepted Solutions (1)

Accepted Solutions (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Kishan,

You can use FM RH_STRUC_GET for your scenario with ACT_WEGID parameter. You can define evaluation path in OOAW transaction. Here is some sample I developed in the past.

  • 3)get manager from Org unit

WHILE lt_manager is initial.

CALL FUNCTION 'BBP_OM_STRUC_GET_MGR_FROM_ORG'

EXPORTING

IV_ORGUNIT = lv_objid

IV_SEL_DATE = SY-DATUM

  • IV_SELECT_BUPA = ' '

  • IV_PPOMA_CALL = ' '

  • IV_AUTHORITY_CHECK = 'X'

IMPORTING

ET_MANAGER_ID = lt_manager

EXCEPTIONS

INTERNAL_ERROR = 1

NO_ROOTS = 2

NOT_FOUND = 3

OTHERS = 4

.

if lt_manager is initial.

CALL FUNCTION 'RH_STRUC_GET'

EXPORTING

ACT_OTYPE = 'O '

ACT_OBJID = lv_objid

ACT_WEGID = 'A002'

  • ACT_INT_FLAG =

  • ACT_PLVAR = ' '

ACT_BEGDA = SY-DATUM

ACT_ENDDA = SY-DATUM

ACT_TDEPTH = 2

ACT_TFLAG = 'X'

ACT_VFLAG = 'X'

  • AUTHORITY_CHECK = 'X'

  • TEXT_BUFFER_FILL =

  • BUFFER_MODE =

  • IMPORTING

  • ACT_PLVAR =

TABLES

RESULT_TAB = lt_agent

  • RESULT_OBJEC =

  • RESULT_STRUC =

EXCEPTIONS

NO_PLVAR_FOUND = 1

NO_ENTRY_FOUND = 2

OTHERS = 3

.

IF SY-SUBRC eq 0.

loop at lt_agent into lwa_agent.

lv_objid = lwa_agent-objid.

endloop.

ENDIF.

endif.

ENDWHILE.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

Thanks for the info. I'll try it and let you know.

Regards

Kishan

Answers (0)