We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
In the standard system, an employee's participation date in a benefit plan is calculated by the subroutine SAP_CALC_PART_DATE. As an alternative to this, there is the function exit EXIT_SAPFPBEN_016 contained in the function group XPBE.
The function exit allows you to integrate your own logic into the standard system instead of that suggested by SAP_CALC_PART_DATE. If, for example, you want to use a customer-specific algorithm to calculate the participation date, then you can implement this here.
The system defines the following input parameters:
You then specifiy the output parameter:
In addition to this, you can define two exceptions to the standard coding:
The following sample coding is a modified copy of the standard rouutine SAP_CALC_PART_DATE from include FPBENE00. For a certain benefit plan type _PLTYP, the function exit selects the infotpye record that was valid on the day before the cut off date L_PARDT (see below).
If such an infotype record exists and if it also describes the benefit plan _BPLAN, then the function exit copies the participation date from this infotype record. Otherwise, the function exit defines the participation date as the cut off date L_PARDT, meaning that if uses either the inclusion in benefit date _BEGDA or the eligibility date _ELIDT depending on which one is later.
DATA: L_PARDT LIKE P0167-ENDDA,
L_ENDDA LIKE PSKEY-ENDDA.
IF _BEGDA GT _ELIDT.
L_PARDT = _BEGDA.
L_PARDT = _ELIDT.
L_ENDDA = L_PARDT - 1.
P0167 = _ITAB.
SORT P0167 ASCENDING BY PERNR
LOOP AT P0167 WHERE PLTYP EQ _PLTYP
AND BEGDA LE L_ENDDA
AND ENDDA GE L_ENDDA.
IF P0167-BPLAN EQ _BPLAN.
_PARDT = P0167-PARDT.
IF _PARDT IS INITIAL.
_PARDT = L_PARDT.
The above sample coding is delivered as form CUST_CALC_PART_DATE in the include LXPBEF16 with the function group XPBE.
For information on how to store your own coding and data declarations in a function exit, please refer to the online documentation on the transaction Project Management of SAP Enhancements.