Friday, 23 March 2012

Positive Time Management in HR ABAP

* USING HR_TIME_RESULTS_GET *

REPORT  ZCLASS_H14.

TABLES PERNR.

DATA ITAB TYPE PC2B5 OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

GET PERNR.
  CALL FUNCTION 'HR_TIME_RESULTS_GET'
    EXPORTING
     GET_PERNR                   = PERNR-PERNR
     GET_PABRJ                   = PN-PABRJ
     GET_PABRP                   = PN-PABRP
*   GET_KDATE                   =
*   GET_CLTYP                   = '1'
* IMPORTING
*   GET_NO_RECORD_FOUND         =
*   GET_BEZUG                   =
*   GET_KNTAG                   =
   TABLES
*   GET_TBUFF                   =
*   GET_BUFFER_DIR              =
*   GET_WPBP                    =
*   GET_ALP                     =
*   GET_AB                      =
*   GET_SKO                     =
*   GET_VERT                    =
     GET_SALDO                   = ITAB
*   GET_ZES                     =
*   GET_ZKO                     =
*   GET_FEHLER                  =
*   GET_ABWKONTI                =
*   GET_PSP                     =
*   GET_ANWKONTI                =
*   GET_MEHR                    =
*   GET_ANWES                   =
*   GET_RUFB                    =
*   GET_ZL                      =
*   GET_URLAN                   =
*   GET_VS                      =
*   GET_CVS                     =
*   GET_C1                      =
*   GET_AT                      =
*   GET_PT                      =
*   GET_WST                     =
*   GET_CWST                    =
*   GET_QTACC                   =
*   GET_QTBASE                  =
*   GET_QTTRANS                 =
* EXCEPTIONS
*   NO_PERIOD_SPECIFIED         = 1
*   WRONG_CLUSTER_VERSION       = 2
*   NO_READ_AUTHORITY           = 3
*   CLUSTER_ARCHIVED            = 4
*   TECHNICAL_ERROR             = 5
*   OTHERS                      = 6.
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
   
LOOP AT ITAB.
  WRITE:/ PERNR-PERNR, PERNR-ENAME, ITAB-ZTART, ITAB-ANZHL.
ENDLOOP.