Symptom
SAF-T PT Accounting file report generated with error:
Value is not of the min. required length 2. Element name: AccountID.
In the generated Accounting XML, some DebitLine/CreditLine entries contain empty AccountID tags, causing validation to fail.
Environment
SAP S/4HANA Cloud Public Edition.
Reproducing the Issue
- Run Statutory report app.
- Execute the Portugal SAF-T - Accounting report - PT_SAFT_ACCOUNTING.
- Observe that the report is generated with error.
Value is not of the min. required length 2
Element name: AccountID
Cause
Journal entries were posted with an empty Alternative G/L Account, resulting in empty AccountID element in the SAF-T Accounting report, which violates the minimum length requirement.
Resolution
Maintain an alternative G/L Account for the main G/L account. It will solve the issue for new accounting documents.
For the already posted documents, consider to contact to your local business / legal advisor / auditor to manage these validation errors with the Tax Authority.
See Also
Keywords
SAF-T PT, Portugal SAF-T accounting, AccountID, value is not of the min required length 2, empty AccountID, PT_SAFT_ACCOUNTING_V1.04, PT_SAFT_ACCOUNTING_FILE, statutory reports, alternative G/L account, journal entry, debitline, creditline, XML validation, accounting XML, report generation error. , KBA , FI-LOC-SAF-PT , Portugal , Problem
SAP Knowledge Base Article - Public