Display organisational structure
The following SAP ABAP code displays a screen which allows the uses to view the organisational structure and select an entry.
REPORT zm_org_structure_search .
DATA: t_dept LIKE objec-realo. "Temporary Dept.
START-OF-SELECTION.
PERFORM org_structure_search.
END-OF-SELECTION.
WRITE: 'Selected Org Unit = ', t_dept.
*-------------------------------------------------------*
* Form ORG_STRUCTURE_SEARCH *
*-------------------------------------------------------*
* Provides a pop-up structure search for dept / faculty.*
*-------------------------------------------------------*
FORM org_structure_search.
CALL FUNCTION 'RH_TYPE_STRUC_HELP'
EXPORTING
act_search_otype = 'O'
no_seark = 'X'
IMPORTING
selected_objid = t_dept
EXCEPTIONS
no_active_plvar = 1
no_object_selected = 2
no_struc_search_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* MOVE t_dept TO p_dept.
ENDFORM. " ORG_STRUCTURE_SEARCH
|