Symptom
Wrong Unit Price in XML file from eDocument Cockpit app.
Environment
- SAP S/4HANA Cloud Public Edition
- Document and Reporting Compliance Poland
Reproducing the Issue
- Open the eDocument Cockpit app.
- Select an affected sales eDocument.
- Open the generated XML and review element P_9A (unit price) and the total invoice value.
- Compare the unit price and total price in the PDF;
- observe that when pricing is maintained per 10/100/1000 units but the invoice quantity is 1, the XML unit price appears higher.
Cause
The value for P_9A is derived from the last active, non-statistical pricing condition (KOMV-KBETR) based on the configured condition type mapping. The system does not consider the pricing unit (KPEIN) during this process, which is standard behavior.
This behavior is aligned with KSeF requirements, as the XML schema does not provide fields for pricing unit or price quantity. Therefore, the system expects the unit price to be maintained per single unit. When pricing is maintained per 10/100/1000 units, the value appears higher in the XML since it is taken directly from KBETR.
Resolution
To ensure correct values in the XML, it is recommended to maintain pricing master data such that:
- The unit of measure matches the invoice unit (e.g., PC), and
- The pricing unit is maintained as 1,
- Prices are maintained in the billing currency
SAP Help Configuring Condition Types (CONDITION_TYPE)
Alternatively, if maintaining pricing per single unit is not feasible from a business perspective, you may implement BAdI EDOC_ADAPTOR (method SET_OUTPUT_DATA) to adjust the unit price (e.g., normalize KBETR using KPEIN) before populating the XML. Please note that this would be a custom enhancement and not part of standard SAP behavior.
See Also
Keywords
KSeF, Poland, P_9A, unit price, KBETR, KPEIN, pricing unit, eDocument, XML, Document and Reporting Compliance, e-invoice, sales invoice, EDOC_ADAPTOR, SET_OUTPUT_DATA, condition type mapping , KBA , CA-GTF-CSC-EDO-PL , Document Compliance Poland , Problem
SAP Knowledge Base Article - Public