Your Purchase to Pay - Invoice Processing Data Template

SAP S/4HANA
Your Purchase to Pay - Invoice Processing Data Template

Your Purchase to Pay - Invoice Processing Data Template

This data template is designed to guide you through setting up your Purchase to Pay - Invoice Processing analysis. It outlines the essential data attributes to collect, key activities to track, and provides valuable extraction guidance. Utilize this template to ensure a smooth and effective data preparation process for your process mining initiatives.
  • Recommended attributes to collect
  • Key activities to track
  • Extraction guidance for SAP S/4HANA
New to event logs? Learn how to create a process mining event log.

Purchase to Pay - Invoice Processing Attributes

These are the recommended data fields to include in your event log for comprehensive purchase to pay - invoice processing analysis.
3 Required 8 Recommended 11 Optional
Name Description
Invoice Number
InvoiceNumber
The unique identifier for the vendor invoice document, serving as the primary case identifier for the process.
Description

The Invoice Number is the unique identifier assigned to each vendor invoice within SAP S/4HANA. It links all related activities, such as creation, parking, approval, and payment, into a single, cohesive process instance.

In process mining, this attribute is fundamental for tracking the end-to-end journey of each invoice. It allows for the reconstruction of the entire process flow, from receipt to final payment, enabling analysis of cycle times, bottlenecks, and process variations at the individual invoice level.

Why it matters

It is the essential key to connect all related events, allowing for a complete trace of an invoice's lifecycle through the system.

Where to get

This is the Accounting Document Number, found in table BKPF, field BELNR.

Examples
190000000119000000451900000132
Activity Name
ActivityName
The name of the business activity or event that occurred at a specific point in time for an invoice.
Description

The Activity Name describes a specific step or status change within the invoice processing lifecycle. Examples include 'Invoice Document Created', 'Invoice Sent For Approval', 'Payment Block Set', and 'Payment Executed'.

This attribute is crucial for constructing the process map, which visually represents the flow of activities. Analyzing the sequence, frequency, and duration between these activities helps identify bottlenecks, rework loops, and non-compliant process variations. It forms the backbone of any process mining analysis.

Why it matters

It defines the steps in the process, enabling the visualization of process maps and the analysis of process flows and variations.

Where to get

Derived from a combination of SAP transaction codes (SY-TCODE), change document object statuses (CDHDR/CDPOS), and specific field values indicating status changes.

Examples
Invoice ParkedInvoice ApprovedPayment Executed
Event Time
EventTime
The precise date and time when the activity occurred.
Description

Event Time is the timestamp that records exactly when a specific activity happened. This data is essential for calculating durations, cycle times, and waiting times between different steps in the process.

In process mining analysis, accurate timestamps are used to measure performance KPIs like 'Average Invoice Cycle Time' and 'Invoice Approval Cycle Time'. By analyzing the time elapsed between activities, organizations can pinpoint bottlenecks where invoices are delayed and identify opportunities for process acceleration.

Why it matters

This timestamp is the foundation for all time-based analysis, including performance monitoring, bottleneck identification, and SLA tracking.

Where to get

Typically sourced from change document tables CDHDR (Header) and CDPOS (Item), using fields UDATE and UTIME. For some events, it may come from creation or entry dates in tables like BKPF (CPUDT, CPUTM).

Examples
2023-04-15T10:30:00Z2023-04-18T14:05:21Z2023-05-02T09:00:00Z
Company Code
CompanyCode
The organizational unit representing a legally independent company for which financial statements are created.
Description

The Company Code is a fundamental organizational unit in SAP Finance. Each invoice is assigned to a specific company code, which determines the legal entity responsible for the transaction.

In process mining, filtering or comparing by Company Code is essential for analyzing process performance across different business units, legal entities, or countries. It helps identify regional differences in efficiency, compliance, and automation levels, supporting targeted improvement initiatives.

Why it matters

It allows for segmenting and comparing invoice processing performance across different legal entities or geographical locations within the organization.

Where to get

This is a standard field in the document header table BKPF, field BUKRS.

Examples
1000US01DE01
Document Type
DocumentType
A code that classifies different types of accounting documents, such as vendor invoices or credit memos.
Description

The Document Type is used in SAP to distinguish between different business transactions. For instance, 'KR' typically represents a standard vendor invoice, while 'KG' might be a vendor credit memo.

Analyzing by document type allows for segmenting the process to understand how different types of transactions are handled. For example, the process for a credit memo may be significantly different from that of a standard invoice. This segmentation provides more accurate and relevant process insights.

Why it matters

It helps differentiate between various kinds of financial transactions, such as standard invoices and credit memos, which often follow different process paths.

Where to get

Found in the document header table BKPF, field BLART.

Examples
KRREKG
Invoice Amount
AmountInCompanyCodeCurrency
The total gross amount of the invoice in the company code's local currency.
Description

This attribute represents the total value of the invoice. It is a key metric for understanding the financial impact and scale of the invoice processing operation.

Analyzing invoice amounts helps to prioritize high-value invoices for faster processing, identify trends in spending, and correlate process issues with financial value. For example, it can be used to investigate if high-value invoices are more likely to be blocked or have longer approval times.

Why it matters

Provides financial context to the process, allowing for analysis based on monetary value, such as identifying if high-value invoices are processed differently.

Where to get

This value is typically derived from the sum of relevant line items in table BSEG, field WRBTR (Amount in local currency).

Examples
1500.75125000.00850.20
Payment Block Reason
PaymentBlockReason
A code indicating why an invoice is blocked from being paid.
Description

When an invoice is blocked for payment, this attribute provides the specific reason for the block, such as 'Quantity Discrepancy' or 'Price Mismatch'. These reasons are configured in SAP to standardize exception handling.

This attribute is crucial for the 'Payment Block Occurrence & Duration' dashboard. Analyzing the frequency of different block reasons helps identify the root causes of payment delays, such as issues with specific vendors, materials, or internal processes, allowing for targeted corrective actions.

Why it matters

Provides the specific root cause for payment blocks, enabling targeted analysis to reduce delays and improve first-time-right processing.

Where to get

Located in the vendor line item of table BSEG, field ZLSPR (Payment Block Key).

Examples
RIA
Payment Due Date
PaymentDueDate
The date by which the invoice must be paid to avoid being overdue.
Description

The Payment Due Date is the calculated date on which payment to the vendor is due, based on the invoice date and the agreed payment terms. It serves as a critical deadline in the process.

This attribute is essential for the 'On-Time Payment Rate' KPI and the 'Vendor Payment Performance' dashboard. By comparing the actual payment date with the due date, a company can measure its ability to meet payment obligations, which affects vendor relationships and financial reputation.

Why it matters

It is the primary benchmark for measuring on-time payment performance, which is crucial for maintaining good vendor relationships and avoiding late fees.

Where to get

This date is often directly available in the vendor line item in table BSEG, field ZFBDT (Baseline date for due date calculation). The net due date is calculated from this baseline date and payment terms.

Examples
2023-05-302023-06-152023-07-01
Purchase Order
PurchasingDocument
The purchase order number to which the invoice is related.
Description

The Purchasing Document number links the vendor invoice to the original purchase order (PO). This link is fundamental for the three-way match process, which verifies the invoice against the PO and goods receipt.

Analyzing by this attribute helps understand issues related to PO-backed vs. non-PO invoices. It is key to investigating matching discrepancies and understanding the efficiency of the procurement part of the process.

Why it matters

Links the invoice to the procurement process, which is essential for analyzing matching discrepancies and PO compliance.

Where to get

This information is typically found in the document segment table BSEG, field EBELN (Purchase Document Number).

Examples
450000123445000056784500009012
User Name
UserName
The SAP user ID of the person or system that performed the activity.
Description

This attribute identifies the user who executed a specific transaction or created a document. It can be an individual's user ID or a system ID for automated batch jobs.

Analyzing by user helps in understanding workload distribution, identifying training needs, and spotting unusual user behavior. For instance, it can highlight which users frequently handle exceptions or which invoices are processed automatically (e.g., user 'BATCHUSER'), which is key for calculating the 'Invoice Automation Rate' KPI.

Why it matters

It attributes process activities to specific users or system accounts, enabling workload analysis, performance comparison, and automation detection.

Where to get

Sourced from fields like BKPF-USNAM (Entered by) or CDHDR-USERNAME (Changed by).

Examples
SMITHJMUELLERTWF-BATCH
Vendor Number
VendorNumber
The unique identifier for the vendor who submitted the invoice.
Description

The Vendor Number identifies the supplier or creditor associated with the invoice. It links the invoice transaction to the vendor master data.

This attribute is critical for vendor-centric analysis, such as evaluating 'Vendor Payment Performance' or identifying vendors who frequently submit problematic invoices that lead to exceptions or payment blocks. It helps in managing vendor relationships and assessing supplier reliability.

Why it matters

Enables analysis of process performance by vendor, helping to identify patterns, manage relationships, and assess supplier-related issues.

Where to get

Typically found in the accounting document segment table BSEG, field LIFNR.

Examples
100345700012V9832
Approval Cycle Count
ApprovalCycleCount
A count of how many times an invoice was sent for approval.
Description

This metric counts the number of times the 'Invoice Sent For Approval' activity occurs for a single invoice. A count greater than one indicates that the invoice was rejected or sent back at least once, requiring a new approval cycle.

This attribute directly supports the 'First-Pass Approval Rate' KPI. By analyzing invoices with high approval cycle counts, organizations can identify the reasons for failed approvals, such as insufficient information or incorrect coding, and take steps to improve the process.

Why it matters

Quantifies rework within the approval sub-process, helping to measure the first-time-right rate and identify reasons for approval rejections.

Where to get

Calculated by counting the occurrences of the 'Invoice Sent For Approval' activity for each unique InvoiceNumber.

Examples
123
Clearing Document No.
ClearingDocumentNumber
The document number that clears the invoice, typically representing the payment document.
Description

The Clearing Document Number links an open invoice item to the transaction that clears it, which is almost always the payment document. This confirms that the invoice has been paid.

This attribute is the definitive link between an invoice and its payment. It is used to identify the 'Payment Executed' activity and its corresponding timestamp, which is essential for calculating the end-to-end cycle time and on-time payment rate.

Why it matters

Confirms that an invoice has been paid and links it to the specific payment transaction, which is critical for cycle time and payment performance analysis.

Where to get

Found in the document segment table BSEG, field AUGBL (Clearing Document Number).

Examples
150000000115000000231500000088
Extraction Timestamp
ExtractionTimestamp
The date and time when the data was extracted from the source system.
Description

This attribute records the timestamp of the data extraction event. It reflects the freshness of the data being analyzed in the process mining tool.

In analysis, this is used to understand the recency of the insights generated. It is critical for operational monitoring dashboards to ensure that decisions are based on up-to-date information and to manage data refresh cycles effectively.

Why it matters

Indicates the freshness of the data, ensuring that analysis and reporting are based on the most current information available.

Where to get

This is not an SAP field. It is generated and added by the data extraction tool or ETL process at the time of data pull.

Examples
2023-10-27T02:00:00Z2023-10-28T02:00:00Z2023-10-29T02:00:00Z
Invoice Date
InvoiceDate
The date on which the vendor issued the invoice document.
Description

The Invoice Date, also known as the document date, is the date provided by the vendor on the invoice. It is used as the starting point for calculating the payment due date based on the agreed payment terms.

In analysis, this date is fundamental for financial calculations, such as determining invoice aging and eligibility for early payment discounts. It is a key input for the 'Early Payment Discount Capture Rate' KPI.

Why it matters

Serves as the baseline for calculating payment terms and due dates, which is essential for managing working capital and capturing discounts.

Where to get

Found in the document header table BKPF, field BLDAT (Document Date).

Examples
2023-04-122023-05-152023-06-20
Invoice Processing Time
InvoiceProcessingTime
The total time elapsed from the first activity to the last activity for an invoice.
Description

This metric calculates the total duration for processing a single invoice, typically from invoice creation or receipt to final payment. It provides a case-level summary of the end-to-end cycle time.

This calculated attribute is the basis for the 'Average Invoice Cycle Time' KPI and the 'End-to-End Invoice Cycle Time' dashboard. It allows for quick identification of the longest-running cases and analysis of factors that contribute to extended processing times.

Why it matters

Measures the end-to-end efficiency of the process for each invoice, highlighting cases with exceptionally long durations that require investigation.

Where to get

Calculated by taking the difference between the timestamp of the last event and the first event for each unique InvoiceNumber.

Examples
10 days 4 hours25 days 1 hour5 days 8 hours
Is Automated
IsAutomated
A flag indicating whether an activity was performed by an automated system user.
Description

This boolean attribute is true if the user associated with an activity is a known system or batch account, such as 'WF-BATCH' or 'SAP_SYSTEM'. It helps distinguish between manual and automated process steps.

This attribute is essential for calculating the 'Invoice Automation Rate' KPI. By analyzing which parts of the process are automated, organizations can measure the success of their automation initiatives and identify further opportunities to reduce manual effort and improve efficiency.

Why it matters

Distinguishes between manual and system-driven activities, which is fundamental for measuring automation rates and identifying opportunities for further automation.

Where to get

Derived from the UserName attribute. A mapping or rule is created to classify specific user IDs as 'automated'.

Examples
truefalse
Is Paid On Time
IsPaidOnTime
A flag that is true if the invoice was paid on or before its payment due date.
Description

This boolean attribute is the result of comparing the actual payment date (the timestamp of the 'Payment Executed' activity) with the 'Payment Due Date'. It provides a clear, binary outcome for each invoice's payment status.

This is the core calculation for the 'On-Time Payment Rate' KPI. It allows for easy filtering and analysis to understand the characteristics of late payments, such as common vendors, company codes, or invoice amounts associated with delays.

Why it matters

Directly measures adherence to payment terms, which is a critical KPI for vendor relationship management and financial operations.

Where to get

Calculated by comparing the EventTime of the 'Payment Executed' activity against the PaymentDueDate attribute. (Payment Date <= PaymentDueDate).

Examples
truefalse
Is Rework
IsRework
A flag indicating if an invoice has undergone rework activities, such as a rejected approval or a removed payment block.
Description

This attribute flags invoices that have experienced one or more rework loops. Rework is identified by specific sequences of activities, for example, 'Invoice Approved' following 'Invoice Rejected', or 'Payment Block Removed' after 'Payment Block Set'.

This attribute simplifies the calculation of the 'Invoice Rework Rate' KPI. It allows analysts to easily isolate and investigate cases with rework to understand the root causes of inefficiency and repeated manual effort.

Why it matters

Identifies inefficient process flows where work has to be repeated, helping to quantify waste and pinpoint the root causes of process exceptions.

Where to get

Calculated based on the sequence of activities in the event log. For example, if 'Invoice Rejected' occurs in the trace for an invoice, this flag would be set to true.

Examples
truefalse
Payment Terms
PaymentTerms
The code defining the payment conditions agreed upon with the vendor, such as due dates and discount periods.
Description

Payment Terms define the rules for paying an invoice, including any available discounts for early payment. For example, 'Z030' might mean 'Payable within 30 days net'.

This attribute is essential for financial planning and working capital optimization. In process mining, it is used to calculate the 'Payment Due Date' and to determine eligibility for early payment discounts, directly supporting the 'Early Payment Discount Capture Rate' KPI.

Why it matters

Defines the rules for payment due dates and discounts, directly impacting on-time payment KPIs and working capital management.

Where to get

Found in the vendor line item in table BSEG, field ZTERM (Terms of Payment Key).

Examples
0001Z030NT60
Reversal Reason
ReversalReason
A code indicating the reason why an invoice document was reversed.
Description

If an invoice is posted incorrectly, it is often reversed. The Reversal Reason code explains why this action was taken, for example, 'Incorrect posting date' or 'Data entry error'.

Analyzing reversal reasons helps identify patterns of errors in the invoice posting process. This insight can be used to improve training, enhance system controls, or address recurring issues that lead to financial rework and administrative overhead.

Why it matters

Explains why invoices were cancelled, providing direct insight into sources of error and rework in the posting process.

Where to get

Found in the header of the original document in table BKPF, field STGRD (Reversal reason).

Examples
010205
Source System ID
SourceSystemId
The identifier of the source SAP S/4HANA system from which the data was extracted.
Description

This attribute specifies the originating system, for example, 'S4H_PROD' or 'ERP_EU'. It is particularly important in environments with multiple ERP instances or a mix of legacy and modern systems.

For analysis, it allows for comparing process performance across different systems or regions. It ensures data provenance and is crucial for data governance and troubleshooting when data from multiple sources is combined in a central process mining platform.

Why it matters

It provides context about the data's origin, which is essential for data governance and for comparing processes across different systems or company locations.

Where to get

This value is typically derived from the SAP system ID (sy-sysid) during data extraction or configured as a static value in the ETL pipeline.

Examples
S4PS4H_PROD_100ECC_EU
Required Recommended Optional

Purchase to Pay - Invoice Processing Activities

These are the key process steps and milestones to capture in your event log for accurate process discovery.
5 Recommended 8 Optional
Activity Description
Invoice Approved
This activity signifies that the invoice has been approved by the designated authority. This is captured when the approval workflow concludes successfully or a release indicator is set.
Why it matters

This is a critical milestone that unblocks the invoice for payment. Delays in approvals are a common bottleneck, and tracking this activity helps pinpoint slow approvers or process steps.

Where to get

This can be inferred from the final release step in an SAP workflow or by tracking changes to release status fields in tables associated with the invoice or its purchasing document.

Capture

Infer from workflow completion events or changes in a document's release status field.

Event type inferred
Invoice Document Created
This is the first event, marking the creation of an invoice document in SAP. It can be captured when a user saves a new invoice document, which could be in a parked or pre-posted state.
Why it matters

This activity marks the start of the invoice processing lifecycle. Analyzing the time from this event to others is crucial for measuring overall processing lead time.

Where to get

This event is captured from the creation date and time (CPUDT, CPUTM) in the document header table, typically BKPF or RBKP for logistics invoices. The transaction code (BKPF-TCODE) like FB60, MIRO, or MIR7 indicates the creation method.

Capture

Use creation timestamp from BKPF-CPUDT and BKPF-CPUTM for the invoice document.

Event type explicit
Invoice Posted
This is a key financial event where the parked or approved invoice is formally posted to the General Ledger. This action recognizes the liability to the vendor.
Why it matters

Posting is a major milestone that separates data entry and approval from the financial settlement phase. The time from invoice creation to posting is a key measure of internal processing efficiency.

Where to get

This event is identified by the Posting Date (BKPF-BUDAT) on the document header. For documents that are parked first, the transition to a posted status provides the event timestamp.

Capture

Use the posting date (BKPF-BUDAT) as the event timestamp.

Event type explicit
Invoice Reversed
An activity representing the reversal of a previously posted invoice document. This is a terminal event for an incorrect invoice, which is then often re-entered correctly.
Why it matters

Reversals indicate critical errors that were not caught earlier in the process. Tracking their frequency and root causes is essential for process improvement and reducing financial inaccuracies.

Where to get

A reversal is identified when a reversing document is created. The original document header (BKPF) will contain the reversing document number (BKPF-STBLG) and vice versa. The posting date of the reversal document is the event time.

Capture

Identify documents that have a value in the BKPF-STBLG field and use the reversal document's posting date.

Event type explicit
Payment Executed
This is the final activity in the standard process, where the payment is made and the invoice is cleared. This signifies that the funds have been disbursed to the vendor.
Why it matters

This marks the end of the P2P invoice lifecycle. It is essential for calculating the total end-to-end cycle time and for measuring on-time payment performance against the due date.

Where to get

This event is captured from the clearing document information on the vendor line item. The Clearing Date (BSEG-AUGDT) and Clearing Document (BSEG-AUGBL) indicate that payment has been made.

Capture

Use the clearing date (BSEG-AUGDT) from the cleared vendor line item.

Event type explicit
Invoice Data Updated
This activity reflects a change made to the invoice document after its initial creation. This is common during rework cycles following a rejection or to correct errors.
Why it matters

Frequent updates signal rework and potential data quality issues at the point of entry. Tracking these changes helps quantify the effort spent on corrections and identify common errors.

Where to get

Changes to key fields are logged in SAP's change document tables, CDHDR (header) and CDPOS (item). Events can be generated by filtering for changes to the relevant invoice object.

Capture

Extract change events from tables CDHDR and CDPOS for the invoice object.

Event type explicit
Invoice Parked
Represents an invoice that has been entered into the system but is not yet posted to the general ledger. Parking is used to save incomplete invoices or for later review before posting.
Why it matters

Parking indicates a deliberate pause in the process. Tracking the duration and frequency of parked invoices helps identify reasons for delays before the formal posting and approval cycle begins.

Where to get

This can be identified by documents created via parking transactions (e.g., MIR7, FV60) or by checking specific status fields in the BKPF table or dedicated parked document tables like VBKPF.

Capture

Identify documents created via parking transactions or check for a parked document status.

Event type explicit
Invoice Rejected
Represents the rejection of an invoice during the approval process. This event triggers rework, requiring correction and resubmission.
Why it matters

Invoice rejections are a key indicator of process inefficiency and data quality issues. Analyzing rejection frequency and reasons helps identify opportunities for improvement and training.

Where to get

This is inferred from specific status updates in an SAP workflow, such as a 'rejected' status, or from events that cancel the current approval workflow, sending it back to the processor.

Capture

Infer from workflow status changes indicating rejection.

Event type inferred
Invoice Sent For Approval
This activity marks the initiation of a formal approval workflow for the invoice. This is often inferred when the invoice's status changes to 'pending approval' or a workflow item is generated.
Why it matters

This is the starting point for measuring the approval cycle time. Understanding when approvals start is essential for identifying bottlenecks in the approval workflow itself.

Where to get

This is typically inferred from the start of an SAP Business Workflow (SWW_WI2OBJ table) linked to the invoice object (e.g., BUS2081) or a change in a custom status field on the document header.

Capture

Infer from the creation of a workflow item related to the invoice document.

Event type inferred
Late Payment Executed
This is a calculated event that occurs when an invoice's payment is executed after its calculated due date. It is derived by comparing two date fields.
Why it matters

This activity directly supports on-time payment KPIs and helps identify vendors or business units with frequent late payments, which can harm vendor relationships and lead to penalties.

Where to get

This is calculated by comparing the Clearing Date (BSEG-AUGDT) with the Net Due Date. The due date is itself calculated from the Baseline Date (BSEG-ZFBDT) and payment terms (BSEG-ZTERM).

Capture

Derive by comparing BSEG-AUGDT > (BSEG-ZFBDT + payment term days).

Event type calculated
Payment Block Removed
Represents the resolution of an issue, where a previously set payment block is removed. This makes the invoice eligible for payment again.
Why it matters

The time between a block being set and removed represents the resolution time for a process exception. Shortening this duration is key to improving efficiency and vendor relations.

Where to get

This event is captured when the Payment Block Key field (BSEG-ZLSPR) is cleared. This change is logged in the CDHDR and CDPOS tables, providing a timestamp for the removal.

Capture

Identify when the BSEG-ZLSPR field is cleared via change documents (CDHDR/CDPOS).

Event type explicit
Payment Block Set
An activity where a block is intentionally placed on an invoice to prevent it from being paid. This is often due to discrepancies in price or quantity, or a pending credit memo.
Why it matters

Payment blocks are a primary cause of late payments and vendor disputes. Analyzing the frequency, duration, and reasons for blocks is critical for improving on-time payment rates.

Where to get

This event is captured by tracking changes to the Payment Block Key field (BSEG-ZLSPR) in the invoice line item. The change logs in CDHDR and CDPOS provide the timestamp and user for when the block was set.

Capture

Identify when the BSEG-ZLSPR field is populated via change documents (CDHDR/CDPOS).

Event type explicit
Payment Proposal Created
The invoice is selected and included in a payment proposal as part of a payment run. This is the first step in the automated payment process.
Why it matters

This activity indicates the intent to pay. Delays between this step and final payment execution can reveal issues with the payment run process, approvals, or bank communication.

Where to get

This can be found in the payment run tables, specifically REGUP, which contains the items included in a payment proposal. The run date in the corresponding REGUH table provides the timestamp.

Capture

Identify when an invoice appears in the REGUP table from a payment proposal run.

Event type explicit
Recommended Optional

Extraction Guides

How to get your data from SAP S/4HANA