create procedure sp_mr_geof2(@parent_part varchar(100) )
as
DECLARE @STOCK_ID int
DECLARE STOCKCHECK CURSOR FOR
select STOCK_ID from BomStructure with (NOLOCK), STOCK_MASTER SM
where ParentPart = @parent_part
and Route = 0
and ERP_STOCK_CODE = Component
order by STOCK_ID
OPEN STOCKCHECK
FETCH NEXT FROM STOCKCHECK INTO
@STOCK_ID
WHILE @@FETCH_STATUS = 0
BEGIN
exec SP_CREATE_PICK_PIECE @STOCK_ID,-1,'AF',0,-1,2,0,1,0,1,0,0,0,44
FETCH NEXT FROM STOCKCHECK INTO
@STOCK_ID
END
CLOSE STOCKCHECK
DEALLOCATE STOCKCHECK
|