We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
In the standard system, the minimum working time that is defined for an benefits eligibility rule is checked by the subroutine SAP_CHECK_ELIG_DATE. As an alternative to this, there is the function exit EXIT_SAPFPBEN_015 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_CHECK_ELIG_SERVICE. If, for example, you have created customer-specific infotypes or modified existing infotypes, you can use their contents to check the minimum working time.
The system defines the input parameters:
You then specify the output parameter:
In the standard coding, the return code _SUBRC = 0 means that the employee meets the minimum working time requirement. The return code _SUBRC = 1 means that the employee has not fulfilled the criteria.
In additon to this, you can define two exceptions to the standard coding:
In the following sample coding, an employee's minimum working time is indirectly evaluated. The customer has modified infotype 0171 'Gen. Benefits Data' and has added an additional field, FLAG1 (type character, length 1 byte) to this structure.
The customers' requirements are: to use the actual hours worked to check to see whether the employee has ever worked 1000 hours per calendar year during his/her employment. A customer-specific report performs this check. This report periodically evaluates the employee's time data and sets the value in the field P0171-FLAG1 to either TRUE or FALSE.
The function exit EXIT_SAPFPBEN_015 only needs to determine whether the condition '1000 hours per year' is defined for the eligibility rule and whether the field P0171-FLAG1 contains the value TRUE.
RP-DEF-BOOLEAN. "Defines constants TRUE and FALSE
SELECT * FROM T5UBV WHERE BAREA EQ _BAREA
AND BELIG EQ _BELIG
AND ELIGR EQ _ELIGR
AND ENDDA GE _EDATE
AND BEGDA LE _EDATE
ORDER BY PRIMARY KEY.
IF SY-SUBRC NE 0.
IF ( T5UBV-SRVNO EQ '1000' ) AND ( T5UBV-SRVPD EQ '013' ).
RP-READ-INFOTYPE _PERNR 0171 P0171 _EDATE _EDATE.
READ TABLE P0171 INDEX 1.
IF SY-SUBRC NE 0.
IF P0171-FLAG1 EQ TRUE.
_SUBRC = 0.
_SUBRC = 1.
For information on how to store your own coding and data declarations in a function exit, please refer to the online docuemntation on the transaction Project Management of SAP Enhancements.