TYPES: objec_t TYPE objec.
data: lv_wegid like T778A-wegid.
data: lt_result TYPE STANDARD TABLE OF objec_t WITH HEADER LINE.
data:
l_root TYPE gdstr.
PERFORM get_structure TABLES lt_result
USING sy-datum sy-datum lw_p0001-orgeh lv_wegid l_root. "組織資料
*&---------------------------------------------------------------------*
*& Form GET_STRUCTURE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM get_structure TABLES lt_result
USING p_begda p_endda p_objid p_path l_root LIKE gdstr.
CLEAR: lt_result, lt_result[], l_root.
CALL FUNCTION 'HR_STRUCTURE_GET' "取得組織清單
EXPORTING
root_plvar = '01'
root_otype = 'O'
root_objid = p_objid
* ROOT_OBJECTS =
begda = p_begda
endda = p_endda
pathid = p_path
* PATHID_IS_INTERN =
* STRU_TECH_DEPTH = 0
* STRU_STATUS_VECTOR = '1'
* STRU_STATUS_OVERLAP = ' '
* PROVIDE_TEXT = 'X'
* PROVIDE_RELAT = 'X'
* PROVIDE_DFLAG = 'X'
* RECURSION_CHECK = 'X'
* AUTHORITY_CHECK = 'X'
* TEXT_BUFFER_FILL = 'X'
* READ_MODE = 'F'
* KEEP_ORDER =
IMPORTING
result_objects = lt_result[]
* RESULT_STRUCTURE =
root_copy = l_root
EXCEPTIONS
plvar_not_found = 1
root_not_found = 2
path_not_found = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM.
沒有留言:
張貼留言