SAP Knowledge Base Article - Public

3737291 - Mismatch in Unit Price Field in KSEF XML File from eDocument Cockpit App in S/4HANA Public Cloud

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

  1. Open the eDocument Cockpit app.
  2. Select an affected sales eDocument.
  3. Open the generated XML and review element P_9A (unit price) and the total invoice value.
  4. Compare the unit price and total price in the PDF;
  5. 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:

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

Refer to Configuring Condition Types (CONDITION_TYPE)

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

Product

SAP S/4HANA Cloud Public Edition all versions