Google Search - Blog...........

HR ABAP - Ordering (Descending ) Org. Unit For An Organization.

REPORT YZTEST.

*--internal table declarations
DATA:result_struc TYPE TABLE OF struc WITH HEADER LINE.
*---selection screen declarations
PARAMETERS:p_objid TYPE objid.
*---start of selection
START-OF-SELECTION.

perform get_data.

perform header .

perform display_data.

*&---------------------------------------------------------------------*
*& Form get_data
*----------------------------------------------------------------------*
form get_data .

CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = p_objid
act_wegid = 'O-O'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
TABLES
result_struc = result_struc.


SORT result_struc BY level DESCENDING.

endform. " get_data
*&---------------------------------------------------------------------*
*& Form header
*----------------------------------------------------------------------*
form header .

FORMAT COLOR 7.
WRITE:/1 'Level',
20 'Object Type',
35 ' Object ID',
50 'Start Date',
65 'End Date'.
FORMAT COLOR OFF.

endform. " header
*&---------------------------------------------------------------------*
*& Form display_data
*----------------------------------------------------------------------*
form display_data .

LOOP AT result_struc .
IF sy-tabix = 1.
WRITE:/1 result_struc-level,
20 result_struc-otype,
35 result_struc-objid,
50 result_struc-sbegd,
65 result_struc-sendd.
ELSE.
EXIT.
ENDIF.
ENDLOOP.

endform. " display_data


ALSO READ:

- Display Details about Organization unit, Position or Job In HR ABAP.

- First & Last Working Date Of An Employee.

- Get All The Existing Organization Units.

- Obtain All The Sub Org Units Under An Organization Unit.

- Display Texts For Personnel Subarea, Employee Group, Employee Subgroup, Cost Center & Organizational Unit.

.....Back To Sub-Index On HR ABAP.

.....Back To MAIN INDEX.


No comments:

Post a Comment