Symptom
You want to use this Webservice queryaccountopenamountsin to check Credit Limit from Webservice.
You are testing with the account XXXX with credit limit 5.000 EUR. If you check credit limit for one of the Sales Order, it results with the information message: "Credit limit not exceeded; 3233.40 EUR is left" ('XXXX' refers to account ID).
Environment
SAP Business ByDesign.
Reproducing the Issue
- Go to sales order Work center.
- Select a Sales Order YYYY for the account XXXX.
- Click on Actions – Simulate Check Credit Limit.
- It gives the information message as: Credit limit not exceeded; 3233.40 EUR is left.
Here no warnings/error messages occurred.
Based on the amount mentioned in the information message (i.e.,3233.40 EUR), when you compared it with the process of web service in the XML response the result is different as mentioned below.
<CreditLimitAmount currencyCode="EUR">5000.0</CreditLimitAmount>
<CurrentSpendingLimitAmount currencyCode="EUR">4261.9</CurrentSpendingLimitAmount>
<ReceivablesBalanceAmount currencyCode="EUR">738.1</ReceivablesBalanceAmount>
Cause
Information message in BYD during credit limit check: Credit limit not exceeded; 3233.40 EUR is left.
On comparison with Web service XML response as below
<CreditLimitAmount currencyCode="EUR">5000.0</CreditLimitAmount>
<CurrentSpendingLimitAmount currencyCode="EUR">4261.9</CurrentSpendingLimitAmount>
<ReceivablesBalanceAmount currencyCode="EUR">738.1</ReceivablesBalanceAmount>
In the webservice response, if you check the calculation it behaves as expected--> 5000-738.10 = 4261.9 EUR.
Here you are using the file which fetches only the Open Items, so the amount in information message and Webservice XML response mismatched.
Resolution
You have to use the below tag lines to get the Open items and In preparation items in the Web service.
<AccountOpenAmountsSelection>
<!--Zero or more repetitions:-->
<SelectionByAccountID>
<!--Optional:-->
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<!--Optional:-->
<LowerBoundaryIdentifier>XXXX</LowerBoundaryIdentifier>
<!--Optional:-->
</SelectionByAccountID>
</AccountOpenAmountsSelection>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>1</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
<IncludeOpenOrders>true</IncludeOpenOrders> <IncludeOpenAndInPreparationOrders>true</IncludeOpenAndInPreparationOrders>
Once you added this in the file, then you can see that the amount matches in both ByD and Web service.
Keywords
Sales Order, Credit Limit, Web Service, XL, Open Items, Invoiced Items, queryaccountopenamountsin. , KBA , SRD-FIN-ACR , Receivables , Problem