Skip to Content

Which table stores "batch number" and "quantity" of each batch in a particular warehouse?

Hi everyone,

I need to make a query that lists the "batch number" and "quantity" of each batch in a particular warehouse

I have queried OBTN, OBBQ, OITM, OWHS and got everything I need with success but cannot seem to measure the quantity by batch numbers in each warehouse.

Thank you!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 25, 2020 at 09:46 AM

    Hi,

    Try this query,

    SELECT T0.[ItemCode],

    T1.[WhsName],

    v0.[Quantity] [WhsTotal],

    T0.[BatchNum],

    SUM(CASE T0.[Direction] when 0 then 1 else -1 end * T0.[Quantity]) [Quantity] FROM IBT1 T0 INNER JOIN OWHS T1 ON T0.WhsCode = T1.WhsCode

    INNER JOIN (SELECT T0.[ItemCode], T1.[WhsName],

    SUM(CASE T0.[Direction] when 0 then 1 else -1 end * T0.[Quantity]) [Quantity]

    FROM IBT1 T0 INNER JOIN OWHS T1 ON T0.WhsCode = T1.WhsCode

    GROUP BY T1.[WhsName], T0.[ItemCode]) V0 ON T0.[ItemCode]=V0.[ItemCode] and t1.[WhsName]=v0.[WhsName] WHERE T0.[ItemCode] =[%0] GROUP BY T0.[BatchNum], T1.[WhsName], v0.[Quantity], T0.[ItemCode]

    Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 27, 2020 at 12:01 PM

    Dear Rohan Chengappa ,

    OBTQ is the table that is listing batch quantity per warehouse.

    OBBQ is contains the batch quantity per bin location.

    Hope this helps

    Jan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.