Summary:
Custom time functions are required when the standard functions and PCRs (Personal Calculation Rule) are not able to fulfill the complex business requirements. This tutorial explains the step-by-step process to create a custom time function to fulfill those complex business requirements. But, before we start the step-by step process we will see what are Schema and Time Functions?
Schema and Time Functions: When Time evaluation report is executed, employee’s working and absence times are evaluated, the individual processing steps in this valuation are executed in a specific order. This specific sequence is known as Schema, and the individual processing steps are known as Functions.
Schema in time management determines the sequence in which the functions (individual processing step) are executed in time evaluation. With the help of functions data is either provided back to the internal tables in time evaluation or sets a switch which is then used to determine whether or not to process any activity.
Step-by-step process to create custom Time (PT) function
Step 1. Go to transaction code PE04. In the ‘Name’ field, give a name to your custom time function, then select ‘Time management’ radio button from the Object class tab, and then select ‘Function radio button from the Object Type tab. Finally, click on the create button.
You will see a pop-up message, stating that the function can only be created in SAP package. Accept by clicking on “Continue”
button.
Step 2. Now, enter a description for your function and select the radio button ‘Standard name’ from the ‘Name of form routine’ tab. You can also define a custom name by selecting the ‘Self-defined’ radio button.
Select ‘Other Counties’ checkbox from the Country assignment tab.
Step 3. Defining Input and Output parameters: When these functions are called in schema, they provide data to the internal time evaluation tables such as TIP, TES, and TZP etc, using input and output parameters.
For providing Input parameters, click on the Input parameters button.
Below is the screen which you will see after clicking on the Input parameters button.
Now click on the ‘Change’ icon
.
Click on the new entries button to create new input parameters.
Here, you can insert all the parameters which you are going to take from the internal tables of Time Evaluation.
After providing all the parameters click on save icon
.
Repeat the same procedure to provide the Output parameters. But, remember here you will insert all those parameters which will give data to the internal tables of Time Evaluation.
Step 4. Creating the Transport Request: Now return back to the initial screen of transaction PE01 and click on save icon. After pressing the save button, system will ask you to assign the function to a Standard SAP package.
After assigning the function to a standard SAP package, you will get the pop up to assign the transport request.
Step 5. Creating the form routine: Now we will create a form routine as specified in step two. We have selected standard name, so we will create the form routine with the name as ‘FUY0001’.
We will have to create this form routine in the standard include ‘RPTMOZ00’. For creating the form routine in standard include we will require the SAP access key.
This will not be overwritten by SAP in the next upgrade.
After inserting the form routine write your business logic.
Step 6. Using the custom function in Time Schema: In this step we will use our custom time function that we have created.
Go to transaction code PE01. Enter the name of your schema in which you wish to use your custom function.
Select the radio button ‘Source text’ in the ‘Subobjects’ tab and then click on ‘Change’
button.
Here, you can insert new lines to use your custom function.
Summary:
In this tutorial we have learned how to create a custom function in Time Management, so that it can be used in schema. Following the same process you can create custom functions in Payroll also. The only difference is that when you create a custom function in payroll, you will have to insert your form routine in the include PCBURZ990.













