Step-by-step guide to create payroll custom function

Snap1.jpg

This document contains step by step procedure to create custom payroll function.

What is a Custom function?

Payroll function and Schema plays very important roles in SAP HCM payroll run. Functions are used to calculate different amounts on the basis of master data and time data, wage type values etc. SAP provides many standard functions to calculate the amount for payroll run. We can also create custom functions with custom calculations as per business requirements and tweak into payroll schema.

How to create one?

Before we create a function, we must create, check, and save the source text for the new function in an include. For Payroll Accounting functions and operations, you use the include RPCBURZ0; for Time Management functions and operations, you use the include RPTMOZ00.

Go to se38 and enter RPCBURZ0 and click on change, for the first time in every project it would ask for Access Key, once we generate one key for change access we don’t need to do it every time we create a function/operation. It is a one time activity

Create a custom include which will have source text for all your custom functions/operations created in your project.

Snap1.jpg

In custom include ZHPY_RPCBURZ0 create your own custom include for your custom function for example ZTEST

Snap2.jpg

In custom include created above subroutine of your custom function ZTEST which has the source text is placed with form name as FUZTEST.

Snap3.jpg

Now go to PE04 transaction code to create/display custom functions and operations

Type ZTEST in name field and select payroll and function as object class and type and click on Create

Snap4.jpg

Enter the description text  relevant to the functionality, form routine is defined by standard as FUZTEST (which we have created above in the include) we can also self define our own form name.

Check the checkbox of the countries depending on this the form or the source text will be called in respective country’s payroll schema

Define the parameters in the parameters section by which data will flow into the subroutine

Snap5.jpg

In order to go to the source code we have to click on the below highlighted button which will take you to the subroutine of the custom function which we have created in RPCBURZ0

Snap6.jpg

Select the payroll program of the country which we have chosen in the country assignment section

Snap7.jpg

Snap8.jpg

We can write our ABAP code as per our business requirement as per the below Screen shot.

Snap9.jpg

Once the code is written, we have to activate the source code and also save and activate the function in PE04

Finally we can call the above custom Function in our custom schema where ever necessary as below

Snap10.jpg

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.