Software guides · SAP · XRechnung
XRechnung in SAP
SAP S/4HANA generates XRechnung via Document Compliance (transaction /DOCCP/*). This guide covers the exact SPRO configuration paths, customer master setup with SAP Note 2904195, and billing output determination—with specific attention to the quirks that cause 80% of rejection errors.
- SAP S/4HANA 1909+ with Document Compliance (DOCCP) license activated
- SAP Note 2904195 applied (adds standard Leitweg-ID field to BP)
- SAP Note 3089413 for latest XRechnung 3.0 schema support
- Company code configured with German tax procedure (TAXD)
- ADS (Adobe Document Services) running for PDF fallback output
- 01
Activate Document Compliance for Germany via SPRO
Transaction SPRO → SAP Reference IMG → Financial Accounting → Accounts Receivable and Accounts Payable → Electronic Invoicing → Document Compliance Settings for Germany. Enable scenario "DE_XRECHNUNG". This activates the output channel and schema mappings. Verify activation in /DOCCP/SCENARIO.
- 02
Configure Leitweg-ID in Business Partner (BP transaction)
After applying SAP Note 2904195: BP → select customer → "Roles" tab → Customer role → "E-Invoice" section → field "Buyer Reference" (BT-10). Format: 04011000-12345-67. For legacy XD02 maintenance, the field appears in "Additional data" section. Critical: without this, you get BR-DE-15 rejection.
- 03
Create output determination condition records (NACE)
Transaction NACE → V3 (Billing) → Output Types. Create condition records for output type "XREC" (XRechnung). Use key combination: Sales Org + Billing Type + Customer. Set transmission medium "8" (XML) and partner function "RE" (invoice recipient). Map to form /DOCCP/XRECHNUNG_UBL or _CII.
- 04
Configure company contact data in OB28/SPRO
XRechnung BR-DE-17 requires seller contact. Transaction SPRO → Enterprise Structure → Definition → Financial Accounting → Edit Company Data. Add: Ansprechpartner (contact name), E-Mail, Telefon. These map to BG-6 (Seller Contact). Incomplete data = BR-DE-17 error.
- 05
Generate test invoice and check /DOCCP/EINV_LOG
Create billing document (VF01) for a B2G test customer. After posting: /DOCCP/EINV_LOG shows transmission status. Click document → "Display XML" to download the raw XRechnung. Check CustomizationID contains "urn:xoev-de:kosit:xrechnung:3.0".
BR-DE-15Missing Buyer Reference (Leitweg-ID)
SAP's flexibility means Leitweg-ID can be configured in multiple ways (custom field, partner function, or SAP Note 2904195 standard field), leading to inconsistency. The field exists but may not transfer to output correctly.
How to fix itStandardize Leitweg-ID configuration: Use XD02/BP > "Käuferreferenz" field. Verify output determination in NACE > V3 includes the mapping to BuyerReference element.
BR-DE-17Missing Seller Contact Details
XRechnung requires complete seller contact (BG-6). SAP company data may be incomplete after initial setup, especially contact email and phone in Organisationsmanagement.
How to fix itComplete all contact fields in company master: SPRO > Enterprise Structure > Company Code > Edit data. Add Kontakt name, email, telephone.
BR-DE-22Duplicate Attachment Filenames
Multiple attachments from SAP DMS (Document Management System) may have the same filename when exported, violating XRechnung attachment uniqueness requirement.
How to fix itEnsure unique filenames for all attachments in DMS. Use document number + sequence in filename convention.
PEPPOL-EN16931-R010Invalid Buyer Endpoint Scheme
Cross-border invoices from SAP may have incorrectly formatted buyer endpoint identifiers. EndpointID schemeID must be exactly 4 digits (e.g., 0204 for Leitweg-ID).
How to fix itVerify buyer EndpointID schemeID configuration in Document Compliance. For Leitweg-ID use 0204, for GLN use 0088.
Before exporting XRechnung from SAP, verify these items:
- 01Verify Leitweg-ID is populated in customer master (XD02/BP > Käuferreferenz)
- 02Confirm company contact data is complete (email, phone, name)
- 03Check USt-IdNr format: DE + exactly 9 digits
- 04Ensure Lieferdatum or Leistungszeitraum is set on billing document
- 05Verify all attachments have unique filenames
- 06Test output with Document Compliance log (/DOCCP/EINV_LOG)
Generate a test XRechnung by creating a billing document (VF01) for a B2G test customer. Use /DOCCP/EINV_LOG to download the XML.
SAP provides standard test cases in SAP Note 2904195. Import these into your development system for validation testing.
After generating your XRechnung XML from SAP, upload it to Invoice Navigator validator to check compliance with all BR-DE rules before submission. The validator identifies exact field-level errors with SAP-specific fix guidance.
Which SAP Note enables XRechnung?
SAP Note 2904195 provides the XRechnung implementation guide and required custom fields. For S/4HANA Cloud, XRechnung is available through Document Compliance without additional notes.
Can I use XRechnung with SAP Business One?
Yes, but Business One requires a partner add-on for XRechnung generation. Partners like B1 Usability Package or DocMaster provide XRechnung output capabilities.
How do I submit XRechnung from SAP to government portals?
Connect SAP to a Peppol Access Point (like SAP Business Network) or use direct portal submission via the ZRE (Zentraler Rechnungseingang) or OZG-RE portals. SAP Document Compliance supports both methods.
Have a XRechnung invoice from SAP that came back rejected? Check it here.
Checking is free. The first verified download every 30 days is free. After that €1.90 per invoice, or €9 a month for all of them.