Standard CATS time sheets do offer a variety of options for validation such as checks against employees‘ working time or whether WBS elements or internal orders are open for posting. However, what’s missing for some customers is a check against the planned hours or cost in CO. The SAP design assumes these checks are only happening with the CO analytics tools after the hours have been transferred into CO (and possibly PS). Some customers prefer these checks to happen before the transfer or even when an employee is just capturing the hours in ESS.
For checks after data capturing, but before approval or transfer, we provided tools for customers to run reports to reconsile captured hours agains planned or budgeted hours, so changes could be made before the month end, when transfers happen. A popular process is to automatically send emails to the responsible person for a project, where ours are going above plan.
When a customer wants this validation to happen as and when the employee is capturing the hours to create a warning or error message, it get’s quite difficult on the technical side. SAP offers enhancements for custom check routines, but within those enhancements, each daily entry is treated on its own. This means: whilst an employee is cpaturing data for a whole week at a time, there is no way through SAP standard to perform validations on the sum of that week’s entries. (For example, performing a check on a weekly or monthly budget.) To be able to perform checks on all data input on screen, an implicit enhancement is required.
An ordinary timesheet process may require a user to enter data for multiple days at the time; for instance in the example below, 8 hours are entered on Monday and 8 on Tuesday. If you implement enhancement CATS0003 in order to perform custom validation this data, however, you will find that you are only able to validate them separately; each entry is passed one by one through validation checks. You can not treat these entries collectively – for example to perform validations on a weekly or monthly budget. How can you get around this limitation?
Overview of CATS enhancement
Validations in CATS time sheets in enhancement CATS0003 are performed on each entry – for example, if an employee enters on Monday 4 hours to Cost Centre A, and 4 hours to Cost Centre B, that will be treated as two separate entries within the validation. Equally, any entries on separate days will be treated as separate entries. As data that is in the process of being input is not yet saved to the database, it is impossible – without further modification – to perform checks on all data being input as a collective sum.
For example, you may wish to implement a check against a weekly budget for a WBS element, and ensure that all input against it in a given week does not exceed that budget. This would necessitate two parts:
- Reading the sum hours that have previously been input and saved to the CATS database;
- Reading the sum of hours that the user is in the process of capturing on the screen.
Part 1 is easily implemented, Part 2 however, requires special custom modifications as even standard enhancements can not deliver this functionality. Fortunately, the modifications necessary to get around this can be covered with an implicit enhancement and are relatively simple, involving saving an internal table to the memory in one of the standard CATS checks function modules.
Technical Part
The data captured on-screen is passed to a function module, CATS_CHECK_INPUT; from where it is then passed to the validation check. However it is possible to create an implicit enhancement that sends the whole table of on-screen data to memory, so that it can then be retrieved from within the CATS0003 Enhancement (within Include ZXCATU03 to be specific).
In there, the data can be processed in many ways; in this case, we simply sum over all the rows in the on-screen data to get the total number of hours on-screen.
As demonstrated, the sum of input hours (8+8+6+6+7) equals 35, which is output in our message. In a customer implementation, we woudl use this number, add it to the number already stored in the CATS database for the relevant period and compare it with teh plan in CO to create the appropriate error or warning message as required.
Conclusion
This article only scratches the surface of what checks you might wish to implement; more complicated checks can be performed, discriminating by WBS Element, or other Receiver Objects. The critical point is that with this custom enhancement, all input can be considered as a collected entity rather than separated into daily entries. The combination of the SAP standard enhacements and BAdIs with a custom implicit enhancement allow some advanced integration between CATS and the CO, PS or PM modules not otherwise possible.




