Ansicht
Dokumentation
EXIT_SAPFPBEN_016 -
CL_GUI_FRONTEND_SERVICES - Frontend Services ABAP Short ReferenceThis documentation is copyright by SAP AG.
Customer-specific calculation of participation date
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:
- _PERNR personnel number
- _INFTY infotype
- _ITAB internal table for infotype _INFTY
- _PLTYP benefit plan type
- _BPLAN benefit plan
- _BEGDA benefit inclusion date
- _ELIDT eligibility date
You then specifiy the output parameter:
- _PARDT participation date
In addition to this, you can define two exceptions to the standard coding:
- STANDARD_CALCULATION execute SAP_CALC_PART_DATE
- CUSTOMER_ERROR error occured during calculation
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.
INFOTYPES: 0167,
0168,
...
DATA: L_PARDT LIKE P0167-ENDDA,
L_ENDDA LIKE PSKEY-ENDDA.
CLEAR _PARDT.
IF _BEGDA GT _ELIDT.
L_PARDT = _BEGDA.
ELSE.
L_PARDT = _ELIDT.
ENDIF.
L_ENDDA = L_PARDT - 1.
CASE _INFTY.
WHEN '0167'.
P0167[] = _ITAB[].
SORT P0167 ASCENDING BY PERNR
BAREA
PLTYP
ASCENDING BEGDA
DESCENDING BPLAN.
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.
ENDIF.
EXIT.
ENDLOOP.
WHEN '0168'.
...
WHEN OTHERS.
RAISE CUSTOMER_ERROR.
ENDCASE.
IF _PARDT IS INITIAL.
_PARDT = L_PARDT.
ENDIF.
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.
CL_GUI_FRONTEND_SERVICES - Frontend Services Addresses (Business Address Services)
This documentation is copyright by SAP AG.
Length: 3743 Date: 20240329 Time: 153357 sap01-206 ( 50 ms )