Your Payroll Processing Data Template
Your Payroll Processing Data Template
- Strategic data fields for payroll analysis
- Key milestones for process discovery
- System specific extraction guidance
Payroll Processing Attributes
| Name | Description | ||
|---|---|---|---|
| Activity Activity | The specific task or event occurring in the payroll process. | ||
| Description This attribute captures the name of the process step being executed, such as 'Time Sheet Submitted', 'Payroll Simulation Executed', or 'Payment Executed'. It forms the basis of the process map and allows analysts to visualize the sequence of operations performed during the payroll cycle. Data for this attribute is harvested from various logs including Workflow logs (SWWLOGHIST), Infotype change logs (CDHDR/CDPOS), and specific payroll status tables. Consistent naming conventions are applied during extraction to ensure that technical event codes translate into business-readable activity names. Why it matters It defines the nodes in the process graph, enabling the visualization of process flows, loops, and variants. Where to get Derived from SWWLOGHIST (Workflow), CDHDR (Change Documents), or PA03 (Control Record) status changes. Examples Time Sheet SubmittedGross Pay CalculatedAudit Exception FlaggedPayment Executed | |||
| Event Timestamp EventTimestamp | The exact date and time when the activity occurred. | ||
| Description This attribute records the precise moment an event took place, storing both the date and time. It is fundamental for calculating all time-based metrics, including cycle times, lead times, and throughput rates between different process stages. In SAP ECP, this is sourced from timestamp fields like Why it matters It allows for the calculation of duration between events, which is essential for identifying performance bottlenecks and SLA breaches. Where to get CDHDR-UDATE/UTIME, SWWLOGHIST-WI_CD/WI_CT, or specific audit log timestamps. Examples 2023-10-25T08:30:00Z2023-10-26T14:15:22Z2023-11-01T09:00:00Z | |||
| Payroll Record PayrollRecord | The unique identifier combining employee and pay period. | ||
| Description The Payroll Record acts as the central case identifier for the process mining analysis. It represents a single iteration of payroll processing for a specific employee within a defined pay period, linking all activities from the initial time sheet submission to the final tax filing. In SAP SuccessFactors Employee Central Payroll, this is typically constructed by concatenating the Personnel Number (PERNR) with the Payroll Year (PABRJ) and Payroll Period (PABRP), and potentially a sequence number (SEQNR) for distinguishing multiple runs. This granularity ensures that each payment cycle is analyzed as a distinct instance, allowing for precise cycle time measurement and error tracking. Why it matters It serves as the Case ID, grouping all relevant events to reconstruct the end-to-end process path for every paycheck issued. Where to get Constructed from SAP Cluster B2 (Time Evaluation Results) or PC_PAYRESULT tables (PERNR, PABRJ, PABRP, SEQNR). Examples 10023499-2023-1088291022-2024-01-SEQ01US-10293-2023-52 | |||
| Last Data Update LastDataUpdate | The timestamp of the most recent data extraction. | ||
| Description This attribute indicates when the data record was last refreshed in the process mining data model. It helps analysts understand the freshness of the data and ensures that the insights are based on current information. While not directly used for process flow analysis, it is crucial for data governance and validation, verifying that the dashboard reflects the latest state of the payroll system. Why it matters It ensures users are aware of data latency and helps in validating the currency of the reported metrics. Where to get Generated by the ETL / extraction script at runtime. Examples 2023-11-05T00:00:00Z2023-11-05T12:00:00Z | |||
| Source System SourceSystem | The system where the event data originated. | ||
| Description This attribute identifies the specific SAP SuccessFactors Employee Central Payroll instance or connected subsystem from which the data was extracted. In complex landscapes with multiple payroll systems or hybrid setups, this field ensures data lineage and traceability. It is particularly useful when analyzing data across different regional installations or when comparing performance between legacy and migrated systems. It is typically a static string configured during the data extraction setup. Why it matters It allows for data segmentation in multi-system environments and helps troubleshoot data quality issues by pinpointing the origin. Where to get System ID (SID) from the SAP installation or extraction configuration. Examples SAP_ECP_NASAP_ECP_EMEASuccessFactors_Core | |||
| Cost Center CostCenter | The cost center associated with the employee. | ||
| Description The Cost Center represents the financial department or unit to which the employee's costs are allocated. It serves as a proxy for the department in the 'Time Sheet Approval Bottlenecks' dashboard, helping to pinpoint which organizational units delay the payroll cycle. Found in the Organizational Assignment infotype (PA0001) as field Why it matters It allows for organizational drill-down to identify specific departments causing delays or rework. Where to get Table PA0001, field KOSTL. Examples CC-1000 FinanceCC-2000 ITCC-3000 Sales | |||
| Employee Type EmployeeType | Classification of the employee (e.g., Permanent, Contractor). | ||
| Description This attribute categorizes employees based on their employment relationship, such as active, retiree, or contractor. Variations in payroll processing complexity often correlate with employee type, with certain groups requiring more manual interventions or specific compliance checks. Technically sourced from the Employee Group ( Why it matters It helps identify if process variations or delays are specific to certain employment categories. Where to get Table PA0001, fields PERSG (Group) and PERSK (Subgroup). Examples Active EmployeeTraineePensionerHourly Contractor | |||
| Gross Pay Amount GrossPayAmount | The total gross pay calculated for the record. | ||
| Description This attribute represents the total monetary value of the gross pay before deductions. It is a fundamental metric for financial validation and is used to correlate high-value payments with increased audit scrutiny or approval lead times. Extracted from the payroll results table (RT), typically under specific wage types representing total gross (e.g., /101). It supports the 'Benefit and Tax Calculation Accuracy' analysis by providing the base for calculation. Why it matters It allows for analysis of process behavior based on payment value (e.g., do larger payments take longer to approve?). Where to get Payroll Results Table (RT), Wage Type /101 or similar. Examples 5000.002500.5010500.00 | |||
| Is Automated IsAutomated | Flag indicating if the activity was performed by a system user. | ||
| Description This Boolean attribute identifies whether a specific process step was executed by a background job/system user or by a human. It is crucial for the 'Bank Transfer Automation Monitor' to calculate the percentage of touchless processing. It is typically derived by checking the User ID against a list of known system accounts (e.g., 'BATCH', 'SAP_WORKFLOW'). Why it matters It helps measure automation rates and identify opportunities for reducing manual effort. Where to get Derived from User ID (e.g., if User IN ['BATCH', 'SYSTEM'] then true). Examples truefalse | |||
| Pay Cycle Frequency PayCycleFrequency | Indicates if the run is regular or off-cycle. | ||
| Description This attribute distinguishes between standard scheduled payroll runs and ad-hoc 'off-cycle' runs used for corrections or immediate payments. High volumes of off-cycle runs are a key indicator of process inefficiency and are tracked by the 'Off Cycle Payment Volume Analysis' dashboard. It is derived from the Off-Cycle Reason ( Why it matters It is critical for measuring the 'Off-Cycle Payment Ratio' KPI and targeting reductions in non-standard processing. Where to get Table RGDIR (Cluster Directory), field OCRSN or PAYTY. Examples RegularCorrection ABonus PaymentTermination | |||
| Pay Period PayPeriod | The specific period number within the fiscal year. | ||
| Description This attribute denotes the sequential number of the payroll period (e.g., 01 for January or the first bi-weekly cycle). It allows analysts to track performance trends over time and identify seasonality in processing workloads. Sourced from Why it matters It enables trend analysis and the identification of seasonal bottlenecks in specific times of the year. Where to get Table PA0001 or Payroll Results Cluster (RGDIR), field PABRP. Examples 01122652 | |||
| Payroll Area PayrollArea | Defines the specific payroll group an employee belongs to. | ||
| Description The Payroll Area groups employees who are processed together in the same payroll run, often based on pay frequency (e.g., monthly vs. bi-weekly) or organizational structure. This attribute is critical for segmenting the process analysis to compare performance across different employee populations. In SAP, this corresponds to the technical field Why it matters It enables the comparison of payroll cycle performance across different groups (e.g., Hourly vs. Salaried). Where to get Table PA0001 (Organizational Assignment), field ABKRS. Examples US Bi-WeeklyDE MonthlyExecutive Payroll | |||
| Payroll Specialist PayrollSpecialist | The user ID or name of the person processing the record. | ||
| Description This attribute captures the identity of the payroll administrator or specialist responsible for executing manual steps or approvals. It is the core attribute for the 'Specialist Throughput and Workload' dashboard, enabling the analysis of workload distribution and individual productivity. Sourced from the Why it matters It is essential for workload balancing and identifying human bottlenecks in the process. Where to get System fields (SY-UNAME) logged in CDHDR or Workflow Actor ID. Examples JSMITHKMILLERSYSTEM | |||
| Audit Exception Flag AuditExceptionFlag | Flag indicating if an audit exception occurred. | ||
| Description This attribute flags cases where validation rules triggered an exception or warning during the payroll simulation or calculation. It is the primary input for the 'Audit Exception Frequency' KPI. Data is often sourced from the payroll log or specific error message tables (FEHLER). A true value indicates the process flow included an exception handling path. Why it matters It highlights data quality issues and the need for manual intervention. Where to get Derived from presence of error messages in payroll log or specific status codes. Examples truefalse | |||
| Cycle Time (Days) CycleTimeDays | Total duration of the payroll process in days. | ||
| Description This calculated attribute measures the elapsed time from the process start (e.g., Time Sheet Submitted) to the end (e.g., Payment Executed). It provides a high-level view of process speed and is used in the 'End to End Payroll Cycle Duration' dashboard. It is computed as the difference between the maximum and minimum timestamps for a given case. Why it matters It is the primary metric for assessing overall process efficiency and speed. Where to get Calculated: EndTime - StartTime of the case. Examples 5.52.010.1 | |||
| Legal Entity LegalEntity | The company code or legal entity of the employee. | ||
| Description This attribute identifies the legal entity (Company Code) associated with the payroll record. It allows for financial reporting and analysis of payroll performance across different subsidiaries or corporate entities. Sourced from the Why it matters It supports cross-company benchmarking and financial allocation analysis. Where to get Table PA0001, field BUKRS. Examples US01DE011000 | |||
| Rework Count ReworkCount | Number of times a correction was performed. | ||
| Description This calculated metric counts the number of times the 'Data Correction Performed' activity appears in the case history. It is a direct measure of process inefficiency and supports the 'Manual Correction and Rework Rates' dashboard. High rework counts indicate persistent data quality issues or complex cases that fail first-pass validation. Why it matters It quantifies the effort lost to error correction and helps justify data quality initiatives. Where to get Calculated by counting 'Data Correction Performed' activities per CaseId. Examples 013 | |||
| SLA Processing Deadline SLAProcessingDeadline | The target timestamp for completing the payroll run. | ||
| Description This attribute represents the internal or external deadline for finalizing the payroll to ensuring timely payment. It is used to calculate the 'SLA Compliance Rate' KPI by comparing it against the actual 'Payment Executed' timestamp. While not always a standard field in SAP tables, it is often maintained in a custom control table or defined conceptually based on the payroll calendar (e.g., 2 days before Pay Date). For this data model, it is often derived from the Pay Date minus a set buffer. Why it matters It provides the benchmark for assessing timeliness and SLA adherence. Where to get Derived from Pay Date (T549S) minus configured processing days. Examples 2023-10-28T17:00:00Z2023-11-28T17:00:00Z | |||
| Tax Jurisdiction TaxJurisdiction | The tax region or authority applicable to the employee. | ||
| Description This attribute identifies the specific tax authority or region (e.g., State, Province, Canton) governing the payroll record. It is essential for the 'Audit Exception and Compliance Risk' dashboard to hotspot compliance issues geographically. In SAP US Payroll, this is the Why it matters It enables the segmentation of compliance risks and audit exceptions by regulatory region. Where to get Table PA0001 or PA0207/PA0208, field TXJCD. Examples CANYTXNRW | |||
Payroll Processing Activities
| Activity | Description | ||
|---|---|---|---|
| Bank Transfer File Generated | The creation of the Preliminary Data Medium Exchange (pre-DME) or final DME file. This creates the payment instructions for the bank. | ||
| Why it matters Tracks the Bank Transfer Automation Monitor. Failed file generations are critical process stops. Where to get Logs from the DME / Payment Medium Workbench (PMW) execution, often stored in TemSe or specific payment run tables (ReguH/ReguP). Capture Logged when payment run (F110/RPCIPE) creates output Event type explicit | |||
| Gross Pay Calculated | The successful execution of the gross payroll schema calculation. In standard processing, this occurs when the payroll driver writes to the PCL2 cluster. | ||
| Why it matters A major milestone indicating that time and rate data have been successfully combined. Delays here impact the Gross to Net Processing Efficiency. Where to get Cluster PCL2 (Payroll Results), specifically the directory table (RGDIR) timestamp for the 'For-Period'. Capture Logged when a new sequence number is written to the payroll cluster Event type explicit | |||
| Payment Executed | The finalization of the payment process, often confirmed by the bank or the completion of the F110 payment run. | ||
| Why it matters The primary end timestamp for SLA Compliance Rate. Determines if the employee was paid on time. Where to get Payment Run tables (REGUH) Date and Time of run, or inferred from the Value Date. Capture Logged when Payment Run status is set to Posted/Complete Event type explicit | |||
| Payroll Process Initialized | The creation of a payroll process instance within the Payroll Control Center (PCC). This marks the official start of the payroll cycle for a specific payroll area. | ||
| Why it matters Sets the baseline for the overall End to End Payroll Cycle Duration. It defines the scope of employees to be processed. Where to get Payroll Control Center tables (e.g., PYC_D_PY_PROC_INST), tracking the creation of a new process ID. Capture Logged when PCC Process Instance is created Event type explicit | |||
| Payroll Record Approved | The formal sign-off on the payroll results for an employee or pay group. This occurs in the PCC 'Monitoring' or 'Sign Off' step. | ||
| Why it matters Marks the end of the calculation/validation phase and release for payment. Critical for Specialist Throughput analysis. Where to get Payroll Control Center Step Instance logs (PYC_D_STEP_INST) for the Approval or Confirmation step. Capture Logged when PCC Approval Step status changes to COMPLETED Event type explicit | |||
| Payroll Simulation Executed | A test run of the payroll driver to identify errors without committing results to the database. This is a key step in the PCC validation phase. | ||
| Why it matters Essential for calculating the First-Pass Calculation Rate. Repeated simulations indicate data quality issues. Where to get Payroll Control Center Step Instance logs (PYC_D_STEP_INST) where the step type corresponds to Simulation. Capture Logged when PCC Simulation Step status changes to COMPLETED Event type explicit | |||
| Tax Filing Completed | The generation of tax reporter files (e.g., PU19 in US) or transfer to a third-party tax filing provider. | ||
| Why it matters Ensures regulatory compliance. Tracks the final compliance step in the sequence. Where to get Tax Reporter Log Manager or B2A (Business to Administration) Manager logs indicating successful file generation. Capture Logged when Tax Reporter run completes successfully Event type explicit | |||
| Time Sheet Approved | The formal approval of time data by a manager or administrator. This status change validates the data for transfer to the payroll engine. | ||
| Why it matters Calculates the Time Sheet Approval Lead Time KPI. Bottlenecks here indicate managerial delays or complex approval hierarchies. Where to get Employee Central Workflow Request tables (WfRequest), filtering for status COMPLETED or APPROVED. Capture Logged when workflow status changes to APPROVED Event type explicit | |||
| Time Sheet Submitted | The event where an employee or manager submits time data for the pay period. This is captured from the workflow request logs in the Employee Central module linked to ECP. | ||
| Why it matters Marks the start of the data accumulation phase. Delays here ripple downstream, causing compression of the payroll processing window. Where to get Employee Central Workflow Request tables (WfRequest), filtering for Time Sheet or Time Off categories. Capture Logged when workflow status changes to SUBMITTED Event type explicit | |||
| Audit Exception Flagged | The generation of a validation alert by the Payroll Control Center policy checks. These alerts identify data inconsistencies or compliance risks. | ||
| Why it matters Directly supports the Audit Exception Frequency and Compliance Risk dashboards. High volumes suggest upstream data quality problems. Where to get Payroll Control Center Alert tables (PYC_D_ALERT), linking specific error codes to the employee record. Capture Logged when a new entry is created in the PCC Alert table Event type explicit | |||
| Benefit Deductions Applied | The specific step within the calculation schema where benefits logic is processed. While part of the main run, isolating this helps pinpoint configuration errors. | ||
| Why it matters Supports Benefit and Tax Calculation Accuracy analysis. useful for debugging complex deduction logic discrepancies. Where to get Inferred from the existence of the V0 split in the payroll results or specific log entries if detailed logging is enabled (rare in production). Capture Coincides with Gross Pay Calculated but conceptually distinct for analysis Event type inferred | |||
| Data Correction Performed | Changes made to master data or time data in response to an audit exception. This represents rework required to clear a payroll alert. | ||
| Why it matters Tracks Manual Correction and Rework Rates. This is the primary activity contributing to process inefficiency. Where to get Inferred by joining PCC Alert timestamps with subsequent Audit Log changes (PCL4) for the same employee before the alert is closed. Capture Identify master data updates that occur while a PCC alert is active Event type inferred | |||
| Incentive Data Imported | The ingestion of non-standard pay data, such as bonuses or commissions, into the payroll system. Usually involves loading data into Infotypes 0015 or 2010. | ||
| Why it matters Late imports prevent accurate gross pay calculations. Analyzing this helps optimize the Incentive Data Integration Lead Time. Where to get Audit Log (PCL4 or equivalent) showing creation of records in Infotype 0015 (Additional Payments) or 2010 (Employee Remuneration Info). Capture Compare Infotype creation timestamps with import job logs Event type inferred | |||
| Pay Slip Published | The action of making the remuneration statement available to the employee via Self-Service (ESS). | ||
| Why it matters Measures Pay Slip Delivery SLA Performance. Delays here generate helpdesk tickets. Where to get Inferred from the 'Print Date' or availability date configuration in the Pay Slip mashup service logs. Capture Calculate based on Pay Date + System Configuration lag Event type inferred | |||
Extraction Guides
Steps
- Identify the target payroll area and period parameters for the extraction. You will be extracting data primarily from the Payroll Control Center (PCC) tables (PYC_*) and the payroll cluster directory (HRPY_RGDIR).
- Launch your SQL client or SAP HANA Studio connected to the SAP SuccessFactors Employee Central Payroll (ECP) backend schema.
- Execute the data extraction script provided in the Query section. This script aggregates data from master data tables, payroll results, and PCC audit logs.
- Map the 'Time Sheet Submitted' and 'Time Sheet Approved' activities. Since ECP often receives this data from Employee Central, use the creation and last modification timestamps in table PA2001 or the specialized time interface tables like PTREQ_HEADER if available.
- Extract 'Incentive Data Imported' by querying Infotypes 0015 (Additional Payments) and 2010 (Employee Remuneration Info) for records created within the target pay period.
- Retrieve PCC process steps from tables PYC_D_PYP (Process Instances) and PYC_D_BINST (Step Instances) to capture 'Payroll Process Initialized', 'Payroll Simulation Executed', 'Payroll Record Approved', and 'Pay Slip Published'.
- Query table PYC_D_ALERT to identify 'Audit Exception Flagged' events. These records link specific employees to validation errors found during the PCC check steps.
- Generate 'Data Correction Performed' events by joining the SAP Change Document Header table (CDHDR) with payroll-relevant Infotypes (e.g., 0008, 0015, 2001) during the active payroll window.
- Utilize table HRPY_RGDIR to pinpoint the exact moment of 'Gross Pay Calculated'. Create a derived event for 'Benefit Deductions Applied' utilizing the same timestamp, as these occur simultaneously during the schema run.
- Link finance data from tables REGUH (Settlement Data) and REGUT (DME Administration) to capture 'Bank Transfer File Generated' and 'Payment Executed'.
- Transform the 'PayrollRecord' column to strictly follow the format [EmployeeID]-[Period]-[Year] to ensure case ID uniqueness.
- Export the final dataset as a CSV file, ensuring headers match the attributes defined in the contract, and upload to ProcessMind.
Configuration
- Timeframe: Configure the extraction to cover a rolling window of the last 6 to 12 months. Payroll processes are cyclical, and this range captures sufficient variation in regular and off-cycle runs.
- Payroll Area (ABKRS): Filter by specific Payroll Areas (e.g., US Monthly, DE Weekly) to ensure the analysis compares similar process cycles.
- Language: Ensure descriptions for Activities and Process Steps are extracted in the primary system language (e.g., SPRAS = 'E').
- PCC Process IDs: Identify the specific Process Definition IDs (PYP_ID) used in your PCC configuration for 'Monitoring', 'Production', and 'Off-Cycle' to filter relevant steps.
- Currency: Normalize financial amounts (GrossPayAmount) to a single currency if extracting data for global payroll operations.
- Authorization: The database user requires read access to Human Resources (PA/PY) tables and specifically the Cluster Directory (HRPY_RGDIR) and PCC Tables (PYC_*).
a Sample Query config
/* Activity 1: Time Sheet Submitted */
SELECT
CONCAT(T.PERNR, CONCAT('-', T.PABRJ, T.PABRP)) AS PayrollRecord,
'Time Sheet Submitted' AS Activity,
T.BEGDA AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
T.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
T.PABRP AS PayPeriod,
CASE WHEN T.PABRP LIKE '9%' THEN 'Off-Cycle' ELSE 'Regular' END AS PayCycleFrequency,
0.00 AS GrossPayAmount,
T.UNAME AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM PA2001 AS T
LEFT JOIN PA0001 AS O ON T.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE T.AEDTM BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 2: Time Sheet Approved */
SELECT
CONCAT(T.PERNR, CONCAT('-', T.PABRJ, T.PABRP)) AS PayrollRecord,
'Time Sheet Approved' AS Activity,
T.AEDTM AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
T.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
T.PABRP AS PayPeriod,
CASE WHEN T.PABRP LIKE '9%' THEN 'Off-Cycle' ELSE 'Regular' END AS PayCycleFrequency,
0.00 AS GrossPayAmount,
T.UNAME AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'False' AS IsAutomated
FROM PA2001 AS T
LEFT JOIN PA0001 AS O ON T.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE T.AEDTM BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 3: Incentive Data Imported */
SELECT
CONCAT(I.PERNR, CONCAT('-', I.PABRJ, I.PABRP)) AS PayrollRecord,
'Incentive Data Imported' AS Activity,
I.AEDTM AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
I.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
I.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
I.BETRG AS GrossPayAmount,
I.UNAME AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM PA0015 AS I
LEFT JOIN PA0001 AS O ON I.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE I.AEDTM BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 4: Payroll Process Initialized */
SELECT
CONCAT('N/A', CONCAT('-', P.PABRJ, P.PABRP)) AS PayrollRecord,
'Payroll Process Initialized' AS Activity,
P.CREATED_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
'ALL' AS PayrollArea,
NULL AS EmployeeType,
P.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
P.CREATED_BY AS PayrollSpecialist,
NULL AS CostCenter,
'False' AS IsAutomated
FROM PYC_D_PYP AS P
WHERE P.CREATED_TS BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 5: Payroll Simulation Executed */
SELECT
CONCAT('N/A', CONCAT('-', S.PABRJ, S.PABRP)) AS PayrollRecord,
'Payroll Simulation Executed' AS Activity,
S.END_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
'ALL' AS PayrollArea,
NULL AS EmployeeType,
S.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
S.EXEC_USER AS PayrollSpecialist,
NULL AS CostCenter,
'True' AS IsAutomated
FROM PYC_D_BINST AS S
JOIN PYC_D_STEP AS D ON S.STEP_ID = D.ID
WHERE D.NAME LIKE '%Simulate%' AND S.END_TS BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 6: Audit Exception Flagged */
SELECT
CONCAT(A.RO_ID, CONCAT('-', P.PABRJ, P.PABRP)) AS PayrollRecord,
'Audit Exception Flagged' AS Activity,
A.CREATED_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
P.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
P.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
'SYSTEM' AS PayrollSpecialist,
NULL AS CostCenter,
'True' AS IsAutomated
FROM PYC_D_ALERT AS A
JOIN PYC_D_PYP AS P ON A.PYP_ID = P.ID
WHERE A.CREATED_TS BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 7: Data Correction Performed */
SELECT
CONCAT(C.OBJECTID, CONCAT('-', P.PABRJ, P.PABRP)) AS PayrollRecord,
'Data Correction Performed' AS Activity,
TO_TIMESTAMP(CONCAT(C.UDATE, C.UTIME)) AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
P.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
P.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
C.USERNAME AS PayrollSpecialist,
NULL AS CostCenter,
'False' AS IsAutomated
FROM CDHDR AS C
JOIN HRPY_RGDIR AS P ON C.OBJECTID = P.PERNR
WHERE C.TCODE IN ('PA30', 'PA40') AND C.UDATE BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 8: Gross Pay Calculated */
SELECT
CONCAT(R.PERNR, CONCAT('-', R.PABRJ, R.PABRP)) AS PayrollRecord,
'Gross Pay Calculated' AS Activity,
TO_TIMESTAMP(CONCAT(R.RUNDT, R.RUNTM)) AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
R.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
R.PABRP AS PayPeriod,
CASE WHEN R.PABRP LIKE '9%' THEN 'Off-Cycle' ELSE 'Regular' END AS PayCycleFrequency,
0.00 AS GrossPayAmount,
R.UNAME AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM HRPY_RGDIR AS R
LEFT JOIN PA0001 AS O ON R.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE R.RUNDT BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 9: Benefit Deductions Applied */
SELECT
CONCAT(R.PERNR, CONCAT('-', R.PABRJ, R.PABRP)) AS PayrollRecord,
'Benefit Deductions Applied' AS Activity,
ADD_SECONDS(TO_TIMESTAMP(CONCAT(R.RUNDT, R.RUNTM)), 1) AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
R.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
R.PABRP AS PayPeriod,
CASE WHEN R.PABRP LIKE '9%' THEN 'Off-Cycle' ELSE 'Regular' END AS PayCycleFrequency,
0.00 AS GrossPayAmount,
R.UNAME AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM HRPY_RGDIR AS R
LEFT JOIN PA0001 AS O ON R.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE R.RUNDT BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 10: Payroll Record Approved */
SELECT
CONCAT('N/A', CONCAT('-', S.PABRJ, S.PABRP)) AS PayrollRecord,
'Payroll Record Approved' AS Activity,
S.END_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
'ALL' AS PayrollArea,
NULL AS EmployeeType,
S.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
S.EXEC_USER AS PayrollSpecialist,
NULL AS CostCenter,
'False' AS IsAutomated
FROM PYC_D_BINST AS S
JOIN PYC_D_STEP AS D ON S.STEP_ID = D.ID
WHERE D.NAME LIKE '%Check%' AND S.STATUS = 'OK' AND S.END_TS BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 11: Bank Transfer File Generated */
SELECT
CONCAT(P.PERNR, CONCAT('-', P.PABRJ, P.PABRP)) AS PayrollRecord,
'Bank Transfer File Generated' AS Activity,
TO_TIMESTAMP(CONCAT(T.TSDAT, T.TSTIM)) AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
P.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
P.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
T.USRID AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM REGUT AS T
JOIN REGUH AS H ON T.LAUFD = H.LAUFD AND T.LAUFI = H.LAUFI
JOIN HRPY_RGDIR AS P ON H.PERNR = P.PERNR
LEFT JOIN PA0001 AS O ON P.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE T.TSDAT BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 12: Payment Executed */
SELECT
CONCAT(P.PERNR, CONCAT('-', P.PABRJ, P.PABRP)) AS PayrollRecord,
'Payment Executed' AS Activity,
TO_TIMESTAMP(CONCAT(H.LAUFD, '120000')) AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
P.ABKRS AS PayrollArea,
'Permanent' AS EmployeeType,
P.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
H.RBETR AS GrossPayAmount,
H.ZNME1 AS PayrollSpecialist,
O.KOSTL AS CostCenter,
'True' AS IsAutomated
FROM REGUH AS H
JOIN HRPY_RGDIR AS P ON H.PERNR = P.PERNR
LEFT JOIN PA0001 AS O ON P.PERNR = O.PERNR AND O.ENDDA = '99991231'
WHERE H.LAUFD BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 13: Pay Slip Published */
SELECT
CONCAT('N/A', CONCAT('-', S.PABRJ, S.PABRP)) AS PayrollRecord,
'Pay Slip Published' AS Activity,
S.END_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
'ALL' AS PayrollArea,
NULL AS EmployeeType,
S.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
S.EXEC_USER AS PayrollSpecialist,
NULL AS CostCenter,
'True' AS IsAutomated
FROM PYC_D_BINST AS S
JOIN PYC_D_STEP AS D ON S.STEP_ID = D.ID
WHERE D.NAME LIKE '%Remuneration%' AND S.END_TS BETWEEN '[START_DATE]' AND '[END_DATE]'
UNION ALL
/* Activity 14: Tax Filing Completed */
SELECT
CONCAT('N/A', CONCAT('-', S.PABRJ, S.PABRP)) AS PayrollRecord,
'Tax Filing Completed' AS Activity,
S.END_TS AS EventTimestamp,
'SAP_ECP' AS SourceSystem,
CURRENT_TIMESTAMP AS LastDataUpdate,
'ALL' AS PayrollArea,
NULL AS EmployeeType,
S.PABRP AS PayPeriod,
'Regular' AS PayCycleFrequency,
0.00 AS GrossPayAmount,
S.EXEC_USER AS PayrollSpecialist,
NULL AS CostCenter,
'True' AS IsAutomated
FROM PYC_D_BINST AS S
JOIN PYC_D_STEP AS D ON S.STEP_ID = D.ID
WHERE D.NAME LIKE '%Tax%' AND S.END_TS BETWEEN '[START_DATE]' AND '[END_DATE]' Steps
- Access ABAP Editor: Log in to your SAP SuccessFactors Employee Central Payroll (ECP) system via the SAP GUI. Navigate to transaction code SE38 (ABAP Editor).
- Create Program: Enter a name for the new program, such as
Z_PROCESSMINING_PAYROLL_EXT, and click Create. Select Executable program as the type and Save as a Local Object (Package $TMP) for testing purposes. - Implement Code: Copy the complete ABAP code provided in the Query section below and paste it into the editor, replacing any existing default code.
- Check and Activate: Click the Check button (Ctrl+F2) to validate the syntax. Once the status is error-free, click Activate (Ctrl+F3).
- Execute Extraction: Press Direct Processing (F8) to run the report.
- Configure Selection: In the selection screen, enter the
Payroll Area(e.g., US, 99), a validDate Range(e.g., the last 3 months), and optionally filter by specificPersonnel Numbers(PERNR) for testing. - Run Extraction: Execute the report. The system will process HRPY_RGDIR, CATSDB, PA0015, and REGUH tables to construct the event log.
- Review Output: The report utilizes
cl_demo_outputto display the results in a grid view directly on the screen for immediate validation. - Export Data: Right-click on the results grid, select Spreadsheet, and save the file as a CSV or Excel format.
- Format for ProcessMind: Open the exported file. Ensure the
EventTimestampcolumn is formatted asYYYY-MM-DD HH:MM:SS. Verify that thePayrollRecordcolumn uniquely identifies the case (usually PERNR-SEQNR). - Upload: Import the cleaned CSV file into ProcessMind, mapping columns to Case ID, Activity, Timestamp, and Attributes accordingly.
Configuration
- Date Range: It is recommended to extract data in 3 to 6-month chunks to avoid memory timeouts in the ABAP runtime environment.
- Payroll Area: This is a critical filter (Table T549A). Always extract one payroll area at a time (e.g., Monthly vs. Bi-Weekly) to ensure process consistency.
- Configuration Table: The script reads
HRPY_RGDIR(Payroll Directory) as the primary driver. Ensure your user hasS_TABU_DISauthorization for this table. - Time Data Source: The script assumes Time Sheet data resides in
CATSDB. If you use a third-party time clock that interfaces directly toIT2001orIT2010without CATS, the Time Sheet activities may return empty and require script adaptation. - Payment Data: The script links payroll runs to payment runs via
REGUH(Settlement Data). Ensure theF110payment run has been executed for the selected period to see payment events. - Performance: For high-volume systems (100k+ employees), replace the
SELECT *logic with a cursor-based fetch or run in background mode (F9).
a Sample Query abap
REPORT Z_PROCESSMINING_PAYROLL_EXT.
TABLES: pernr, hrpy_rgdir, catsdb, pa0015, reguh.
TYPES: BEGIN OF ty_event_log,
payroll_record TYPE string,
activity TYPE string,
event_timestamp TYPE string,
source_system TYPE string,
last_data_update TYPE string,
payroll_area TYPE abkrs,
employee_type TYPE persg,
pay_period TYPE pabrj,
pay_cycle_freq TYPE string,
gross_pay_amount TYPE string,
payroll_specialist TYPE usnam,
cost_center TYPE kostl,
is_automated TYPE string,
END OF ty_event_log.
DATA: gt_output TYPE TABLE OF ty_event_log,
gs_output TYPE ty_event_log,
gt_rgdir TYPE TABLE OF hrpy_rgdir,
gs_rgdir TYPE hrpy_rgdir,
gt_cats TYPE TABLE OF catsdb,
gs_cats TYPE catsdb,
gt_p0015 TYPE TABLE OF pa0015,
gs_p0015 TYPE pa0015,
gt_reguh TYPE TABLE OF reguh,
gs_reguh TYPE reguh,
gv_tstamp TYPE timestamp,
gv_date TYPE d,
gv_time TYPE t,
gv_pernr TYPE pernr_d.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_pernr FOR pernr-pernr,
s_date FOR sy-datum OBLIGATORY.
PARAMETERS: p_abkrs TYPE abkrs OBLIGATORY DEFAULT '99'.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
" 1. Fetch Payroll Directory (The Core Process Driver)
SELECT * FROM hrpy_rgdir INTO TABLE gt_rgdir
WHERE pernr IN s_pernr
AND fpper LIKE '%'
AND cdate IN s_date.
IF gt_rgdir IS INITIAL.
WRITE: / 'No payroll results found for selection.'.
EXIT.
ENDIF.
SORT gt_rgdir BY pernr seqnr.
" Loop through Payroll Directory to build events
LOOP AT gt_rgdir INTO gs_rgdir.
CLEAR gs_output.
CONCATENATE gs_rgdir-pernr '-' gs_rgdir-seqnr INTO gs_output-payroll_record.
gs_output-source_system = 'SAP_ECP'.
gs_output-last_data_update = sy-datum.
gs_output-payroll_area = p_abkrs.
gs_output-pay_period = gs_rgdir-fpper.
gs_output-payroll_specialist = gs_rgdir-uname.
" --- Activity: Payroll Process Initialized ---
" Derived from the run date start
gs_output-activity = 'Payroll Process Initialized'.
CONCATENATE gs_rgdir-cdate gs_rgdir-ctime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Payroll Simulation Executed ---
IF gs_rgdir-srtza = 'S'. " S = Simulation
gs_output-activity = 'Payroll Simulation Executed'.
CONCATENATE gs_rgdir-cdate gs_rgdir-ctime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
ENDIF.
" --- Activity: Audit Exception Flagged ---
IF gs_rgdir-void IS NOT INITIAL. " Void indicator means rejected/exception
gs_output-activity = 'Audit Exception Flagged'.
CONCATENATE gs_rgdir-cdate gs_rgdir-ctime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Data Correction Performed ---
" Inferred: If voided, a correction usually follows immediately
gs_output-activity = 'Data Correction Performed'.
" Add 1 hour to simulate reaction time
DATA: lv_corr_time TYPE t.
lv_corr_time = gs_rgdir-ctime + 3600.
CONCATENATE gs_rgdir-cdate lv_corr_time INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'FALSE'.
APPEND gs_output TO gt_output.
ENDIF.
" --- Activity: Gross Pay Calculated ---
IF gs_rgdir-srtza = 'A'. " A = Actual Result
gs_output-activity = 'Gross Pay Calculated'.
CONCATENATE gs_rgdir-cdate gs_rgdir-ctime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-gross_pay_amount = '1000.00'. " Placeholder: Cluster read required for actual amount
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Benefit Deductions Applied ---
" Logically occurs immediately after gross calc
gs_output-activity = 'Benefit Deductions Applied'.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Payroll Record Approved ---
" Inferred from successful write of 'A' record
gs_output-activity = 'Payroll Record Approved'.
DATA: lv_appr_time TYPE t.
lv_appr_time = gs_rgdir-ctime + 60. " +1 minute
CONCATENATE gs_rgdir-cdate lv_appr_time INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'FALSE'.
APPEND gs_output TO gt_output.
" --- Activity: Pay Slip Published ---
" Available via ESS usually next day
gs_output-activity = 'Pay Slip Published'.
DATA: lv_slip_date TYPE d.
lv_slip_date = gs_rgdir-cdate + 1.
CONCATENATE lv_slip_date '080000' INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Tax Filing Completed ---
" End of period logic
gs_output-activity = 'Tax Filing Completed'.
DATA: lv_tax_date TYPE d.
lv_tax_date = gs_rgdir-paydt.
CONCATENATE lv_tax_date '235959' INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
ENDIF.
ENDLOOP.
" 2. Fetch Time Sheet Data (CATSDB)
" Linking to Payroll Record loosely via Period/Date
SELECT * FROM catsdb INTO TABLE gt_cats
WHERE pernr IN s_pernr
AND workdate IN s_date.
LOOP AT gt_cats INTO gs_cats.
CLEAR gs_output.
CONCATENATE gs_cats-pernr '-00000' INTO gs_output-payroll_record. " Generic mapping
gs_output-payroll_area = p_abkrs.
gs_output-source_system = 'SAP_ECP'.
" --- Activity: Time Sheet Submitted ---
IF gs_cats-status = '20' OR gs_cats-status = '30'.
gs_output-activity = 'Time Sheet Submitted'.
CONCATENATE gs_cats-laudate gs_cats-lautime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'FALSE'.
APPEND gs_output TO gt_output.
ENDIF.
" --- Activity: Time Sheet Approved ---
IF gs_cats-status = '30'. " 30 = Approved
gs_output-activity = 'Time Sheet Approved'.
CONCATENATE gs_cats-apdat gs_cats-aptime INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'FALSE'.
APPEND gs_output TO gt_output.
ENDIF.
ENDLOOP.
" 3. Fetch Incentive Data (Infotype 0015)
SELECT * FROM pa0015 INTO TABLE gt_p0015
WHERE pernr IN s_pernr
AND begda IN s_date.
LOOP AT gt_p0015 INTO gs_p0015.
CLEAR gs_output.
CONCATENATE gs_p0015-pernr '-00000' INTO gs_output-payroll_record.
gs_output-source_system = 'SAP_ECP'.
gs_output-payroll_area = p_abkrs.
" --- Activity: Incentive Data Imported ---
gs_output-activity = 'Incentive Data Imported'.
CONCATENATE gs_p0015-aedtm '120000' INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'FALSE'.
APPEND gs_output TO gt_output.
ENDLOOP.
" 4. Fetch Payment Data (REGUH)
SELECT * FROM reguh INTO TABLE gt_reguh
WHERE zaldt IN s_date.
LOOP AT gt_reguh INTO gs_reguh.
" Filter for our PERNRs roughly (REGUH does not always have PERNR directly indexable easily in all views)
" For simulation, we map broadly or require join logic. Here assuming simple extraction.
CLEAR gs_output.
CONCATENATE gs_reguh-pernr '-99999' INTO gs_output-payroll_record.
gs_output-source_system = 'SAP_ECP'.
gs_output-payroll_area = p_abkrs.
" --- Activity: Bank Transfer File Generated ---
gs_output-activity = 'Bank Transfer File Generated'.
CONCATENATE gs_reguh-laufd gs_reguh-cpzut INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
" --- Activity: Payment Executed ---
gs_output-activity = 'Payment Executed'.
CONCATENATE gs_reguh-zaldt '100000' INTO gs_output-event_timestamp SEPARATED BY space.
gs_output-is_automated = 'TRUE'.
APPEND gs_output TO gt_output.
ENDLOOP.
" Output Display
cl_demo_output=>display( gt_output ).