SAP Knowledge Base Article - Public

3709018 - SAF-T PT Accounting file generated with errors

Symptom

SAF-T PT Accounting file generated with errors:

  • Error: Query BPFORHEADER returns more than one record. Use query row key in data mapping - CustomerID
  • Error: Value is not of the min. required length 1 - CustomerID

Environment

SAP S/4HANA Cloud Public Edition.

Reproducing the Issue

  1. Run statutory reports app.
  2. Search for the report Name: Portugal SAF-T - Accounting
  3. Select the Portugal SAF-T - Accounting activity.
  4. Select the Run Number X
  5. Notice that the run was generated with error.
  6. Error: Query BPFORHEADER returns more than one record. Use query row key in data mapping - CustomerID
    Error: Value is not of the min. required length 1 - CustomerID

Cause

Journal entry created with multiple customers, which is non-compliant with the SAF-T structure.
It is not possible by PT_SAFT_ACCOUNTING 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.

  1. Download and open the XML file report with a XML Editor.
  2. Search for <CustomerID/>
  3. It searches for transactions which the CustomerID field is empty.
  4. Transactions with multiple customers is not supported by the SAF-T structure.
  5. Once the transactions with multiple customers are identified, contact your local business user / auditor / legal advisor to explain the validation error to the Tax Authority. 

Keywords

saf-t, pt accounting, customerid error, query bpforheader, portugal saf-t, accounting file error, statutory reports , KBA , FI-LOC-SAF-PT , Portugal , Problem

Product

SAP S/4HANA Cloud Public Edition all versions