Hi Georwill:
Yes there is a standard FM for this; actually there are plenty but the one I usually refer to us RH_STRUC_GET.
You use it together with an evaluation path (WEGID) that you have to choose. WEGID are available in table T778A (go to SM30), so you choose carefully the one that best fit your need. Some WEGIDs start from a PERNR as input other from an Organizational Unit, other from other type of OM object.
You can also make one, but since you ask for this kind of basic HR programing I would recommend go for the standard option.
For the reporting manager you can use for instance WEGID BOSSONLY Chief of organizational unit starting with the organizational unit of your PERNR, or use first P-S-O Direct organizational assignment of a person starting with PERNR to get the organization unit and then BOSSONLY... or also skip PSO and use P0001-ORGEH field... many options; many threads on this subject out there to help you.
CALL FUNCTION 'RH_STRUC_GET' EXPORTING act_otype = "object type you start with act_objid = "object ID you start with act_wegid = "your chosen evaluation path act_int_flag = abap_false act_plvar = "your active plan variant -> usuario "01" act_begda = "your validity startdate act_endda = "your validity enddate text_buffer_fill = abap_true buffer_mode = abap_true TABLES result_struc = "your result EXCEPTIONS no_plvar_found = 1 no_entry_found = 2 OTHERS = 3.
Add comment