Professional Documents
Culture Documents
Implementing Validation Rules in The New Payroll Control Center - SAP Blogs
Implementing Validation Rules in The New Payroll Control Center - SAP Blogs
Implementing Validation Rules in The New Payroll Control Center - SAP Blogs
Community
Steve Cottrell
May 13, 2016 12 minute read
As many of you are aware, the new Payroll Control Center provided by SAP gives powerful and user friendly functionality to the execution and validation of payroll within SAP.
The Rapid Deployment Solution (RDS) for the new Payroll Control Center has just been released (here) along with many great validation rules and KPIs that you can use to rapidly implement
the PCC for your business / customers.
However, it will also be important that you can add additional value to your customer by implementing customer speci c validation rules over and above what is provided in the RDS. This Blog
goes through, at a high level, how to create a new validation rule. It should be read in conjunction with the PCC RDS overview on SCN available here. This Blog is merely a summary with high
level aspects. To go through it all in detail would be more of a training course than a blog.
Basic Principles
Firstly – the purpose of any validation rule is to, as quickly and easily as possible, provide the information required to resolve the issue.
Secondly – it is also as important to build a validation rule’s solutions in a way that mean the issue can be resolved directly from the PCC (and even potentially automatically).
Thirdly – be creative. The validation rules are not restricted to information in a particular logical database (i.e. PNP or PNPCE etc). You can write validation rules or KPIs that look across
aspects of the system that are not just HR. For example, in the PCC RDS there is a KPI that checks all posting documents are successfully posted in SAP Finance. It does this by reading nance
tables to check that the posting run ID from payroll is within the documents posted in the BKPF nance table. Due to the PCC not being restricted to just the HR and Payroll module, you could
create a KPI for things like establishing all vendor payments posted from payroll to accounts payable have been paid (for example), whether all inbound interface les have been received, etc
etc.
Fourthly – performance. It’s important that what you write will run in a reasonable time-frame so it’s practical to be used. Therefore it’s of signi cant bene t if you use declustered payroll
results rather than traditional function modules and macros to read payroll results.
For the purpose of this blog we’ll stick to creating an example employee related validation rule. The example I’ll give here is a validation rule to establish where employees are assigned to
multiple positions in the Org Chart and their total FTE assignment for the sum of those positions is above 100%.
To create a new validation rule, it’s best to copy one of the existing ones provided in the RDS, such as class /SMBERP/CL_PYD_PA_MAIN_BANK.
IF_PYD_TY_RT~EXECUTE – This method is used to establish which employees have the issue of the type that your validation rule is looking for. It’s the main engine to search for errors.
ERR_OV_GET_LIST – Provides information as to the reason why the employee came up as an error in the validation rule
ERR_SOL_GET_LIST – Provides the options to guide the Payroll Administrator to correct the error
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 1/7
5/18/2021 Implementing validation rules in the new Payroll Control Center | SAP Blogs
There are also several methods called RDTs or Results Detail Types (These are the YSMB* methods). The purpose of these is to show information in the detailed section of the Error
Management view of the PCC. For example, method YSMB_WAGE_TYPE_REPORT shows the below information in the detail section of the Error Management view:
Once you have copied an example RDS class to your class name (and activated it), you’ll need to perform some con guration steps so that the class gets called. Only once you’ve validated you
can get your copied class to work would I suggest you start changing it to meet your needs.
The con guration steps for the validation rules are in section Payroll -> Payroll: International -> Payroll Data Source Framework of the IMG. Note – these con guration steps are explained in far
more detail in the Implement Con guration Guide “Implementing Payroll Control Center Validation Rules (FM1)” document in the PCC RDS (here).
Step 1 – Create Data Source Types – Create Data Source Types. This step is used to create the linkage between the Data Source Type and the validation rule class you are creating, see below:
It de nes what parameters you will be passing to your class (Personnel Area for example), what results detail types (RDTs) you will be displaying for your validation rule, and what reasons you’ll
present the user to be able to select in order to mark the validation rule as ‘Resolved’ for that employee.
Step 2 – De ne Data Source Instances is the step I normally then jump to in the IMG. This step holds the values of the parameter you will be passing to your validation rule. For example, in the
Personnel Area parameter mentioned in Step 1 above you may be passed Personnel Area US01 in order that your validation rule class can restrict the employees the rule is run for to only be
those in Personnel Area US01
Step 3 – Classify Data Sources -> Set Up Data Source Classes. This step de nes what folders the validation rule will appear in and is used for logical grouping. You may de ne your groupings by
the type of validation rule or the team that will process a group of validation rules so the Payroll Manager can easily assign out those validation rules in the Monitoring step of the PCC.
Perform the above steps by copying the entries for the validation rule you are copying from. Once the above 3 steps have been setup, when you run the “Initiate Policies” step of the PCC, it will
execute your validation rule:
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 2/7
5/18/2021 Implementing validation rules in the new Payroll Control Center | SAP Blogs
The purpose of the Execute Method is to identify the employees that have an issue in the quickest possible way. Here we are not concerned with periphery information about the employee like
their name, basic pay etc, we simply want to get a list of employees that have the problem that this validation rule is there to identify, nothing more.
Now you have got this copied validation rule to run from the PCC, you need to look at altering the code to perform the validation you want for your customer. Below is my example.
METHOD if_pyd_ty_rt~execute.
TYPES:
BEGIN OF t_hrp1001,
END OF t_hrp1001.
DATA:
……
CASE ls_par–par_type.
WHEN ‘ABKRS’.
l_abkrs = ls_par–low.
WHEN ‘PERIOD’.
l_period = ls_par–low.
WHEN ‘PERSA’.
l_persa = ls_par–low.
ENDCASE.
ENDLOOP.
“TODO
ELSE.
RETURN.
ENDIF.
lv_pabrj = l_period(4).
lv_pabrp = l_period+4(2).
imp_pabrp = lv_pabrp
exp_endda = lv_endda ).
* Get all positions with 008 relationships between period start and end date
* Sum the FTE percentage for each day within the pay period
lv_date = lv_begda.
“Note OpenSQL below in order to establish using one database query what items have an error
it01~sprps = ‘ ‘ AND
GROUP BY hrp1001~sobid.
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 3/7
5/18/2021 Implementing validation rules in the new Payroll Control Center | SAP Blogs
ENDLOOP.
lv_date = lv_date + 1.
ENDWHILE.
ls_result–par_type = if_pyd_cont_types=>gcs_par_type–pernr. “Note the results parameter type always has to be pernr
“Note the only item you can pass out of this method is a list of employee numbers. You can’t pass out anything else in the structure
like their name, location, employee group etc. You can fill that information per employee later in the IF_PYD_TY_RT~RESULT_DETAILS_GET
method
ls_result–id = ls_hrp1001-sobid.
ENDLOOP.
ENDMETHOD.
Now, in order to debug your code to check that it is getting called and establish any errors or changes you may need to make to it, you can debug the job in SM37. To do that put a break point in your
EXECUTE method, select the ‘00001/Execute Check Instances’ job in SM37 and then enter jdbg in the transaction box on the top left.
This will then debug the job and you can hit F8 to run to your break-point:
Now you should be able to debug your validation rule to see if it’s not working as you want and adjust accordingly. It’s not practical to debug the rule using the normal method of running it via SE24 or
SE80.
Once you have adjusted your EXECUTE method to the correct logic to identify the employees with an error, you can then move onto presenting information about that error to your Payroll
Administrators in a way that will enable them to resolve the error as quickly as possible, i.e. the second principle in the intro section above.
There are 3 sections of the PCC Error Management view that you can alter in order to present relevant information to the user, they are:
ERR_KV_GET_LIST – This method is used to populate key values in the error screen. It has not been used significantly in the PCC RDS, but is available to use if of value.
ERR_OV_GET_LIST – This method provides information as to the reason why the employee came up as an error in the validation rule
ERR_SOL_GET_LIST – This is a very important method as it enables you to give the possibility of enabling the users to resolve the issue with as little e ort as possible. This doesn’t necessarily mean the
e ort for the business users is small, but rather you have the chance here to set things up for the user to that they have the most e cient path available to them to resolve the issue. Where possible call
transactions directly in SAP or SF in order to allow the administrator to directly resolve the issue.
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 4/7
5/18/2021 Implementing validation rules in the new Payroll Control Center | SAP Blogs
You’ll need to update the code in the above methods to provide the user information as to why an employee has come up in error and provide a means to resolve that error.
For example, in my validation rule here I call SAP WEBGUI when the user clicks on the link “Remove Excess Position assignment” in method ERR_SOL_GET_LIST to allow the user to alter the
position assignment of this employee:
Once you have done the above, your validation rule is setup, working and tailored to the business need.
Other aspects
This blog is at a very high level, and there are additional things that can be done to further add value to the business users. You can create KPI’s which can be used for things like reconciliations,
payroll status tracking etc. These work on a similar, but less complex way to the validation rules.
Also, there are several Results Detail Types provided in the RDS, but you can also define your own if there is particular information you may want to show the Payroll Administrator. For example, if you
have a validation rule in the time management area you may want to have an RDT that shows a time statement for the employee who has an error. Remember we want to make sure the Payroll
Administrator has all they need to be able to resolve the issue without having to exit the PCC and run a transaction or program in ECC (or SF) to find out further information about this error.
In Summary
Hopefully this blog helps to clarify that validation rules in the PCC are generally not onerous to build and are very powerful from a user experience perspective. Additionally, if you can structure your
rules and solutions so that the solutions provide a means to resolve the issue automatically or with minimal input you can significantly reduce the work your customers will need to do in order to
complete their payroll correctly and accurately.
Alert Moderator
Assigned tags
HCM (Human Capital Management) | SAP ERP | controlcenter | employee central | enterprise resource planning |
View more...
Learn about the Payroll Control Center for SAP Payroll & SuccessFactors Employee Central Payroll (Non Technical)
By Imran Sajid , Aug 26, 2016
Related Questions
6 Comments
Jarret Pazahanick
Like(0)
Former Member
Hi Steve,
This is a very good Blog! I like that you go into some of the details not just what we can read in help les
Thanks,
Serge
Like(0)
Imran Sajid
Like(0)
Former Member
I have a question: Is it possible to add several values for parameter? For example list of Wage Types I need to check?
I've tried to set it via customising, but got this error when I try to add second Wage Type:
Thank you!
Like(0)
Imran Sajid
Hi Maratkuls,
Yes this is possible but your input parameter would not be LGART. You would have di erent parameters such as LGART_HIGH and LGART_LOW which you would use to specify the range of
values (Ex: Wage Types 3000 to WT 3999) and of course the ABAP Code needs to be able to handle and read these parameters for the validation check.
Do you have the new PCC RDS installed in your system? If so, take a look at the setup of the validation rule "Positive deductions within a range".
If you are using the process context functionality which was released in 1602 then you should pass the values for wage type(s) from the code via the constants/custom table or even hard coding
(Usually not recommended) the value if you know that they are not going to change.
Regards,
Imran
Like(0)
Former Member
Hi Team,
We are in the process of upgrading the Payroll Control Center (FP2) to PCC FP5. As per the documentation, I understand that the below Business Functions must be activated to ensure that the
new layout is visible in the front end. Please con rm if anything else is needed to view the Process Templates (PYP_V2_TEST_PAYROLL, PYP_V2_PRODUCTIVE_PAYROLL in the front end. Also,
after adding a custom process and adding a Policy to the Process, while generating the Process, the error 'Incorrect input parameters for check type PYD_EXAMPL_PERNR_CHECK_FP3 in
policy PAYROLL_POLICY_EXAMPLE_1' which eventually is a standard check.
HCM_LOC_CI_50
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 6/7
5/18/2021 Implementing validation rules in the new Payroll Control Center | SAP Blogs
HCM_LOC_CI_62
HCM_LOC_CI_63
HCM_LOC_CI_68
HCM_LOC_CI_72
HCM_LOC_CI_76
HCM_LOC_CI_79
HCM_LOC_CI_88
HCM_LOC_CI_89
HCM_LOC_CI_92
Please advise, how to re ect the new layouts in the front end.
Thanks,
Debjani
Like(0)
Find us on
Newsletter Support
https://blogs.sap.com/2016/05/13/implementing-validation-rules-in-the-new-payroll-control-center/ 7/7