SAF-T D406 from Saga — how to generate error-free XML files (2026 guide)
Is ANAF (the Romanian tax authority) rejecting your SAF-T with a "schema validation error"? Here are the 5 frequent errors when generating D406 from Saga and the fix for each.
Ionut Mihaescu — Full Stack Developer Azuvio · 2026-05-21 · 7 min · ERP & Integrations
The D406 Context in 2026
SAF-T D406 is mandatory monthly/quarterly for all companies exceeding the turnover limits set by ANAF (the Romanian tax authority), a requirement expanded gradually since 2022. Saga generates the XML directly, but the file must pass the ANAF XSD schema validation — any error results in automatic rejection + risk of fines (up to 5,000 RON).
Error 1 — «Schema validation error: element X is required»
ANAF requires mandatory fields that Saga does not populate by default for all old records.
Common causes:
VAT accounts without an associated tax code (`TaxCode`)
Suppliers/customers without a country (`Country = RO`) — default for old imports
Items without a code (`ProductCode`) — for companies working with "generic items"
Fix: In Saga, Service → Verificare nomenclator SAF-T runs the validator. The list of problematic items/partners appears; complete them one by one. For high volumes, export to Excel, complete, and re-import.
Error 2 — «Invalid value for TaxCode»
The VAT tax code used is not in the ANAF nomenclature (the list of values allowed for SAF-T).
Fix: ANAF publishes the official SAF-T nomenclatures. Ensure you use codes from the official list (`100`, `101`, `110`, `120`, etc.), not internally invented codes. Saga should have these pre-populated if you have the latest update.
Error 3 — «Date format invalid»
Dates appear as `21/05/2026` instead of `2026-05-21` (ISO 8601 format required by SAF-T).
Fix: In Saga, Setări → Regional → Format dată = ISO 8601 (YYYY-MM-DD). Regenerate the XML afterwards.
Error 4 — Total sum does not match the balance sheet
ANAF compares SAF-T totals with D300/D394. If they differ by >1 RON → rejection.
Common causes:
Manual accounting entries not recorded in journals (only in the general ledger directly)
Credit notes recorded incorrectly (with a positive sign instead of negative)
Rounding differences on mixed VAT (5% / 9% / 19%)
Fix: Run Verificare consistență D300 ↔ SAF-T in Saga (Lists → Verificări menu). Identify the differences, correct them in the relevant registers, and regenerate the SAF-T.
Error 5 — «File size exceeds limit»
SAF-T has an ANAF limit of ~150MB per file. For large companies (5,000+ invoices/month), a single monthly XML can exceed this.
Fix: In Saga, use the «Generare SAF-T pe pachete» option — this splits it into multiple XML files (max 100MB each). Upload them to the SPV (Private Virtual Space) one by one.
A more elegant alternative: Azuvio aggregates data daily, validates it in real-time, and at the end of the month delivers SAF-T in pre-validated batches. Zero submission errors. See the Saga ↔ Azuvio connector.
Checklist before submitting SAF-T to ANAF
1. Run a local XSD validator — download the schema from ANAF, validate with a free tool (XMLSpy free, Notepad++ with XML Tools plugin).
2. Verify totals vs. D300 / D394 / trial balance — max difference 1 RON.
3. Spot-check 10 random invoices — correct tax, correct date, valid client VAT ID.
4. Encoding UTF-8 without BOM — check in Notepad++.
5. Save XML backup before SPV upload — if the submission fails, you have your reference version.
Conclusion
SAF-T D406 from Saga works if: you have the latest update, you validate the nomenclature, you use official ANAF codes, and you check totals against D300. For large volumes or recurring errors, the automatic validation layer (Azuvio) eliminates 95% of ANAF rejections. See the detailed article «SAF-T D406: Saga + Azuvio, zero ANAF errors».