|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: |
ALTER PROCEDURE [dbo].[NC_SHORTAGES]
(@Priority int,
@PartNum varchar(80),
@BldQty int)
AS
BEGIN
If IsNull(object_id('tempdb..##partqty'),0) <> 0 DROP TABLE ##partqty
CREATE table ##partqty (level integer, seq integer,
parpart char(30), parrev char(12),
chpart char(30), chrev char(12),
pdesc char(50), reqqty integer, uom char(4),
typecd char(1), path char(40),
whse char(7), ohqty integer,
allocqty integer, nonnetqty integer,
avqty integer, onordr integer,
ppath char(50))
SET NOCOUNT ON
; WITH BOM AS (SELECT 0 AS LEVEL, 000 AS seq, part.partnum AS parent, revisionnum AS P_revisionnum, part.partnum,
revisionnum AS C_revisionnum, partdescription, CONVERT(decimal(18, 8), 0) AS qty, ium, typecode,
CONVERT(varchar(800), (CONVERT(varchar(2), @Priority) + part.partnum)) AS path
FROM part INNER JOIN
NC_PARTREV2 ON part.partnum = NC_PARTREV2.partnum
WHERE part.partnum = @PartNum
UNION ALL
SELECT B. LEVEL + 1, CONVERT(int, M.mtlseq), M.partnum, R.revisionnum, M.mtlpartnum, CR.revisionnum,
P.partdescription, CONVERT(decimal(18, 8), M.qtyper), P.IUM, P.typecode,
CONVERT(varchar(800), b.path + ',' + CONVERT(varchar(10), M.mtlseq))
FROM BOM B INNER JOIN
PARTMTL M ON M.partnum = B.partnum INNER JOIN
NC_PARTREV2 R ON R.partnum = B.partnum AND M.revisionnum = R.revisionnum INNER JOIN
PART P ON P.partnum = M.mtlpartnum INNER JOIN
NC_PARTREV2 CR ON CR.partnum = P.partnum)
INSERT INTO ##partqty
(level, seq, parpart, parrev, chpart, chrev, pdesc, reqqty, uom, typecd, path, whse, ohqty,
allocqty, nonnetqty, avqty, ppath)
SELECT LEVEL, seq, parent, P_revisionnum, bom.partnum, C_revisionnum, partdescription,
(@BldQty * qty) AS QtyNeeded, ium, typecode, path, warehousecode, onhandqty, allocqty,
nonnettableqty, (onhandqty + nonnettableqty - allocqty), path
FROM BOM INNER JOIN
partwhse ON bom.partnum = partwhse.partnum
ORDER BY path
select * from ##partqty order by ppath;
END
RETURN
|
Advertisement
| Hall of Fame |