Symptom
It takes a long time to display the Inventory Posting List by Items form.
Reproducing the issue
Prerequisites:
You are working in a company database on MS SQL Server with more than 800,000 records in B1_OinmWithBinTransfer view. Distinguish this issue with the one described in SAP Note 3360703.
Scenario 1:
- Open a production order with more than one item.
- Choose Actual Item Component Cost under Summary tab.
Scenario 2:
- Go to Inventory → Inventory Reports → Inventory Posting List.
- In the selection criteria, select item with date range of a month.
- Try to run the report.
Expected behavior:
Inventory Posting List by Items form is displayed without application hang issue.
Actual behavior:
It takes several minutes to display the Inventory Posting List by Items form.
Solution
Set "Legacy cardinality estimator"
Execute the following SQL query:
ALTER DATABASE SCOPED CONFIGURATION
SET LEGACY_CARDINALITY_ESTIMATION = ON;
or right click the database to show Properties window. Options → Database Scoped Configurations → Legacy Cardinality Estimation, set its value to ON.