P. 1
Znizam Hremp Attendence Det 1

Znizam Hremp Attendence Det 1

|Views: 8|Likes:
Published by rajeshb4us
Znizam Hremp Attendence Det 1
Znizam Hremp Attendence Det 1

More info:

Published by: rajeshb4us on May 07, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

11/21/2014

pdf

text

original

*&---------------------------------------------------------------------* *& Report ZNIZAM_HREMP_ATTENDENCE_DET *& *&---------------------------------------------------------------------* *& *& *&

---------------------------------------------------------------------* REPORT ZNIZAM_HREMP_ATTENDENCE_DET. TABLES : PA0001,PA2001. INFOTYPES:0001,0007,2002. TYPE-POOLS:SLIS. SELECT-OPTIONS : S_EMP FOR PA0001-PERNR, S_PERSG FOR PA0001-PERSG, S_BEGDA FOR PA0001-BEGDA NO-Extension. TYPES: BEGIN OF TY_EMP, PERNR TYPE PA0001-PERNR, " Emp Number CNAME TYPE PA0002-CNAME, " Emp Name PERSG TYPE PA0001-PERSG, " Emp Group PERSK TYPE PA0001-PERSK, " Emp Sub Group DATE TYPE SY-DATUM, " Date Shift(6) TYPE C, " Shift Sh_Hr TYPE TISTD, " Shift Hrs BEGUZ type T552V-BEGUZ, " Shift Start Time ENDUZ type T552V-ENDUZ, " Shift End Time AWART TYPE PA2001-AWART, " Abscence TYPE BEGDA TYPE PA2001-BEGDA, " Begin date ENDDA TYPE PA2001-ENDDA, " End date ABRST TYPE PA2001-ABRST, " Abscence hr ABWTG TYPE PA2001-ABWTG, " Abscence Days DAY_PR TYPE PA2001-ABWTG, END OF TY_EMP. TYPES : BEGIN OF TY_0001, PERNR TYPE PA0001-PERNR, PERSG TYPE PA0001-PERSG, PERSK TYPE PA0001-PERSK, END OF TY_0001. TYPES : BEGIN OF TY_2001, PERNR TYPE PA0001-PERNR, BEGDA TYPE PA2001-BEGDA, ENDDA TYPE PA2001-ENDDA, AWART TYPE PA2001-AWART, ABWTG TYPE PA2001-ABWTG, ABRST TYPE PA2001-ABRST, END OF TY_2001.

" " " " "

Begin date End date ABSANCE TYPE Abscence Days Abscence hr

TYPES : BEGIN OF TY_0002, PERNR TYPE PA0001-PERNR, vorna TYPE PA0002-vorna, nachn TYPE PA0002-nachn, END OF TY_0002. DATA : it_emp TYPE ty_emp OCCURS 0,

MESSAGE I000(ZRIZ_MSG) WITH ' NO EMP REC FOUND'. DATA : IT_PSP TYPE STANDARD TABLE OF PTPSP. LOOP AT it_0001 into wa_0001. SELECT * FROM PA0001 INTO TABLE IT_0001 WHERE PERNR IN S_EMP and begda le S_BEGDA-high and endda ge s_begda-low. . wa_0001 type PA0001. READ TABLE it_0002 into wa_0002 with key pernr = wa_0001-pernr BINARY SEARCH. wa_0002 type ty_0002. wa_emp-persk = wa_0001-persk. it_2001 type TABLE OF ty_2001. wa_2001 type ty_2001. data: wa_t552v TYPE t552v. it_0001 TYPE TABLE OF PA0001. ENDIF. READ TABLE s_begda INDEX 1. wa_emp-pernr = wa_0001-pernr. SELECT PERNR VORNA nachn FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE IT_0002 FOR ALL ENTRIES IN IT_0001 WHERE PERNR = IT_0001-PERNR and begda le S_BEGDA-high and endda ge s_begda-low. WA_PSP TYPE PTPSP. sort it_0002 by pernr. wa_emp-persg = wa_0001-persg. if sy-dbcnt = 0.wa_emp type ty_emp. it_0002 TYPE TABLE OF ty_0002. ELSE. SELECT PERNR BEGDA ENDDA AWART ABWTG ABRST FROM PA2001 INTO CORRESPONDING FIELDS OF TABLE IT_2001 FOR ALL ENTRIES IN IT_0001 WHERE PERNR = IT_0001-PERNR and begda le S_BEGDA-high and endda ge s_begda-low.

wa_emp-beguz = wa_t552v-beguz. ENDIF. wa_emp-date = wa_psp-DATUM. wa_emp-shift = 'Off'. wa_emp-beguz = wa_t552v-beguz. IF sy-subrc <> 0. IF SY-SUBRC <> 0. wa_emp-sh_hr = wa_psp-stdaz. CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE' EXPORTING PERNR = wa_emp-pernr BEGDA = s_begda-low ENDDA = s_begda-high TABLES I0001 = P0001 PERWS = IT_PSP EXCEPTIONS ERROR_OCCURED = 1 ABORT_OCCURED = 2 OTHERS = 3 . endif. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE. ENDIF. wa_emp-enduz = wa_t552v-enduz. MOVE-CORRESPONDING WA_0001 TO P0001 . IF wa_psp-TPROG = 'OFF'. wa_emp-enduz = wa_t552v-enduz. ELSEIF wa_psp-varia is NOT INITIAL.if sy-subrc = 0. ELSE. select SINGLE * from t552v into wa_t552v where ZMODN = wa_psp-ZMODN AND TPROG = wa_psp-TPROG. IF sy-subrc = 0. CONCATENATE wa_0002-vorna WA_0002-NACHN INTO WA_EMP-CNAME SEPARATED BY SPACE. wa_emp-shift = wa_psp-varia. wa_emp-shift = 'C'. APPEND P0001. select SINGLE * from t552v into wa_t552v where MOTPR = wa_psp-motpr AND ZMODN = wa_psp-ZMODN AND TPROG = wa_psp-TPROG. LOOP AT it_psp into wa_psp. LOOP AT IT_2001 INTO WA_2001 WHERE PERNR = WA_0001-PERNR . ENDIF. ENDIF.

ELSE. *IF SY-SUBRC <> 0.AND begda LE WA_PSP-DATUM AND ENDDA ge wa_psp-datum. WA_2001-ABRST / WA_2001-ABWTG. 'Employee Name'. ENDIF. WA_EMP-BEGDA WA_EMP-ENDDA WA_EMP-AWART WA_EMP-ABRST WA_EMP-ABWTG = = = = = wa_psp-datum. 'Employee Group'. wa_fieldcat TYPE SLIS_FIELDCAT_ALV . DATA:it_fieldcat TYPE SLIS_T_FIELDCAT_ALV. 'Shift'. wa_emp-day_pr = 1. ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. WA_2001-AWART. CLEAR wa_emp-day_pr. APPEND WA_EMP TO IT_EMP. 1. wa_psp-datum. 'Abscence Type'. ENDLOOP. CLEAR:WA_EMP-BEGDA. 'Emp Sub Group'.WA_EMP-ABRST. ENDLOOP. 'Date'. 'Shift Begin time'. PERFORM PREPARE_FIELDCAT USING: 'PERNR' 'CNAME' 'PERSG' 'PERSK' 'DATE' 'SHIFT' 'SH_HR' 'BEGUZ' 'ENDUZ' 'AWART' 'Employee Number'. ENDLOOP. *ENDIF. 'Shift End time'. .WA_EMP-ABWTG.WA_EMP-AWART. *CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' * EXPORTING * I_PROGRAM_NAME = sy-repid * I_INTERNAL_TABNAME = 'IT_EMP' ** I_STRUCTURE_NAME = 'IT_EMP' ** I_CLIENT_NEVER_DISPLAY = 'X' ** I_INCLNAME = * I_BYPASSING_BUFFER = 'X' ** I_BUFFER_ACTIVE = * CHANGING * CT_FIELDCAT = it_fieldcat * EXCEPTIONS * INCONSISTENT_INTERFACE = 1 * PROGRAM_ERROR = 2 * OTHERS = 3 * .WA_EMP-ENDDA. 'Shift hours'. IF sy-subrc <> 0.

'ENDDA' 'Abscence End Date'. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO . IF SY-SUBRC <> 0.'BEGDA' 'Abscence Begin Date'. 'ABRST' 'Abscence hr'. 'ABWTG' 'Abscence Days'. 'DAY_PR' 'Days Present'. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = 'Z_NIZAM_HREMP_ATTENDENCE_DET' * I_CALLBACK_PF_STATUS_SET = ' ' * I_CALLBACK_USER_COMMAND = ' ' * I_CALLBACK_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_END_OF_LIST = ' ' * I_STRUCTURE_NAME = * I_BACKGROUND_ID = ' ' * I_GRID_TITLE = * I_GRID_SETTINGS = * IS_LAYOUT = IT_FIELDCAT = IT_FIELDCAT * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE = ' ' * IS_VARIANT = * IT_EVENTS = * IT_EVENT_EXIT = * IS_PRINT = * IS_REPREP_ID = * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * I_HTML_HEIGHT_TOP = 0 * I_HTML_HEIGHT_END = 0 * IT_ALV_GRAPHICS = * IT_HYPERLINK = * IT_ADD_FIELDCAT = * IT_EXCEPT_QINFO = * IR_SALV_FULLSCREEN_ADAPTER = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES T_OUTTAB = it_emp EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 .

ENDFORM. WA_FIELDCAT-SELTEXT_L = G_COL_HEAD.* ENDIF. WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. *&---------------------------------------------------------------------* *& Form PREPARE_FIELDCAT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0484 text * -->P_0485 text *----------------------------------------------------------------------* FORM PREPARE_FIELDCAT USING VALUE(G_FLDNAME) TYPE SLIS_FIELDNAME VALUE(G_COL_HEAD) TYPE SCRTEXT_L. WA_FIELDCAT-FIELDNAME = G_FLDNAME. " PREPARE_FIELDCAT . APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR: WA_FIELDCAT.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->