/SAPAPO/CL_PFCS_OUTLCNTRL_BADI - Example Implementation for Outlier Correction BAdI
rdisp/max_wprun_time - Maximum work process run time
RFUMSV00 - Advance Return for Tax on Sales/Purchases
This documentation is copyright by SAP AG.
Functionality
The implementation in this class shows an example for the definition of outlier correction of demandin the BAdI /SAPAPO/BADI_OUTLIER_CTRL. The outlier correction defined here is particularly suitable for slow-moving location products. It is based on medians and interquartile ranges (IQR).
The system uses the following Importing Parameters in this implementation:
- Time series of historical data
- In this example implementation only time series of the final history for demand are adjusted. It ispossible that this has the effect that the relationship between the individual parameters changes. If necessary, you can adjust the time series of the second parameter.
- Parameter for outlier correction that you specified in the forecast profile on the Generaltab page in the Parameter: Outlier Correction for Demand (/SAPAPO/OUTLIER_CNTRL_PC). If you have left this field empty, the system plans with the value 1.25.
- You get to the forecast profile on the SAP Easy Access screen under Advanced Planning and Optimization -> Service Parts Planning (SPP) -> Planning -> Forecasting -> Forecast Profile.
For the outlier correction implemented here, the system proceeds as follows:
- The system sorts the historical data in ascending order and groups it into two equal groups. One group contains the lower values, the other the higher values.
- If there is an odd number of historical values, the system groups the historical values into two equal groups by assigning the median to both groups.
- Example 1:
- There are the following historical values:
- The system sorts them in ascending order:
- The system forms two equal groups.
- The group with the lower values is as follows:
- The group with the higher values is as follows:
- Example 2:
- There are the following historical values:
- The system sorts them in ascending order:
- The system forms two equal groups.
- The group with the lower values is as follows:
- The group with the higher values is as follows:
- The system determines the medians of the two groups.
- If both groups have an equal number of historical values, the median is the average of the two middle values of a group.
- Example 1:
- One group has the following historical values:
- In this case, the median is the average of 34 and 42, which is 38.
- The other group has the following historical values:
- In this case, the median is the average of 53 and 56, which is 54.5.
- If both groups have an odd number of historical values, the median is the middle value.
- Example 2:
- One group has the following historical values:
- In this case, the median is 42.
- The other group has the following historical values:
- In this case, the median is 53.
- The median of the first group (M1) is the end of the first quartile of the historical data.
- The median of the first group (M3) is the end of the third quartile of the historical data.
- The system defines the interquartile range between the third and the first quartile by subtracting the value of M1 from the value of M3.
- Example 1:
- In the values described above, the IQR is 54.5 - 38 = 16.5.
- Example 2:
- In the values described above, the IQR is 53-42 =11.
- The system calculates the range in which the historical values must lie for them not to be counted as outliers.
- The system calculates the upper limit of this range as follows:
- Upper Limit = M3 + Outlier Correction Parameter * IQR
- The system calculates the lower limit of this range as follows:
- Lower Limit = M1 - Outlier Correction Parameter * IQR
- If the result of this calculation is negative, the system sets the lower limit to zero.
- Example 1:
- For the values described above and an outlier correction parameter of 1.25, the system proceeds as follows:
- Upper Limit = 54.5 + 1.25 * 16.5 = 75.125
- Lower Limit = 38 - 1.25 * 16.5 = 17.375
- Example 2:
- For the values described above and an outlier correction parameter of 1.25, the system proceeds as follows:
- Upper Limit = 53 + 1.25 * 11 = 66.75
- Lower Limit = 42 - 1.25 * 11 = 28.25
- The system defines all historical values that lie outside of these limits as outliers and sets the to the calculated limits.
- Example 1:
- For the historical values described above, the system defines the following values as outliers:
- This means that the system creates the forecast in this case on the basis of the following historical values:
- Example 2:
- For the historical values described above, the system defines the following values as outliers:
- This means that the system creates the forecast in this case on the basis of the following historical values:
| | 28,25 | 28,25 | 42 | 45 | 47 | 49 | 53 | 56 | 66,75 |
Relationships
Example
Notes
Further information
ROGBILLS - Synchronize billing plans
CL_GUI_FRONTEND_SERVICES - Frontend Services
This documentation is copyright by SAP AG.
Length: 10881 Date: 20120526 Time: 071239 triton ( 123 ms )