SAP Function SGPS_CALC_APE_AVG_COMMON - Function Module for computing APE

Parameter Reference Type Length Default Optional Text
BDATE SYST-DATUM D 8 Begin Date
BPAYP PC261-INPER C 6 In-period for payroll (Begin)
EDATE SYST-DATUM D 8 End Date
EPAYP PC261-INPER C 6 In-period for payroll (End)
MOLGA T001P-MOLGA C 2 Country Grouping

Parameter Reference Type Length Text
APE_AMT P0495-APEAMT P 7 Pensions Scheme Annual Pensionable Emolument Amount
BS_AMT P0495-PBSAMT P 5 SG Public Sector Pensions Scheme Basic Salary Per Annum
MAPE_AMT P0495-APEAMT P 7 Monthly APE Amount
MBS_AMT P0495-PBSAMT P 5 Monthly Pensionable Salary
MPA_AMT P0495-PAAMT P 5 Monthly Pensionable Allowance
PA_AMT P0495-PAAMT P 5 SG PS Pensions Scheme Pensionable Allowance Per Annum

Parameter Reference Length Optional Text
TAB_0001 P0001 322 Internal Table of infotype 0001

Exception Text
NO_RGDIR No single entry of payroll results in RGDIR
RPIMP_ERROR Error when performing macro 'rp-imp-c2-rr'
SIM_ERROR Error when performing 'HR_PAYROLL_SIMULATION_SUBMIT'

Functionality
This function module helps to compute the Annual Pensionable Emolument(APE) of an employee for cases in which no averaging of the the last 3years is required, ie. no promotion, reversion or reduction due todisciplinary action during the last 3 years prior to an employee'sretirement.
It will first attempt to read from the payroll cluster the last regularpayroll result of the employee just prior to retirement. If no payrollresult could be found, it shall simulate payroll run for the employee.
Afterwhich, it will retrieve from the results table the wage types /PENand /PEB (Pensions Scheme wage types customised based on ProcessingClass 86) to determine the APE amount, the Pensionable Salary Per Annumand the Pensionable Allowance Per Annum.
One worthy point of note is that if there is a WPBP split in the lastpayroll result, it will pick up the last relevant pay details of theemployee. Please copy this standard function module and amend otherwiseif you have your own otherwise specific requirements.

Example
In last payroll result, we have in RT:
WT,,APZNR,,BETRG($)
/PEB,,01,,2400
/PEB,,02,,2600
/PEN,,01,,2700
/PEN,,02,,2950
In WPBP table:
APZNR,,BEGDA,,ENDDA
01,,20001101,,20001104
02,,20001105,,20001130
In the above example, our current function module will pick up theentry with APZNR=02, ie the last valid record. APE will be returned as$2950*12 while Basic Salary Per Annum as $2600*12.
Pensionable Allowance Per Annum will be returned as the differencebetween the APE and the Basic Salary (APE - Basic Salary)