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:

  1. Open SQL Enterprise Manager to the appropriate SL7 App database
  2. Click on User Defined Functions
  3. Navigate to ApsForecastOrderFlags and double click
  4. Scroll down past the Header information to the "CREATE FUNCTION..." text
  5. Comment out the row that says "64 -- ORDERFLAGS_NOFIN"
  6. Comment out the row that says "+ 128 -- ORDERFLAGS_NOSUP"
  7. Leave the row that says "+ 256 -- ORDERFLAGS_REPLENISH" alone
  8. 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

-- Back in SL 7 rerun planning, forecast should now consume inventory and job supply.
Print Email

Send KB to this email: