In my opinion, the starting point for implementation of a positive time solution with time events in SAP HR should be the time recording terminals and its capabilities. Some Time Recording Terminals can record only clock in and clock out data. However, there are some advanced ones where you can record your absences, attendances and offsite work too.
Time Recording Terminals can be SAP certified. What this means is that the vendor of time recording system can get certification for their software to communicate with SAP R/3. Hence, standard interfaces made available by SAP can be used for communication with time recording system. When you are implementing positive time solution with time events for any client, you should ask your client to check with the time recording system vendor if the time recording terminals are SAP certified or not.
Let us understand the different method of integration between SAP R/3 and time recording terminals.
Types of Integration
Quite often, the integration between time recording system and SAP R/3 requires a two way interface. Below is a schematic representation of the integration.
SAP R/3 sends HR mini-master data to the time recording system for validation purposes when the employee swipes at the time recording terminals. The time recording system sends time events to SAP R/3 for evaluation purposes.
Below are the possible standard ways of integrating SAP R/3 with time recording system:
- HR PDC InterfaceThis method of integration between SAP R/3 and time recording terminals involves a BAPI based interface and the data transfer takes place through ALE using standard IDOCs (a standard file format with predefined fields). To use this method, we need SAP certified time recording terminals. A custom BAPI can also be created if the time recording terminals are not SAP certified.
- Communication Channel 1 (CC 1)transceiver based transfer and is the old method to transfer data between SAP R/3 and time recording terminals. This also requires CC1 certified time recording terminals. This method is not advisable to be used anymore.
- Sequential Files Method – This method is generally used when the time recording terminals are not SAP certified. The time events can be uploaded to R/3 using report RPTEUP10 from sequential files and the HR mini master records are downloaded to sequential files to update the time recording systems using report RPTEDO00.
Let us discuss HR PDC Interface and Sequential Files Methods.
HR PDC Interface Method
Below is the process flow for data exchange between SAP R/3 and Time Recording Terminals using HR PDC Interface.
Step 1: SAP R/3 downloads the HR mini master data to the time recording system using program RPTCC101. It will help to determine the employee id from the card id and check permissibility for time event types (clock in/clock out, start of break, end of break etc.) entered by the employee. The HR mini master will also be used for validation at the time recording terminals during clock in and clock out. It is recommended to run this program once in a day so that any new joiners or leavers get added to the list.
Step 2: The time event type groupings are downloaded using program RPTCC105 from SAP R/3 to time recording terminals so that employees can record clock ins and clock outs against the correct time event types (clock in/clock out, start of break, end of break etc.). It is recommended to run this program once during go live and after that on need basis whenever there is change in time event type groups.
Step 3: The upload of time events in SAP gets initiated by SAP using program RPTCC106 (HR PDC – Download Upload Request for Time Events). The program downloads the upload request for time events from SAP. On receiving the upload request, the time recording system uploads the time events data to SAP R/3. The frequency of this depends on client requirement – can vary from once a day to multiple times in a day. The personnel time events are uploaded in SAP and stored in interface table CC1TEV.
Step 4: Finally, the time events in interface table CC1TEV are posted to TEVEN and NT1 tables using program SAPCDT45. On successful posting, the time events are deleted from interface table CC1TEV. If the posting ends in error, the time events are again deleted from interface table CC1TEV. Sometimes, the time events don’t get posted because the personnel number may be locked and they remain in interface table to be picked up in the next run of the program. It is recommended to run this program once every hour.
Step 5: SAP provides program RPAFRV00 to post process time events that didn’t get posted to time management and ended in errors.
Below are the key data fields for HR PDC Interface:
HR Mini-Master IDOC
Time Event Types IDOC
Upload Request for Time Events Download IDOC
Time Events Upload IDOC
Sequential Files Method
Below is the process flow for data exchange between SAP R/3 and Time Recording Terminals using sequential files.
Step 1: The report RPTEDO00 downloads the mini-master records of the selected employees to a sequential file. The structure of the mini-master records is stored in table DWN01. The system selects employees who are assigned to a subsystem grouping. The flat file is placed in SAP Application Server and it is moved to time recording server using FTP.
Step 2: The time recording server can deposit the flat file into SAP Application Server using FTP. The program RPTEUP10 picks up the flat file and uploads the data to IT2011.
Below are the file formats for download and upload programs:
RPTEUP10 File Format
Our Solution for Client
The time recording terminals selected by our client were not SAP certified. Also, the time recording terminals could only record clock in (P10) and clock out (P20) data. We decided to use the sequential files method using outbound and inbound interfaces (SAP PI).
HR Mini-Master Download Program: We didn’t go for the standard download program as we just needed to send data related to time recording id, employee number and subsystem grouping. Hence, we developed a custom ABAP program for this purpose. The custom download program will extract the HR mini-master data from infotype IT0050 into a .txt file. The .txt file will be placed in a folder in SAP Application Server. This data will be used for validation purposes when employee clocks in/clocks out at the time recording terminals.
The first run will contain data for all employees. Subsequent runs will be only incremental data – changed or additional data for employees. If there hasn’t been any change or new data for an employee in IT0050, it doesn’t get sent in the daily run.
There may be a need to run the program for full load later on. Hence, we provided a checkbox for Full Load. If the checkbox for Full Load is checked, the download program will extract full data for active employees on that day. Otherwise, it will just extract incremental data.
Also, the input screen for the program had two options in the form of radio buttons for specifying the file download path:
- Download to local file
- Download to SAP Application Server
User would have to select one of the radio buttons to run the program.
The input screen also had a mandatory field to enter the company code. Based on the company code entered, the program will download data from IT0050.
A background job program will be scheduled to run the download program once every night to extract the HR mini-master data from IT0050 into a .txt file. The .txt file will be placed in a folder in SAP Application Server. The .txt file will be picked up by outbound interface program (SAP PI) and sent to time recording system application server. Once the .txt file is successfully sent to time recording system application server, the file in SAP Application Server is moved to archive folder.
HR Time Events Upload Program: SAP R/3 will receive time events .txt file from the time recording system through an inbound interface. SAP PI will place this file in a specified folder in SAP Application Server. If the time recording system agrees to provide the content in SAP format, no conversions will be required to be done by SAP PI. Or else, conversion logic will need to be put in place.
SAP provides a standard upload program RPTEUP10 to upload time events into interface table CC1TEV. However, we were not able to use the standard upload program because of the following reasons:
- It cannot delete a file after uploading its contents or move the file from one folder in SAP Application Server to another folder for archiving. This functionality is needed so that once the file content is uploaded into interface table CC1TEV; it is not picked up again in the next run.
- Also, the standard program works in local file mode and not in sequential file mode. If we try to upload the file from SAP Application Server using sequential file mode, it is not getting picked up. This is due to an issue in the open dataset statement. Please refer link http://scn.sap.com/thread/1262043
- The standard program can’t append the date of entry, time of entry (system date and time) and user id in the contents being uploaded into CC1TEV table.
For the above reasons, we had to clone the standard program into a custom Z program and perform modifications as there was no enhancement point available to check whether the standard function module was executed properly or not. The structure of file format for program RPTEUP10 was retained without any changes.
A background job for this custom program will get initiated by a proxy program in SAP PI the moment file gets placed in the specified folder in SAP Application Server. The background job will upload the contents of the .txt file (received from time recording system and available at a specified folder in SAP Application server) into interface table CC1TEV.
The front end of the custom Z program was kept same as the standard program RPTEUP10 and is shown below:
The output of the custom Z program was kept same as the standard program RPTEUP10 and is shown below:
HR Time Events Posting Program: After the file contents are uploaded into interface table CC1TEV, the next step is to post the time events from the interface table CC1TEV into TEVEN table. SAP provides a standard program SAPCDT45 to post time events from interface table CC1TEV into TEVEN table. However, we were unable to use the standard program because of the need to send email notification to the IT contact person in case of errors encountered in posting the time events.
For the above reason, we had to clone the standard program into a custom Z program and perform modifications into it so that it could send email notification to IT contact person if the posting of time events resulted in errors. The email id of the IT contact person would be maintained in a view maintainable custom Z table.
A background job program will be scheduled to run this custom posting program once every hour to post the time events from CC1TEV interface table to TEVEN table.
All functionalities in the standard program were retained in the Z program too.
The front end of the custom Z program for posting time events was same as standard program SAPCDT45 and is shown below:
The output of the custom Z program after posting run was same as that of standard program SAPCDT45 and is shown below:
While exploring the possibilities of building the integration solution between SAP R/3 and time recording system, I read at few places about building a custom ABAP program from scratch. I would not recommend this approach and would advise to customize the standard program RPTEUP10 so that we can leverage the file content structure put in place by SAP. Also, the posting program of SAP has a lot of inbuilt validations which we can leverage using this method.
Here, I come to the end of this knowledge artifact. Thanks for your patience to go through this document. I hope this has been useful for you.
You can also refer to other knowledge artifacts created by me at the below link: