Prerequisites
- 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
Step-by-Step Setup
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.
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.
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.
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.
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".
Common SAP Errors
Why this happens in SAP
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 it
Standardize Leitweg-ID configuration: Use XD02/BP > "Käuferreferenz" field. Verify output determination in NACE > V3 includes the mapping to BuyerReference element.
Why this happens in SAP
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 it
Complete all contact fields in company master: SPRO > Enterprise Structure > Company Code > Edit data. Add Kontakt name, email, telephone.
Why this happens in SAP
Multiple attachments from SAP DMS (Document Management System) may have the same filename when exported, violating XRechnung attachment uniqueness requirement.
How to fix it
Ensure unique filenames for all attachments in DMS. Use document number + sequence in filename convention.
Why this happens in SAP
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 it
Verify buyer EndpointID schemeID configuration in Document Compliance. For Leitweg-ID use 0204, for GLN use 0088.
Pre-Export Checklist for SAP
Before exporting XRechnung from SAP, verify these items:
- 1Verify Leitweg-ID is populated in customer master (XD02/BP > Käuferreferenz)
- 2Confirm company contact data is complete (email, phone, name)
- 3Check USt-IdNr format: DE + exactly 9 digits
- 4Ensure Lieferdatum or Leistungszeitraum is set on billing document
- 5Verify all attachments have unique filenames
- 6Test output with Document Compliance log (/DOCCP/EINV_LOG)
Testing Your Setup
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.
Validate Your Output
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.
Validate XRechnungFAQ
Which SAP Note enables XRechnung?
Can I use XRechnung with SAP Business One?
How do I submit XRechnung from SAP to government portals?
Related Guides
Ready to Test Your SAP Export?
Upload your XRechnung invoice and get instant compliance feedback with SAP-specific recommendations.
Validate XRechnung Invoice