on 01-17-2012 5:00 PM
Hello Experts,
Have anyone tried to generate a query that would display Availability of all items in month view:
Ex: It would be in this format. I created 2 views to accomodate this but still thinking to see if i get this data with a single query or is there any table that i look into and group by months?
*Year ItemCode ItemDesc Instock Jan Committed Jan OnOrder Jan ATP...........................Dec Commited Dec OnOrder Dec ATP*
Hi Praneeth ,
We have set up SP_TN to check current month's availability of a product and if the booking is more than availibility then the SO is rolled back
You will have an idea from this
following is the logic
extract itemcode
find stock on hand
find pending sales orders for the current month
find pending purchase orders for current month
then( stock + pending purchase orders) - (pending sales orders) = availability
if the availability < booking then roll back
Hope this will help you
Thanks
Malhaar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Assume we are n month Feb now, what you meant to say Jan Commit, Jan Order. Is that last month data ?
ATP report is something which will show the Current and future Stock detail.
Have you seen Invetory Status Report - Available to Promise
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Try this report with Crystal Reporter - Pivot Table, that will be easy in coding aswell give good performance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Gordon, Thanga Raj
Here is what i am using in the crsytal source, i used cross-tab and summarized totals at the end of the month to make this work in crystal. Can we get the same in query?
-
Get All Items from Open Sales Orders-----
select T1.ItemCode, T1.ItemName, T3.WhsCode ,T4.OnHand ,
SUM(T3.Quantity) as 'Committed', 0 as 'Ordered', T2.DocDueDate
from ORDR T2
inner join RDR1 T3 on T2.DocEntry = T3.DocEntry
Left join OITM T1 on T3.ItemCode = T1.ItemCode
inner join OITW T4 on T3.WhsCode = T4.WhsCode and T1.ItemCode = T4.ItemCode
where T3.LineStatus = 'O'
and T4.WhsCode='01'
Group By T1.ItemCode,T1.ItemName,T3.WhsCode,T4.OnHand,T3.Quantity,T2.DocDueDate
union all
-
Get All Items from Open Purchase Orders----
select T1.ItemCode, T1.ItemName, T3.WhsCode ,T4.OnHand, 0,
SUM(T3.Quantity), T2.DocDueDate
from OPOR T2
inner join POR1 T3 on T2.DocEntry = T3.DocEntry
Left join OITM T1 on T3.ItemCode = T1.ItemCode
inner join OITW T4 on T3.WhsCode = T4.WhsCode and T1.ItemCode = T4.ItemCode
where T3.LineStatus = 'O'
and T4.WhsCode='01'
Group By T1.ItemCode,T1.ItemName,T3.WhsCode,T4.OnHand,T3.Quantity,T2.DocDueDate
Union All
-
Get All Items not in Sales & Purchase Orders
Select t0.ItemCode,t0.ItemName,t1.WhsCode,t1.OnHand,t1.IsCommited as Committed,t1.OnOrder as 'Ordered',GETDATE() as DocDueDate
from OITM t0 inner join OITW t1 on t0.ItemCode=t1.ItemCode
where t1.WhsCode in('SW','CHINA','CHINA2','CN-TR','CN-VC','UK')
and t0.ItemCode not in
(Select Distinct t.ItemCode
from
(Select T1.ItemCode, T1.ItemName, T3.WhsCode ,T4.OnHand ,
SUM(T3.Quantity) as 'Committed', 0 as 'Ordered', T2.DocDueDate
from ORDR T2
inner join RDR1 T3 on T2.DocEntry = T3.DocEntry
Left join OITM T1 on T3.ItemCode = T1.ItemCode
inner join OITW T4 on T3.WhsCode = T4.WhsCode and T1.ItemCode = T4.ItemCode
where T3.LineStatus = 'O'
and T4.WhsCode='01'
Group By T1.ItemCode,T1.ItemName,T3.WhsCode,T4.OnHand,T3.Quantity,T2.DocDueDate
union all
select T1.ItemCode, T1.ItemName, T3.WhsCode ,T4.OnHand, 0,
SUM(T3.Quantity), T2.DocDueDate
from OPOR T2
inner join POR1 T3 on T2.DocEntry = T3.DocEntry
Left join OITM T1 on T3.ItemCode = T1.ItemCode
inner join OITW T4 on T3.WhsCode = T4.WhsCode and T1.ItemCode = T4.ItemCode
where T3.LineStatus = 'O'
and T4.WhsCode='01'
Group By T1.ItemCode,T1.ItemName,T3.WhsCode,T4.OnHand,T3.Quantity,T2.DocDueDate)t
)
Hi,
Have you tried a query to get one month show correctly? If yes, post it and monthly would be easy.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.