Forecasts are not consuming inventory or supply during the planning activity
Solution ID = KB-242
Version = Syteline7.03.05
Module : SLMFG
Symptom : Forecasts are not consuming inventory or supply during the planning activity
Database : SQL
Cause
The order flags for a forecast are defaulted in the SL7 install to bit 448, which means that forecasts will not use inventory during planning.In the Analyzer, in Order Analysis, if you Edit a Forecast Order, the Do Not Use Inventory and Don Not Use Supply flags will be checked.Fix
To change
the Forecast Order Flags to consider Inventory & Supply perform the
following steps:
- Open SQL Enterprise Manager to
the appropriate SL7 App database
- Click on User Defined Functions
- Navigate to
ApsForecastOrderFlags and double click
- Scroll down past the Header
information to the "CREATE FUNCTION..." text
- Comment out the row that says
"64 -- ORDERFLAGS_NOFIN"
- Comment out the row that says
"+ 128 -- ORDERFLAGS_NOSUP"
- Leave the row that says "+
256 -- ORDERFLAGS_REPLENISH" alone
- Uncomment the row that says "+ 65536 -- ORDERFLAGS_RESERVEFORCTP"
When
finished the Forecast Order Flags should like this in the ApsForecastOrderFlag
User Defined Function:
-- 64 --
ORDERFLAGS_NOFIN
-- 128 --
ORDERFLAGS_NOSUP
+ 256 --
ORDERFLAGS_REPLENISH
+ 65536 --
ORDERFLAGS_RESERVEFORCTP
The next
step is to make sure that the Forecast Order Flags are triggered to the correct
tables:
Run these 3 SQL scripts:
-- Open SQL Query Analyzer to the appropriate SL 7 App database:
-- SQL Script 1: Recalculate forecasts
declare
@item itemtype
declare CFcstItem cursor local static for
select item from item
open CFcstItem
while 1 = 1 begin
fetch CFcstItem into @Item
if @@fetch_status <> 0 break
-- Recalculate forecast consumption
exec ForecastCalcSp @Item
end
-- SQL
Script 2: Delete the old Aps Forecast data (if necessary):
delete
order000
from order000
join forecast on forecast.rowpointer = order000.orderrowpointer
-- SQL
Script 3: Recreate the Forecast records for ORDER000:
declare
@Partition RowPointerType
set @Partition = newid()
insert into TrackRows (
SessionId, RowPointer, TrackedOperType)
select
@Partition
,forecast.rowpointer
,'Sync forecast'
from forecast
exec ApsSyncForecastOrderSp @Partition
delete from TrackRows where SessionId = @Partition