Program to retrieve sickpay values
The following program allows you to retrieve all the individuall sickpay values for a given period and person. This data is then exported to memory using the memory id entered on the selection screen. This therefore allows you to submit this program from another program and then process the data within the calling program by importing the data from memory. SAP ncale sick value example .
************************************************************** * Report: ZSXP_ABSENCE_DATA * * * * Author: www.SAPdev.co.uk * * * * Date : 12.02.2003 * * * * Description: Retrieve maternaty/Sickness Absence data * * ************************************************************** REPORT ZSXP_ABSENCE_DATA LINE-SIZE 100 NO STANDARD PAGE HEADING MESSAGE-ID 5g. TABLES: t554s, pernr, pcl1, pcl2. INCLUDE rpclst00. INCLUDE rpc2rx09. "Payroll results datadefns-Intl. INCLUDE rpc2rxx0. "Payroll results datadefns-Intl. INCLUDE rpc2rgg0. "Payroll results datadefns-GB INCLUDE rpcfdcg0. "Payroll results datadefns-GB INCLUDE rpcdatg0. INCLUDE rpc2cd00. "Cluster Directory defns. INCLUDE rpc2ps00. "Cluster: Generierte Schematas INCLUDE rpc2pt00. INCLUDE rpcfdc10. INCLUDE rpcfdc00. INCLUDE rpppxd00. INCLUDE rpppxd10. INCLUDE rpcfvp09. INCLUDE rpcfvpg0. INCLUDE rpppxm00. INFOTYPES: 0001, "Organisational assignment 0002, "Personal Data 0003, "Payroll Status 0088, "SMP 2001, "Absences 0086. "SSP/SMP Exlclusions DATA: ssp_weeks TYPE p DECIMALS 2 VALUE 0. DATA: ssp_total TYPE p DECIMALS 2 VALUE 0, total_val TYPE p DECIMALS 2 VALUE 0, smp_weeks TYPE p DECIMALS 2 VALUE 0, smp_value TYPE p DECIMALS 2 VALUE 0, gross LIKE pc207-betrg, dis_gross TYPE p DECIMALS 2 VALUE 0. DATA: gd_begda(10) TYPE c, gd_endda(10) TYPE c. DATA: ld_orgtxt LIKE t527x-orgtx. DATA: name(30). DATA: BEGIN OF itab OCCURS 0, pernr LIKE p0002-pernr, perid LIKE p0002-perid, name LIKE name, END OF itab. TYPES: BEGIN OF t_report, pernr TYPE pernr-pernr, "8 name TYPE name, "30 awart TYPE p2001-awart, "4 begda TYPE p2001-begda, "10 endda TYPE p2001-endda, "10 wkspaid TYPE p DECIMALS 2, "10 amtpaid TYPE p DECIMALS 2, "10 END OF t_report. DATA: it_report TYPE STANDARD TABLE OF t_report INITIAL SIZE 0, wa_report TYPE t_report. DATA: moabw LIKE t001p-moabw. DATA: printheader TYPE i VALUE 1, gd_success TYPE i. * NCALE declarations TYPES : BEGIN OF pfra0_pcale, annee(4) TYPE c. INCLUDE STRUCTURE pcint. TYPES : END OF pfra0_pcale. TYPES : pfra0_tab_pcale TYPE pfra0_pcale OCCURS 0. DATA: it_ncale TYPE STANDARD TABLE OF pcnat INITIAL SIZE 0, wa_ncale TYPE pcnat, it_pcale TYPE pfra0_tab_pcale, pcale TYPE pfra0_tab_pcale. * SMP/SSP absence data data begin of it_msa occurs 0. include structure pc27j. data end of it_msa. parameters: p_memid type char30. ************************************************************************ *STAR-OF-SELECTION START-OF-SELECTION. gd_begda = pn-begda. gd_endda = pn-endda. gd_begda+6(2) = '01'. gd_endda+6(2) = '01'. refresh: it_msa. clear: it_msa. GET pernr. ** PERFORM IMPORT_PC USING GD_SUCCESs. PERFORM get_rgdir. while gd_begda le gd_endda. PERFORM get_new_rg USING gd_begda. CALL FUNCTION 'CALCULATE_DATE' EXPORTING * DAYS = '0' MONTHS = '1' START_DATE = gd_begda IMPORTING RESULT_DATE = gd_begda. endwhile. msa[] = it_msa[]. EXPORT msa TO MEMORY ID p_memid. *&---------------------------------------------------------------------* *& Form GET_RGDIR *&---------------------------------------------------------------------* FORM get_rgdir. rp-init-buffer. CLEAR rgdir. REFRESH rgdir. MOVE pernr-pernr(8) TO cd-key-pernr. rp-imp-c2-cd. IF rp-imp-cd-subrc = 0. "rgdir success SORT rgdir BY seqnr ASCENDING. CLEAR rgdir. ENDIF. ENDFORM. *---------------------------------------------------------------------* * FORM get_new_rg * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> search_date * *---------------------------------------------------------------------* FORM get_new_rg USING search_date. DATA: rg_day TYPE d, rgbeg TYPE d, rgend TYPE d. MOVE: search_date TO rg_day. CLEAR: msa. LOOP AT rgdir WHERE void NE 'V'. MOVE: rgdir-fpbeg TO rgbeg, rgdir-fpend TO rgend. IF ( rgbeg <= rg_day ) AND ( rgend >= rg_day ) AND rgdir-srtza = 'A'. "Must be periods actual set of results EXIT. ENDIF. ENDLOOP. UNPACK rgdir-seqnr TO rx-key-seqno. MOVE pernr-pernr(8) TO rx-key-pernr(8). rp-imp-c2-rg. append lines of msa to it_msa. IF rp-imp-rg-subrc <> 0. * rg fail ELSE. * rg success ENDIF. ENDFORM. *Text elements *---------------------------------------------------------- * 001 Sickness History for SSP 1 * 002 Employee Name. * 003 National Insurance Number. * 004 Payroll Number. * 005 Sickness Start Date * 006 Sickness End Date * 007 Number of weeks paid * 008 system-error: * 009 No SSP / SMP record found * 010 Absence type * 011 No. weeks paid * 012 Amount * 013 Organisation Unit. * T01 Sickness Absence types *Selection texts *---------------------------------------------------------- * SO_SAP SAP Att./absence types * SO_SMP SMP Att./absence types * SO_SPP SPP Att./absence types * SO_SSP SSP Att./absence types
Related Articles
Display organisational structure
SAP HR infotypes
GET PERNR LAST and GET PAYROL
Retrieve multiple contracts for HR personnel and include in locical database selection/report
SAP HR Development help - ABAP code and information on various areas of HR development in SAP
ABAP code to retrieve Absence type text(AWART) from SAP table
ABAP to retrieve country grouping for personnel with SAP
Deleting an SAP HR Infotype
SAP HR Infotype selection
Creating a New SAP Infotype using transaction PM01 and PPCI
Retrieve comment texts from cluster table for SAP infotype 19
SAP Function module to call ABAP report from managers desktop(MDT)
SAP User Exits to Add functionality to the PBO and PAI of HR infotypes
Create SAP HR report category for logical database selection within ABAP report
SAP HR Selection Screen example
Retrieve SAP personal work schedule
SAP HR Infotype Development Information, ABP and step by step instructions
Enhancing an Infotype - Add, change or modify fields of and SAP infotype
SAP Personal absence calander for SSP/SMP
ABAP Program to retrieve and display sickpay(SSP, SMP etc) with SAP
SAP Personal absence calendar (NCALE) using transaction PC00_M08_CLPC
Accessing NCALE data via the Results Log when running a payroll
Processing the SAP HR Organisation unit
SAP HR Payroll results ( transaction code: PC_PAYRESULT)
Payroll results (ABAP)
Display Payroll results using SAP transaction PC_PAYRESULT