How to Clear the Count in Process Flag
Solution ID = KB-71
Goal : Count in Process flag is turned on when no cycle count records exist
Version = All Version
Module : SLMFG
Fact : Cycle Count
Database : Progress, SQL
Cause
Describes how to turn off the Item Warehouse screen's Count in Process flag when there are actually no cycle counting records for the item in the cycle counting system.
Fix
The following query can be run from the progress query editor if you have full Progress. It will turn off the count in process flag for any itemwhse record for which there are no cycle count records:
for each symix.itemwhse where itemwhse.cnt-in-proc:
find first symix.cycle where cycle.whse = itemwhse.whse and
cycle.item = itemwhse.item no-lock no-error.
if not available cycle then itemwhse.cnt-in-proc = no.
end.
If you do not have full Progress, Mapics Support will have to compile the program and send the object version
/* This script is used to correct
itemwhse records that are marked as CNT_IN_PROC yet do not
have a corresponding record in the CYCLE table. */
declare @commit int, @rows int
-------------------------------------------------------------------
-- CHANGE THE @commit VARIABLE TO VIEW OR COMMIT CHANGES.
SET @commit = 1 -- 0=View; 1=Commit the update changes
-------------------------------------------------------------------
-- VIEW RECORDS THAT SHOULD NOT BE
CNT_IN_PROCESS AND ARE NOT SET CORRECTLY
select iw.item, iw.whse, qty_on_hand, cnt_in_proc
from itemwhse as iw
where cnt_in_proc=1 and not exists (
select 1
from cycle cy
where cy.item=iw.item
and cy.whse=iw.whse
)
set @rows=@@rowcount
if
@commit=0
begin
if @rows > 0 select [Results]='Record(s) above need to be
corrected.'
else select [Results]='No incorrect records found.'
end
else
begin
-- UPDATE RECORDS THAT ARE INCORRECTLY SET
update iw
set iw.cnt_in_proc = 0
from itemwhse as iw
where cnt_in_proc=1 and not exists (
select 1
from cycle cy
where cy.item=iw.item
and cy.whse=iw.whse
)
select [Results]= ltrim(str(@@rowcount)) + ' Itemwhse record(s) updated.'