Let me provide a comprehensive solution addressing all the precision-related focus areas:
Decimal Precision Configuration in Formula Settings:
Navigate to your Formula Type configuration in the Formula Management customizing. Set the ‘Default Calculation Precision’ to 6 decimal places. This is the master setting that controls precision for all formulas of this type. Additionally, in the formula step properties, ensure that ‘Use Type Precision’ is enabled rather than ‘Use Currency Precision’. This prevents the system from automatically applying currency-based rounding (typically 2 decimal places).
Rounding Function Placement in Formula Chains:
Restructure your formula to apply rounding ONLY at the final step:
STEP_1: material_cost * quantity (NO ROUND)
STEP_2: step_1_result * overhead_rate (NO ROUND)
FINAL: ROUND(step_2_result + fixed_costs, 2)
The key is to let intermediate calculations maintain full precision and apply rounding as the last operation. If you need to display intermediate values in reports, create separate display-only variables that round the intermediate results without affecting the calculation chain.
Intermediate Calculation Precision Handling:
Change ALL intermediate variable definitions from DECIMAL(15,2) to DECIMAL(15,6). This is crucial. The variable data type determines the maximum precision that can be stored, regardless of formula settings. In the formula step editor, verify that each intermediate variable has ‘Precision Override’ set to 6 decimal places. Also check the formula context settings - there’s a global precision parameter that can limit intermediate precision even when variables are defined with higher precision.
Cost Estimation Accuracy Validation:
Implement a two-phase validation approach. First, add a validation step in your formula that compares the calculated result against expected ranges. Second, configure the Formula Engine’s built-in variance checking feature. In the formula type customizing, set ‘Maximum Allowed Variance’ to 1% and enable ‘Variance Alert’. This will flag calculations where precision loss causes results to deviate from expected values. Create a custom report using table FORMULA_RESULTS to periodically audit calculation accuracy and identify formulas that consistently show precision issues.
After making these changes, regenerate all affected formulas and run comprehensive testing with known input values. Document the before/after results to validate that precision is now maintained throughout the calculation chain. The 5-8% error you’re experiencing should be completely eliminated with proper precision configuration.
This draft is based on general SAP PLM knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.