cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Business One - Committed stock report

former_member666435
Participant
0 Kudos
1,493

Hi all,

Can someone give me a query for the requirement below:

"Committed stock report

This report asks the user to enter an item code and it reports back on all the open sales orders it is on sorted by date. this report is to help a customer to see what the committed stock levels are against an item and who they are committed to.

"Best Regards,Daniel

Accepted Solutions (1)

Accepted Solutions (1)

mgregur
Active Contributor

Hi Daniel,

your query:

select  
t0.DocNum as "SO Number"
,t0.CardCode as "Customer Code"
,t0.CardName as "Customer Name"
,cast(t0.DocDate as date) as "Posting Date"
,t1.ItemCode as "Item Code"
,t1.Dscription as "Item Name"
,t1.OpenQty as "Commited"

from ORDR t0
left join RDR1 t1 on t1.DocEntry = t0.DocEntry

where DocStatus  = 'O'
and t1.ItemCode = [%0]


group by
t0.CardCode
,t0.CardName
,t0.DocNum 
,cast(t0.DocDate as date) 
,t1.ItemCode
,t1.Dscription 
,t1.OpenQty 

order by 
cast(t0.DocDate as date)

is mostly fine, but I would also include t1.LineStatus in your WHERE clause, as a document can be opened but line closed (e.g. partial delivery was made). Also, I don't know why you are using cast on t0.DocDate, it should be shown as date in Query Manager.

BR,

Matija

former_member666435
Participant
0 Kudos

Thanks for the suggestion Matija, i added it to my query.

Best Regards,

Daniel

Answers (0)