Symptom
Customer Invoice XYZ is cleared and you are querying the Invoice via the web service QueryCustomerInvoiceIn.
The ClearingStatusCode in the Response payload is not the expected one.
Environment
SAP Business ByDesign
Reproducing the Issue
Customer Invoice XYZ is cleared and you are querying the Invoice via the following SOAP Request payload (XYZ represents the ID of the Invoice):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:CustomerInvoiceByElementsQuery_sync>
<CustomerInvoiceSelectionByElements>
<SelectionByID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryIdentifier>XYZ</LowerBoundaryIdentifier>
</SelectionByID>
</CustomerInvoiceSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>1</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</glob:CustomerInvoiceByElementsQuery_sync>
</soapenv:Body>
</soapenv:Envelope>
The following values are available for the ClearingStatusCode:
1: Open
2: Cleared
3: Partially cleared
4: Not Relevant
In the Response the ClearingStatusCode is retrieved as 4 - Not Relevant
<ClearingStatusCode>4</ClearingStatusCode>
You expect that the ClearingStatusCode is retrieved as 2 – Cleared since the Invoice XYZ was cleared.
Cause
The ClearingStatusCode 4 (not relevant) in this case is correct.
On standard Invoices, there is no clearing process, and hence, any status other than 4 will only occur on Down Payment Requests.
This is a known limitation.
For Invoices, the Clearing Status is not changed since for Invoices the information on the clearing is not passed back to the invoice.
Only for Down Payment Requests the information is passed back to the Down Payment Request since only a cleared Down Payment Request can be assigned to an Invoice.
Therefore, for Invoices the Clearing Status cannot be retrieved by a CRM Interface but only via the FIN BO TradeReceivablesPayablesRegister (BO) - ItemOverview (Node).
This could be considered when possibly applying a workaround via a custom web-service (Cloud Application Studio).
Resolution
This is the current system behaviour.
Keywords
Clearing Status Code, web service, webservice, API, Query, Customer Invoice, QueryCustomerInvoiceIn, ClearingStatusCode, Not Relevant, wrong, incorrect, cleared, partially cleared , KBA , SRD-CRM-INV , Customer Invoicing , Problem