We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

EXIT_SAPFPBEN_009 -

EXIT_SAPFPBEN_009 -

Vendor Master (General Section)   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Customer-specific calculation of the credit amount

In the standard SAP system, an employee's credit amount is calculated by the subroutine CALC_BENEFIT_CREDIT. As an alternative to this, there is the function exit EXIT_SAPFPBEN_009 contained in the function group XPBE. This function exit is described below.

The function exit allows you to integrate your own logic into the standard SAP system instead of that suggested by CALC_BENEFIT_CREDIT. If, for example, you have created customer-specific infotypes and database tables, you can use their contents to calculate the credit amount.

The system explicitly defines the input parameters:

  • _PERNR personnel number
  • _BAREA benefit area
  • _BPLAN benefit plan
  • _BFLEX credit formular
  • _DATUM cutoff date
  • _BENSL benefit salary
  • _BENGR employee benefit group
  • _BSTAT employee status

You then specify the output parameters:

  • _CRAMT credit amount
  • _PERIO period for calculating the credit amount

In addition to this, you can define two exceptions to the standard coding:

  • STANDARD_CALCULATION if CALC_BENEFIT_CREDIT is to be executed
  • CUSTOMER_ERROR if an error message is to be registered

In the following sample coding, the credit amount should be read from a customer-specific database table ZCRDT. The credit amount and the relevant credit period can be stored in the table ZCRDT.

The credit amount should be read directly from ZCRDT in all clients. Only in the standard client 000 should CALC_BENEFIT_CREDIT be accessed.

TABLES: ZCRDT.

CASE SY-MANDT.
WHEN 0.
RAISE STANDARD_CALCULATION.
WHEN OTHERS.
SELECT * FROM ZCRDT WHERE BAREA EQ _BAREA
AND BPLAN EQ _BPLAN
AND BFLEX EQ _BFLEX
AND ENDDA GE _DATUM
AND BEGDA LE _DATUM.
EXIT.
ENDSELECT.
IF SY-SUBRC NE 0.
RAISE CUSTOMER_ERROR.
ENDIF.
_CRAMT = ZCRDT-CRAMT.
_PERIO = ZCRDT-PERIO.
ENDCASE.

For information on how to store your own coding and data declarations in a function exit, please refer to the online documetation on the transaction Project Management of SAP Enhancements.






Fill RESBD Structure from EBP Component Structure   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 2968 Date: 20200922 Time: 093839     sap01-206 ( 147 ms )