SAP guides
SAPXRechnung

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.

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

1

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.

2

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.

3

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.

4

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.

5

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

BR-DE-15Missing Buyer Reference (Leitweg-ID)
Full guide →

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.

BR-DE-17Missing Seller Contact Details
Full guide →

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.

BR-DE-22Duplicate Attachment Filenames
Full guide →

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.

PEPPOL-EN16931-R010Invalid Buyer Endpoint Scheme
Full guide →

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:

  • 1
    Verify Leitweg-ID is populated in customer master (XD02/BP > Käuferreferenz)
  • 2
    Confirm company contact data is complete (email, phone, name)
  • 3
    Check USt-IdNr format: DE + exactly 9 digits
  • 4
    Ensure Lieferdatum or Leistungszeitraum is set on billing document
  • 5
    Verify all attachments have unique filenames
  • 6
    Test 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 XRechnung

FAQ

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.

Related Guides

Ready to Test Your SAP Export?

Upload your XRechnung invoice and get instant compliance feedback with SAP-specific recommendations.

Validate XRechnung Invoice