P. 1
Zhr Report

Zhr Report

|Views: 18|Likes:
Published by vinayistha
ajnfk kdjh nhkj
ajnfk kdjh nhkj

More info:

Published by: vinayistha on Mar 22, 2013
Copyright:Attribution Non-commercial

Availability:

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

09/06/2014

pdf

text

original

report .

ZHR_OVERTIME_REPORT line-size 213 message-id ZMSG.

type-pools: SLIS. tables: PA0001, T569V, T549A, T549Q.

types: begin of TY_PA0000, PERNR type PA0000-PERNR, end of TY_PA0000. types: begin PERNR BUKRS end types: begin PERNR VORNA NACHN end types: begin PERNR BEGDA ENDDA LGART ANZHL end of TY_PA0001, type PA0001-PERNR, type PA0001-BUKRS, of TY_PA0001. of TY_PA0002, type PA0002-PERNR, type PA0002-VORNA, type PA0002-NACHN, of TY_PA0002. of TY_PA2010, type PA2010-PERNR, type PA2010-BEGDA, type PA2010-ENDDA, type PA2010-LGART, type PA2010-ANZHL, of TY_PA2010.

types: begin of TY_PA0008. include structure P0008. types: end of TY_PA0008. data: begin of WAGETYPES, LGA like P0008-LGA01, BET like P0008-BET01, end of WAGETYPES. data: LFS_0008 like P0008.

data : V_CHAR type CHAR35, V_CHAR1 type CHAR2 , GV_HRS type CHAR40, V_CHAR2 type CHAR40.

PERNR type PA0001-PERNR. * amount2 TYPE p length 13 decimals 6. bet01. end of TY_FINAL. " " pa0045- data : AMOUNT1 type P length 13 decimals 6. data : V_PERMO type T549A-PERMO. THRS type P decimals 2. W_RELID type RELID_PCL2. WAGETYPE type CHAR15. darbt. IT_PA0002 type table of TY_PA0002 with header line. W_SEQNR type CDSEQ. NACHN type PA0002-NACHN. TOTAL type BSIS-DMBTR. data : IT_PA0000 type table of TY_PA0000 with header line. TOTAL1 type BSIS-DMBTR. IT_FINAL type table of TY_FINAL with header line. TAMT type PA0008-BET01. AMOUNT2 type BSIS-DMBTR. pa0045-darbt. WA_RT type PC207. TOTALHR2 type P decimals 2. THR type PA0008-BET01. W_MOLGA type T500L-MOLGA. VORNA type PA0002-VORNA.types: begin of TY_FINAL. . HRS2 type P decimals 2. IT_PA2010 type table of TY_PA2010 with header line. IT_PA0001 type table of TY_PA0001 with header line. data: TOTAL type BSIS-DMBTR. " pa0008" pa0008-bet01. AMOUNT1 type BSIS-DMBTR. IT_PA0008 type table of TY_PA0008 with header line. . with header line. BUKRS type PA0001-BUKRS. * amount1 TYPE p length 13 decimals 6. HRS1 type P decimals 2. data : IT_RGDIR type table of PC261 IT_RESULT type PAY99_RESULT WA_ITRGDIR type PC261. TOTALHR1 type P decimals 2. data : AMOUNT2 type P length 13 decimals 6.

"Payroll Area * s_werks for pa0001-werks. selection-screen begin of block B3 with frame title TEXT-002. "Employee Group * s_persk for pa0001persk. PA0001-BEGDA.selection-screen begin of block B1 with frame title TEXT-001. * s_abkrs for pa0001-abkrs. "Personnel Area * s_btrtl for pa0001btrtl. selection-screen begin of block B2 with frame title TEXT-003. if SCREEN-NAME = 'P_PABRP' . parameters: P_DATE like PA0001-BEGDA modif id CCC default SY-DATUM. perform GET_DATA_FROM_CURRENT_PERIOD. selection-screen end of block B4. " Key Date selection-screen begin of block B4 with frame title TEXT-006. parameters : R3 radiobutton group G2 usercommand UC1 default 'X'. SELECT-OPTIONS:p_abkrs FOR pa0001-abkrs NO INTERVALS. T569V-PABRJ. parameters: R1 radiobutton group R3 modif id BBB. selection-screen end of block B3. at selection-screen output. parameters: P_PABRP P_PABRJ P_BEGDA P_ENDDA type type type type T569V-PABRP. "Employee Subgroup selection-screen end of block B2 . if R1 = 'X'. selection-screen end of block B1 . "Personnel Subarea * s_persg for pa0001-persg. select-options: S_PERNR for PA0001-PERNR. loop at screen. R2 radiobutton group R3 modif id BBB. " Periods R4 radiobutton group G2. PA0001-ENDDA.

endif. endloop. endloop. endif. modify screen. loop at screen. endif. if SCREEN-GROUP1 = 'CCC'.or SCREEN-NAME = 'P_PABRJ' or SCREEN-NAME = 'P_BEGDA' or SCREEN-NAME = 'P_ENDDA'. modify screen. endif. elseif R2 = 'X'. SCREEN-INPUT = 0. SCREEN-ACTIVE = '0'. perform GET_DATA_FROM_PERIOD. if SCREEN-GROUP1 = 'BBB'. if R4 = 'X'. modify screen. modify screen. endif. loop at screen. loop at screen. . elseif R3 = 'X'. SCREEN-INPUT = 0. if SCREEN-NAME = 'P_BEGDA' or SCREEN-NAME = 'P_ENDDA'. endloop. endif. endloop. SCREEN-ACTIVE = '0'.

ELSEIF wa_params-sign = 'I' AND wa_params-option = 'BT'. IF wa_params-sign = space. CLEAR P_ABKRS. message E003. EXIT. if R4 = 'X'. P_BEGDA = P_DATE. perform PROCESS_DATA. MESSAGE e000(ZMSG) with 'Enter Key date'. if P_DATE lt P_BEGDA or P_DATE gt P_ENDDA. LOOP AT it_params INTO wa_params. CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS' EXPORTING curr_report = sy-repid TABLES selection_table = it_params. else. * * * * if R4 = 'X'. endif. endif. P_ABKRS = 'ALL'. if P_date eq '00000000'. DATA wa_params TYPE rsparams. CONCATENATE P_ABKRS wa_paramslow INTO P_ABKRS SEPARATED BY space. ****** Payroll Area ***************************** *------------------------------------------------DATA it_params TYPE STANDARD TABLE OF rsparams. MESSAGE e000(ZMSG) with 'Enter the date within periods'. perform GET_DATA. *endif. P_ENDDA = P_DATE. ELSEIF wa_params-sign = 'I' AND wa_params-option = 'EQ'. endif. perform DISPLAY_ALV. DELETE it_params WHERE selname NE 'P_ABKRS'. end-of-selection. top-of-page. .start-of-selection.

****** Payroll Area ***************************** *------------------------------------------------write:/05 SY-TITLE. write:/05 'Report Name :' . ENDIF. CONDENSE P_ABKRS. select PERNR from PA0000 into table IT_PA0000 where PERNR in S_PERNR and STAT2 = '3' and BEGDA le P_ENDDA and ENDDA ge P_BEGDA. write:/05 'User Name :' . P_BEGDA mm/dd/yyyy. . SY-UNAME. write:/05 'Run Date :' . '- *&--------------------------------------------------------------------* *& Form GET_DATA *---------------------------------------------------------------------* form GET_DATA . sort IT_PA0000 by PERNR. SY-DATUM.CONCATENATE P_ABKRS 'BETWEEN' wa_params-low 'AND' wa_paramsHIGH INTO P_ABKRS SEPARATED BY SPACE. P_ENDDA mm/dd/yyyy. write:/05 'Paroll Area :' . SY-REPID. write:/05 'Paroll period :' '. ENDLOOP. select PERNR BUKRS from PA0001 into table IT_PA0001 for all entries in IT_PA0000 where PERNR = IT_PA0000-PERNR and BEGDA le P_ENDDA and ENDDA ge P_BEGDA and ABKRS IN P_ABKRS and werks = 'NOMC'. . if SY-SUBRC = 0. P_ABKRS.

if SY-SUBRC = 0. delete adjacent duplicates from IT_PA0001 comparing PERNR. sort IT_PA0002 by PERNR. select * from PA0008 into corresponding fields of table IT_PA0008 for all entries in IT_PA0000 where PERNR = IT_PA0000-PERNR and BEGDA le P_ENDDA and ENDDA ge P_BEGDA. sort IT_PA0000 by PERNR. select PERNR VORNA NACHN from PA0002 into table IT_PA0002 for all entries in IT_PA0000 where PERNR = IT_PA0000-PERNR and SPRSL = 'E' and BEGDA le P_ENDDA and ENDDA ge P_BEGDA. endif.if SY-SUBRC = 0. select PERNR BEGDA ENDDA LGART ANZHL from PA2010 into table IT_PA2010 for all entries in IT_PA0000 where PERNR = IT_PA0000-PERNR and BEGDA le P_ENDDA and ENDDA ge P_BEGDA. endif. endif. if SY-SUBRC = 0. if SY-SUBRC = 0. *break abaper2. sort IT_PA0008 by PERNR. endif. . sort IT_PA2010 by PERNR.

check WAGETYPES-LGA is not initial. " Basic ********Added By Abaper 22_march_2011*********** * PERFORM get_rt_data. enddo. read table IT_PA0008 with key PERNR = IT_PA0001-PERNR. IT_FINAL-BUKRS = IT_PA0001-BUKRS. endif. when '1000'. do 40 times varying WAGETYPES-LGA from LFS_0008LGA01 next LFS_0008-LGA02 varying WAGETYPES-BET from LFS_0008BET01 next LFS_0008-BET02. " GET_DATA *&--------------------------------------------------------------------* *& Form PROCESS_DATA *---------------------------------------------------------------------* form PROCESS_DATA . clear : LFS_0008. read table IT_PA0002 with key PERNR = IT_PA0001-PERNR. *******Ended By Abaper ************************* . data: L_AMOUNT type CHAR40.endif. move-corresponding IT_PA0008 to LFS_0008. if SY-SUBRC = 0. loop at IT_PA0001. if SY-SUBRC = 0. IT_FINAL-NACHN = IT_PA0002-NACHN. endform. case WAGETYPES-LGA. endcase. IT_FINAL-PERNR = IT_PA0001-PERNR. L_AMOUNT = WAGETYPES-BET . endif. IT_FINAL-VORNA = IT_PA0002-VORNA.

170 SY-VLINE. perform GET_RT_DATA. 55 SY-VLINE. IT_FINAL-HRS1 = 0. write:/1 SY-VLINE. * case: IT_PA2010-LGART. 39 'First Name' centered. 30 SY-VLINE. THR = TOTALHR1 + TOTALHR2. * if it_final-hrs1 is not initial or it_final-hrs2 is not initial. * endif. 2 'Personnel Number'. 125 SY-VLINE. endloop. 18 SY-VLINE. 213 SY-VLINE. write:/1 SY-VLINE. 140 'Over time 200%' centered. 94 'Over time 150%' centered. IT_FINAL-HRS2 = IT_FINAL-HRS2 + IT_PA2010-ANZHL. when '5010'. 63 'Last Name' centered. IT_FINAL-HRS1 = IT_FINAL-HRS1 + IT_PA2010-ANZHL. IT_FINAL-HRS2 = 0. endloop. * 184 'Total'. 20 'Comp Code'. write:/1(213) SY-ULINE. " PROCESS_DATA *&--------------------------------------------------------------------* *& Form DISPLAY_ALV *---------------------------------------------------------------------* form DISPLAY_ALV . 191 'Total' centered. when '5000'. 80 SY-VLINE. . endcase. * 180 sy-vline.loop at IT_PA2010 where PERNR = IT_PA0001-PERNR. endform. TAMT = TOTAL + TOTAL1.

170 SY-VLINE. 161 'Total Hours'. 88 'Hours' centered. 55 SY-VLINE. 30 SY-VLINE. 180 'Hours' centered. 180 sy-vline. write:/1(213) SY-ULINE. 213 SY-VLINE. 201 'Amount' centered. 145 SY-VLINE. loop at IT_FINAL. 176 'Total Amount'. . 4 IT_FINAL-PERNR. 2 ''. 193 SY-VLINE. 31 '' centered. 155 'Amount' centered. 18 SY-VLINE. 55 SY-VLINE. 19 ' '. 19 ''. 30 SY-VLINE. 80 SY-VLINE. 80 SY-VLINE. 100 SY-VLINE. 18 SY-VLINE. 56 ' ' centered. 170 SY-VLINE. if not IT_FINAL[] is initial.* * * 2 ' '. write:/1 SY-VLINE. 22 IT_FINAL-BUKRS. write:/1 SY-VLINE. 81(135) SY-ULINE. 56 '' centered. 110 'Amount' centered. 125 SY-VLINE. 31 IT_FINAL-VORNA . 31 ' ' centered. 213 SY-VLINE. 30 SY-VLINE. 18 SY-VLINE. 133 'Hours' centered.

213 SY-VLINE. 80 SY-VLINE. 177 IT_FINAL-THRS . 199 TAMT. " DISPLAY_ALV *&--------------------------------------------------------------------* *& Form GET_DATA_FROM_CURRENT_PERIOD *---------------------------------------------------------------------* form GET_DATA_FROM_CURRENT_PERIOD . 56 IT_FINAL-NACHN . 213 SY-VLINE. 125 SY-VLINE. 110 TOTAL . 110 IT_FINAL-AMOUNT1 125 SY-VLINE. 100 SY-VLINE. write:/1 SY-VLINE.55 SY-VLINE. 155 IT_FINAL-AMOUNT2 170 SY-VLINE. 84 TOTALHR1 . 170 SY-VLINE. 155 TOTAL1 . 193 SY-VLINE . select single * from T569V . 80 SY-VLINE. 129 TOTALHR2 . 193 SY-VLINE. . 84 IT_FINAL-HRS1 . . 176 THR . write:/1(213) SY-ULINE. 100 SY-VLINE. 180 sy-vline. endloop. write:/1(213) SY-ULINE. 20 'Totals : '. 199 IT_FINAL-TOTAL . * endform. 129 IT_FINAL-HRS2 145 SY-VLINE. endif. 145 SY-VLINE. .

if SY-SUBRC = 0. " GET_DATA_FROM_PERIOD . endform. select single * from T549A where ABKRS = P_ABKRS-LOW. endif. V_PERMO T569V-PABRJ T569V-PABRP. endform. P_ENDDA = T549Q-ENDDA. if SY-SUBRC = 0. endif. if SY-SUBRC = 0. " GET_DATA_FROM_CURRENT_PERIOD *&--------------------------------------------------------------------* *& Form GET_DATA_FROM_PERIOD *---------------------------------------------------------------------* form GET_DATA_FROM_PERIOD . select single * from T549Q where PERMO = and PABRJ = and PABRP = V_PERMO P_PABRJ P_PABRP. endif. endif. if R2 = 'X'. V_PERMO = T549A-PERMO. endif. P_ENDDA = T549Q-ENDDA. else. message E000 with 'Enter a valid Payroll Period'.where ABKRS = P_ABKRS-LOW and VWSAZ = '01'. select single * from T549A where ABKRS = P_ABKRS-LOW. P_BEGDA = T549Q-BEGDA. V_PERMO = T549A-PERMO. select single * from T549Q where PERMO = and PABRJ = and PABRP = if SY-SUBRC = 0. P_PABRJ = T569V-PABRJ. P_PABRP = T569V-PABRP. P_BEGDA = T549Q-BEGDA.

data: L_PERNR like PA0001-PERNR. if not W_MOLGA is initial. call function 'CU_READ_RGDIR' exporting PERSNR = it_final-pernr importing MOLGA = W_MOLGA tables IN_RGDIR = IT_RGDIR exceptions NO_RECORD_FOUND = 1 others = 2. endif. call function 'CD_READ_LAST' exporting BEGIN_DATE = P_BEGDA END_DATE = P_ENDDA importing OUT_SEQNR = W_SEQNR tables RGDIR = IT_RGDIR exceptions NO_RECORD_FOUND = 1 others = 2. loop at IT_RGDIR into WA_ITRGDIR where fpper = p_begda+0(6) and INPER = P_BEGDA+0(6). clear W_SEQNR. sort IT_RGDIR by FPEND descending.**********************************************Added By ABAPER********** ******************************************************** *&--------------------------------------------------------------------* *& Form GET_RT_DATA *---------------------------------------------------------------------* form GET_RT_DATA . w_seqnr = wa_itrgdir-seqnr. select single RELID from T500L .

. case WAGETYPE. when '5010'. IT_FINAL-AMOUNT2 = IT_FINAL-AMOUNT2 + WA_RT-BETRG. endcase. WAGETYPE = WA_RT-LGART. endloop. IT_FINAL-TOTAL = IT_FINAL-AMOUNT1 + IT_FINAL-AMOUNT2.into W_RELID where MOLGA = W_MOLGA. loop at IT_RESULT-INTER-RT into WA_RT . IT_FINAL-THRS = IT_FINAL-HRS1 + IT_FINAL-HRS2. when '5000'. call function 'PYXX_READ_PAYROLL_RESULT' exporting CLUSTERID = W_RELID EMPLOYEENUMBER = L_PERNR SEQUENCENUMBER = W_SEQNR READ_ONLY_INTERNATIONAL = 'X' changing PAYROLL_RESULT = IT_RESULT exceptions ILLEGAL_ISOCODE_OR_CLUSTERID = 1 ERROR_GENERATING_IMPORT = 2 IMPORT_MISMATCH_ERROR = 3 SUBPOOL_DIR_FULL = 4 NO_READ_AUTHORITY = 5 NO_RECORD_FOUND = 6 VERSIONS_DO_NOT_MATCH = 7 ERROR_READING_ARCHIVE = 8 ERROR_READING_RELID = 9 others = 10. IT_FINAL-HRS2 = IT_FINAL-HRS2 + WA_RT-ANZHL. if IT_FINAL-HRS1 is not initial or IT_FINAL-HRS2 is not initial. L_PERNR = IT_FINAL-PERNR . endloop. IT_FINAL-AMOUNT1 = IT_FINAL-AMOUNT1 + WA_RT-BETRG. IT_FINAL-HRS1 = IT_FINAL-HRS1 + WA_RT-ANZHL.

IT_FINAL-AMOUNT2. IT_FINAL-THRS. " Added for summing up the total Hours ( Kalyan on 05. IT_FINAL-HRS1. ****For OffCycle ES 08082012. L_PERNR = IT_FINAL-PERNR . w_seqnr = wa_itrgdir-seqnr.2010 ) append IT_FINAL . call function 'PYXX_READ_PAYROLL_RESULT' exporting CLUSTERID = W_RELID EMPLOYEENUMBER = L_PERNR SEQUENCENUMBER = W_SEQNR READ_ONLY_INTERNATIONAL = 'X' changing PAYROLL_RESULT = IT_RESULT exceptions ILLEGAL_ISOCODE_OR_CLUSTERID = 1 ERROR_GENERATING_IMPORT = 2 IMPORT_MISMATCH_ERROR = 3 SUBPOOL_DIR_FULL = 4 NO_READ_AUTHORITY = 5 NO_RECORD_FOUND = 6 VERSIONS_DO_NOT_MATCH = 7 ERROR_READING_ARCHIVE = 8 ERROR_READING_RELID = 9 others = 10. TOTAL1 = TOTAL1 + IT_FINAL-AMOUNT2. endif. CLEAR: W_SEQNR.TOTAL = TOTAL + IT_FINAL-AMOUNT1. . TOTALHR1 = TOTALHR1 + IT_FINALHRS1.08.08. IT_FINALHRS2.2010 ) TOTALHR2 = TOTALHR2 + IT_FINALHRS2. IT_FINAL-TOTAL. loop at IT_RGDIR into WA_ITRGDIR where ( OCRSN = '3020' ) and PAYDT = P _BEGDA. IT_FINAL-AMOUNT1. ***************** ENDIF. " Added for summing up the total Hours ( Kalyan on 05. select single RELID from T500L into W_RELID where MOLGA = W_MOLGA.

" Added for summing up the total Hours ( Kalyan on 05.2010 ) append IT_FINAL .08. TOTAL1 = TOTAL1 + IT_FINAL-AMOUNT2. endloop. IT_FINAL-AMOUNT1 = IT_FINAL-AMOUNT1 + WA_RT-BETRG.2010 ) TOTALHR2 = TOTALHR2 + IT_FINALHRS2. TOTAL = TOTAL + IT_FINAL-AMOUNT1. endform. WAGETYPE = WA_RT-LGART. IT_FINAL-HRS2 = IT_FINAL-HRS2 + WA_RT-ANZHL. IT_FINAL-HRS1 = IT_FINAL-HRS1 + WA_RT-ANZHL. IT_FINAL-AMOUNT2 = IT_FINAL-AMOUNT2 + WA_RT-BETRG. TOTALHR1 = TOTALHR1 + IT_FINALHRS1. IT_FINAL-TOTAL = IT_FINAL-AMOUNT1 + IT_FINAL-AMOUNT2. when '3095'. " GET_RT_DATA . IT_FINAL-THRS = IT_FINAL-HRS1 + IT_FINAL-HRS2. when '3100'. endloop. endif. case WAGETYPE. endcase. ****For OffCycle ES 08082012.08. clear IT_FINAL . if IT_FINAL-HRS1 is not initial or IT_FINAL-HRS2 is not initial. " Added for summing up the total Hours ( Kalyan on 05.loop at IT_RESULT-INTER-RT into WA_RT .

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)//-->