Symptom
Portugal SAF-T (E-Fatura, Accounting) report file generated with errors.
- Query R_PAYMENT_CUSTOMERID returns more than one record.
Value is not of the min. required length 1.
Element Name: CustomerID - Query BPFORHEADER returns more than one record. Use query row key in data mapping.
Value is not of the min. required length 1.
Element Name: CustomerID - Query PAYMENT_VALUES returns more than one record. Use query row key in data mapping.
Value is not of the min. required length 1.
Element Name: CustomerID
Environment
SAP S/4HANA Cloud Public Edition.
Reproducing the Issue
- Open the "Run Statutory reports" app.
- Run the Portugal E-Fatura PT_SAFT_EFATURA report or Portugal SAF-T Accounting PT_SAFT_ACCOUNTING
- The report is generated with error:
Query R_PAYMENT_CUSTOMERID returns more than one record.
Error message: "Value is not of the min. required length 1".
Query BPFORHEADER returns more than one record. Use query row key in data mapping.
Value is not of the min. required length 1.
Element Name: CustomerID
Query PAYMENT_VALUES returns more than one record. Use query row key in data mapping.
Value is not of the min. required length 1.
Element Name: CustomerID
Cause
Journal entry created with multiple customers, which is non-compliant with the SAF-T structure.
PT_SAFT_EFATURA, PT_SAFT_ACCOUNTING are unable to select which customer to display in the document header level.
Resolution
The steps below outline how to identify the journal entry created for multiple customers.
- Download and open the XML report file using an XML Editor.
- Search for <CustomerID/>
- Identify transactions where the CustomerID field is empty.
- Recognize that transactions with multiple customers are not supported by the SAF-T structure.
- Contact the local business user, auditor, or legal advisor to explain the validation error to the Tax Authority.
See Also
KBA 3709018 - SAF-T PT Accounting file generated with errors.
Keywords
pt saf-t e-fatura, customerid error, xml file error, empty customerid, r_payment_customerid, statutory reports, portugal saf-t, pt_saft_efatura_file, journal entry, multiple customers, saf-t structure, validation error, tax authority, PT_SAFT_ACCOUNTING. , KBA , FI-LOC-SAF-PT , Portugal , Problem
SAP Knowledge Base Article - Public