TYPES: objec_t TYPE objec.
Data: lt_result TYPE STANDARD TABLE OF objec_t WITH HEADER LINE,
DATA: lv_leader TYPE objid.
PERFORM get_manager USING lt_result-objid lw_p0001-begda lw_p0001-endda
CHANGING lv_leader.
*&---------------------------------------------------------------------*
*& Form GET_MANAGER
*&---------------------------------------------------------------------*
FORM get_manager USING p_objid p_begda p_endda
CHANGING p_manager.
DATA: lt_manager LIKE TABLE OF objec,
ls_manager LIKE LINE OF lt_manager.
CALL FUNCTION 'HRCM_ORGUNIT_MANAGER_GET'
EXPORTING
plvar = '01'
otype = 'O'
objid = p_objid
begda = p_begda
endda = p_endda
* PATH_ID = ' '
TABLES
manager_info_table = lt_manager
EXCEPTIONS
path_error = 1
root_error = 2
nothing_found = 3
OTHERS = 4.
IF sy-subrc = 0.
READ TABLE lt_manager INTO ls_manager INDEX 1.
p_manager = ls_manager-objid.
ENDIF.
ENDFORM.
沒有留言:
張貼留言