Posted: Sat Oct 13, 2007 1:02 pm Post subject: Retrieve actual 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.
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.
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
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.