Query on inventory

Hi All,
What will be the query to see the item code, item description, item Stock etc "INVENTORY WISE" ?
Regards,
Rupa Sarkar

Hi Rupa,
Try this...
select T0.Itemcode,T0.itemname,T1.Whscode,T1.Onhand,T1.iscommited,T1.OnOrder from oitm T0
inner join oitw T1 on T0.Itemcode=T1.Itemcode
Thanks
Sachin

Similar Messages

  • Query on Inventory Cube 0IC_C03

    Hi All
    When running a query on Inventory Cube, I get some of the values like this "[2,000]" and the value is not taken into account in the total row.
    Any Idea about the "[Value]"?
    Thanks
    Dror Golani

    Hi,
    Probably it could be a NUMC data type.Just check.
    venkat

  • Can anyone share the query for inventory aging report

    Is there any standard reports for inventory aging in oracle ebs 12.1.3 ....... If not can anyone share the query for inventory aging report

    Hi,
    It may not be so simple as you are trying to reproduce the historical value.  I believe you have to create a temporary table first.  Or you may use Command feather to get the required data in advance.
    Thanks,
    Gordon

  • Is it possible to query software inventory report for Oracle SQL developer installation?

    Hi all
    My company requires to generate a report of all kinds of Oracle database access tool. I can find Toad installation from Add/Remove Program and therefore can query for Toad.
    However, Oracle SQL developer is using Java. I cannot see an entry for Oracle SQL developer from Add/Remove Program. Is there a way to query inventory for Oracle SQL developer installation?
    Thanks a lot.
    Regards
    Lic

    You might be able to use software inventory to report on the version of sqldeveloper.exe.
    As the app looks like just a zip you extract to a custom location that might be one method.

  • Re:Query For Inventory Transfer..!!!

    Dear Members,
    My Scenario is,
    I want to take a report for inventory transfer that contains
    1. Itemcode
    2.Item description
    3.quantity
    4.inventory quantity on the previous day.
    I have taken the tables owtr,wtr1,oitm and oitw.But the issue is if my document date is like 30.11.2010 i want the inventory quantity value as  on 29.11.2010.
    I need only query not SAP Reports.Plz suggest a suitable query for this issue.
    With Regards,
    Revathy

    Hi Revathy,
    You have to use OINM table to get your desired Stock on past dates.
    Have a look at these queries.
    1. Stock per itemwise
    select t1.ItemCode,max(t1.dscription) [Name],(sum(isnull(t1.InQty,0)) - sum(isnull(t1.OutQty,0)) ) [ClsStock],(sum(t1.transvalue)) [ClsValue]
    from OINM t1
    where  t1.DocDate <= '[%1]'
    group by
    t1.ItemCode
    2.Stock per item per warehouse wise
    select t1.ItemCode,max(t1.dscription) [Name],t1.warehouse [Warehouse],
    (select whsname from owhs o1 where ((o1.whscode) = (t1.warehouse))) [WarehouseName],
    (sum(isnull(t1.InQty,0)) - sum(isnull(t1.OutQty,0)) ) [ClsStock],(sum(t1.transvalue)) [ClsValue]
    from OINM t1
    where t1.DocDate <= '[%1]'
    group by
    t1.ItemCode,t1.warehouse
    Regards,
    Bala
    Edited by: Balakumar Viswanathan on Dec 10, 2010 5:22 PM

  • Query help - Inventory, warehouse, Price List, AP PO, & wildcard search?

    Hi All,
    I have a query that does a lookup on inventory and returns useful info as onhand, committed, warehouse,
    various price list data etc. It is very useful for our telephone sales guys as they can see all the information
    they need in one quick search. There is a wildcard variable that searches both the ItemCode and ItemName
    fields to return possible results.
    I would like to add one further column to this query.. being the ETA (DocDueDate) of the most recent Open
    AP purchase order that relates to the Item.. if any. I want to return the rest of the result even if there is no
    AP Purchase Order open.
    I have posted two queries below. The first is the original query that works well. It offers wildcard search
    of the ItemCode and ItemName, but does not give me the ETA (DocDueDate) of any open AP Purchase
    orders for the item (what I want).
    The second query does give me everything thing I want returned, but only if I enter the exact ItemCode
    into the variable field. I can no longer do the wildcard search that I also want. Some of our codes are simply
    not practical to remember, and cannot be easily identified. this is why I need the wildcard search to look in
    both the Item and Name column and return possible matches.
    I have both queries below.
    This is the working original query...
    SELECT
    T0.[ItemCode],
    T0.[ItemName],
    CAST (T0.[OnHand] As INT) As ' Total On Hand', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=01) As INT) As 'Melb Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=06) As INT) As 'Demo Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=04) As INT) As 'Bill Car Stock',
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=05) As INT) As 'Brett Car Stock',
    CAST (T0.[IsCommited] As INT) As 'Committed',
    CAST (T0.[OnOrder] As INT) As 'On Order',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=6) as 'RRP Inc GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=1) as 'RRP Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=2) as 'Comp Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=3) as 'Std Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=4) as 'Pro Ex GST',
    T1.[ItmsGrpNam],
    T2.[FirmName]
    FROM OITM T0  INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod
    INNER JOIN OMRC T2 ON T0.FirmCode = T2.FirmCode
    WHERE T0.[ItemCode] Like '%%[%0]%%' OR  T0.[ItemName] Like '%%[%0]%%'
    ORDER by T0.[ItemCode]
    For Browse
    This is the new query with the AP PO DocDueDate lookup included. (Wildcard searches dont work anymore)
    SELECT
    T0.[ItemCode],
    T0.[ItemName],
    CAST (T0.[OnHand] As INT) As ' Total On Hand', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=01) As INT) As 'Melb Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=06) As INT) As 'Demo Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=04) As INT) As 'Bill Car Stock',
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode=05) As INT) As 'Brett Car Stock',
    CAST (T0.[IsCommited] As INT) As 'Committed', CAST (T0.[OnOrder] As INT) As 'On Order',
    (SELECT TOP 1 T0.[DocDueDate] FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T1.[ItemCode] = [%0] And  T0.[DocStatus] ='O' ORDER BY T0.[DocDate] Asc) As 'ETA',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=6) as 'RRP Inc GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=1) as 'RRP Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=2) as 'Comp Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=3) as 'Std Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=4) as 'Pro Ex GST',
    T1.[ItmsGrpNam],
    T2.[FirmName]
    FROM OITM T0  INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod
    INNER JOIN OMRC T2 ON T0.FirmCode = T2.FirmCode
    WHERE T0.[ItemCode] Like '%%[%0]%%' OR  T0.[ItemName] Like '%%[%0]%%'
    ORDER by T0.[ItemCode]
    For Browse
    As you can see in query 2, I used the same variable to attempt to lookup the DocDueDate from OPOR.
    This only works if I enter the variable exactly as ItemCode. No longer wildcard search.
    if anyone could offer any assistance it would be most appreciated.
    Best regards,
    John

    Hi István,
    Thanks! That works great.
    The only additional thing I need is to return the DocNum of the Purchase order (DocNum from OPOR). I attempted to do this by adding T.[DocNum] to your suggested query as per below... however it returns error "Only one expression can be specified in the select list when the subquery is not introduced wit EXISTS"
    SELECT
    T0.[ItemCode],
    T0.[ItemName],
    CAST (T0.[OnHand] As INT) As ' Total On Hand', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode='01') As INT) As 'Melb Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode='06') As INT) As 'Demo Whse', 
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode='04') As INT) As 'Bill Car Stock',
    CAST ((SELECT OnHand from OITW where ItemCode=t0.ItemCode and WhsCode='05') As INT) As 'Brett Car Stock',
    CAST (T0.[IsCommited] As INT) As 'Committed', CAST (T0.[OnOrder] As INT) As 'On Order',
    (SELECT TOP 1 T.[DocNum], T.[DocDueDate] FROM OPOR T  INNER JOIN POR1 Tt ON T.DocEntry = Tt.DocEntry
    WHERE Tt.[ItemCode]=T0.ItemCode And  T.[DocStatus] ='O' ORDER BY T.[DocDate] Asc) As 'ETA',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=6) as 'RRP Inc GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=1) as 'RRP Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=2) as 'Comp Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=3) as 'Std Ex GST',
    (SELECT price from ITM1 where ItemCode=t0.ItemCode and PriceList=4) as 'Pro Ex GST',
    T1.[ItmsGrpNam],
    T2.[FirmName]
    FROM OITM T0  INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod
    INNER JOIN OMRC T2 ON T0.FirmCode = T2.FirmCode
    WHERE T0.[ItemCode] Like '%%[%0]%%' OR  T0.[ItemName] Like '%%[%0]%%'
    ORDER by T0.[ItemCode]
    For Browse
    Any ideas?
    Many thanks,
    John

  • Query for Inventory Activity for whse & dates

    I am using the query below to report Inventory Activity by Whse for a selected date range. Can anyone please advise on how to add a column for Inventory Unit of Measure (OITM.InvntryUom) to this query? This would make the report more useful. Even more useful would be to also integrate batch numbers into this same query. Would this be possible also?
    The columns returned by this query currently are: Whse, ItemCode, ItemName, OpeningBalance, InQty, OutQty, and EndingBal.
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Whse nvarchar(10)
    Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]')
    Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
    Set @Whse = (Select Max(s2.Warehouse) from dbo.OINM S2 Where S2.Warehouse = '[%2]')
    Select
    @Whse as 'Warehouse',
    a.Itemcode,
    max(a.Dscription) as [Item Name],
    sum(a.[Opening Balance]) as [Opening Balance],
    sum(a.[IN]) as [IN],
    sum(a.OUT) as OUT,
    ((sum(a.[Opening Balance]) + sum(a.[IN])) - Sum(a.OUT)) as Closing
    from(
    Select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    (sum(N1.inqty)-sum(n1.outqty)) as [Opening Balance],
    0 as [IN],
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate < @FromDate
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    0 as [Opening Balance],
    sum(N1.inqty) as [IN],
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <= @ToDate and
    N1.Inqty >0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    0 as [Opening Balance],
    0 as [IN],
    sum(N1.outqty) as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <=@ToDate and
    N1.OutQty > 0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription) a, dbo.OITM I1
    where
    a.ItemCode=I1.ItemCode 
    Group By
    a.Itemcode
    Having sum(a.[Opening Balance]) + sum(a.[IN]) + sum(a.OUT) > 0
    Order By a.Itemcode

    Try this one:
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Whse nvarchar(10)
    Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]')
    Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
    Set @Whse = (Select Max(s2.Warehouse) from dbo.OINM S2 Where S2.Warehouse = '[%2]')
    Select
    @Whse as 'Warehouse',
    a.Itemcode,
    max(a.Dscription) as ItemName,
    sum(a.OpeningBalance) as OpeningBalance,
    sum(a.INq)  as 'IN',
    sum(a.OUT) as OUT,
    ((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing
    ,(Select  i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM
    from(
    Select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    (sum(N1.inqty)-sum(n1.outqty)) as OpeningBalance,
    0 as INq,
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate < @FromDate
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    0 as OpeningBalance,
    sum(N1.inqty) ,
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <= @ToDate and
    N1.Inqty >0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,
    0 as OpeningBalance,
    0 ,
    sum(N1.outqty) as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <=@ToDate and
    N1.OutQty > 0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription) a, dbo.OITM I1
    where
    a.ItemCode=I1.ItemCode
    Group By
    a.Itemcode
    Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0
    Order By a.Itemcode

  • Query for Inventory Account getting from Item Master

    Hi,
    I want to get Inventory Account from Item Master with the use of query.
    I used below query for that.
    SELECT T0.[ItemCode], T0.[BalInvntAc] FROM OITW
    but it's give me the blank value for the Inventory Account.
    Thanks & Regards,
    Tushar Nathwai

    Hi Gordon,
    It's a Inventory - Finished Products (TRG)
    But it's also not displayed in other database so what could be the reason for that?
    Thanks & Regards,
    Tushar Nathwani

  • Query for Inventory Audit Report

    hi experts,
    I would like to create a inventory report  using Crystal Reports 2008 which looks exactly the same as Inventory Audit Report in SAP Business One 2007A
    Report requirement:
    List down all the items with its Item Code, Description, Quantity and Item Cost (easy right?)
    The only condition:
    I would like to filter my report by FromDate and ToDate.
    For example:
    Current date 15.07.2009
    If I run the report by putting in 01.01.2009 to 31.01.2009, the result will show me:
    item, with its respective info and most importantly the Quantity and Item Cost as at 31.01.2009 (similar to closing stock)
    Any query for above report?
    Please help.
    Thank you.

    Hi,
    It may not be so simple as you are trying to reproduce the historical value.  I believe you have to create a temporary table first.  Or you may use Command feather to get the required data in advance.
    Thanks,
    Gordon

  • Inventory Monitoring Query Like 'Inventory Posting List ' Report

    Hi,
    I like to ask how to monitor/Track my Items in the Inventory. Inventory Posting List is a good Report but I want to customize it into my query. I have found a table OITW but the record is up date, there is no date i can refer to which I can back track the records.
    I want to create a report (query) which I can back track the previous transaction. Please guide me what tables i can refer to.
    Thank you very much.
    Regards,
    Clint

    Hi Gordon,
    It seems I cant found any data regarding the transactions for my inventory because in the present the report is up to date.
    I want to get the previous inventory month of the item in which i will consider it as my beginning balance for my current inventory, in the the system its showing the current inventory.
    Thank you very much,
    Clint

  • Approval Query on Inventory Transfer

    Hi All,
    I want an Approval Procedure to be invoked when a Particular User post a Inventory Transfer. The Scenario is the user will transfer goods from his Warehouse to 2 different Warehouse. For Eg: Stores and Despatch.
    He will make a separate Inventory Transfer to transfer goods to Stores and another entry to transfer goods to Despatch.
    If he Transfer Goods to Stores, it has to be approved by Stores Department User.
    If he Transfer Goods to Despatch , it has to be approved by Despatch Department User.
    I tried using Query in Approval Procedure. Not able to get correct way it shoud work.
    Help Needed...
    Thanks in Advance....
    Marikannan

    Hi Thanks for the reply...  I have created the UDF for those. I used the Following Query.. But it doesnt work. Any issue with my query...
    DECLARE @whs AS NVARCHAR(20)
    SET @whs = (SELECT $[$18.1.0])
    DECLARE @reas AS NVARCHAR(20)
    SET @reas = (SELECT $[$u_po_ref.1.0])
    SELECT DISTINCT 'TRUE' FROM OWTR Z1 WHERE @reas = 'DSPT' AND @whs = 'QLTY'
    I Use @whs for Filler field in OWTR
    I User @reas for UDF in OWTR
    Thanks... Marikannan
    Edited by: Marikannan Balu on Apr 22, 2010 8:11 AM

  • Query about Inventory Cost of Goods Sold Account Generator WF Customization

    Hi
    We are trying to Customize the 'Inventory Cost of Goods Sold Account Generator' workflow for our client in Oracle Applications 11.5.10 instance.
    We have successfully uploaded the modified workflow and changed the GL Account Generator Process to point to the Custom Workflow.
    Database is bounced after this change, but the changes are not taking effect.
    Any help in this matter would be greatly appreciated.
    Thanks and Regards

    Hi,
    You shouldn't need to bounce the database for any changes to take affect (although if you were experiencing the "existing state of the packages has been discarded" error then it would clear that).
    Switch on debugging so that the workflow is persisted rather than being run in forced synchronous mode, and then see what route the process is taking. If you open the workflow from the database via workflow builder, are you seeing the correct version?
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Query for Inventory Report

    Hi Guys,
    We need to produce stock report for every month and in order to achieve that i have used this query and  also am getting those figures correctly.
    But we are maintaining different item groups and  we need to display all the items which comes under  the group in that particular warehouse or location even though there is no transactions in that given date range.
    whenever we generate the report this below query displaying only the items which has transactions on that particular give range.but we need all the items  which belongs to that itemgroup.
    Suppose,  there are 57 items in Item groupB in warehouse no-3.
    and i have a date range from 01/03/10 to 10/03/10 and item group B and warehouse no 3 as input.
    and the query displays only 11 items which has transactions. but we need other 46 items also to be displayed in the report eventhough it has no transactions in that   range and  for those items we need the previous closing balance(if possible).
    Pls guys help me in this.. its CRITICAL FOR US...
    ====================================================================================================
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Group nvarchar(10)
    Declare @Whse nvarchar(10)
    Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]')
    Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
    Set @Group = (Select Max(s2.ItmsGrpCod) from dbo.OITB S2 Where S2.ItmsGrpNam = '[%2]')
    Set @Whse = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse = '[%3]'  )
    Select
    @Whse as 'Warehouse',     
    a.Itemcode,
    max(a.Dscription),
    sum(a.[Opening Balance]) as [Opening Balance],
    sum(a.[IN]) as [IN],
    sum(a.OUT) as OUT,max(a.Price) as 'Price',
    ((sum(a.[Opening Balance]) + sum(a.[IN])) - Sum(a.OUT)) as Closing
    from(
    Select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,N1.Price,
    (sum(N1.inqty)-sum(n1.outqty)) as [Opening Balance],
    0 as [IN],
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate < @FromDate and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription,N1.Price
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,N1.price,
    0 as [Opening Balance],
    sum(N1.inqty) as [IN],
    0 as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <= @ToDate and
    N1.Inqty >0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription,N1.price
    Union All
    select
    N1.Warehouse,
    N1.Itemcode,
    N1.Dscription,N1.price,
    0 as [Opening Balance],
    0 as [IN],
    sum(N1.outqty) as OUT
    From dbo.OINM N1
    Where
    N1.DocDate >= @FromDate and N1.DocDate <=@ToDate and
    N1.OutQty > 0
    and N1.Warehouse = @Whse
    Group By
    N1.Warehouse,N1.ItemCode,N1.Dscription,N1.price) a, dbo.OITM I1
    where
    a.ItemCode=I1.ItemCode and
    I1.ItmsGrpCod = @Group
    Group By
    a.Itemcode
    Having sum(a.[Opening Balance]) + sum(a.[IN]) + sum(a.OUT) > 0
    Order By a.Itemcode
    ====================================================================================================
    Thanks in advance,
    Regards,
    Vamsi.

    Hi,
       For multi selection you have to try Crystal Reports. In Query Report you can choose particular range same as From Date,To Date..
    You may try this....
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Group nvarchar(10)
    Declare @Group1 nvarchar(10)
    Declare @Whse nvarchar(10)
    Declare @Whse1 nvarchar(10)
    Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]')
    Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
    Set @Group = (Select Max(s2.ItmsGrpCod) from dbo.OITB S2 Where S2.ItmsGrpNam >= '[%2]')
    Set @Group1 = (Select Max(s2.ItmsGrpCod) from dbo.OITB S2 Where S2.ItmsGrpNam <= '[%2]')
    Set @Whse = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse <= '[%3]')
    Set @Whse1 = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse >= '[%3]')
    Select a.Warehouse as 'Warehouse', a.Itemcode, max(a.Dscription), sum(a.[Opening Balance]) as [Opening Balance],
    sum(a.[IN]) as [IN], sum(a.OUT) as OUT,max(a.Price) as 'Price',
    ((sum(a.[Opening Balance]) + sum(a.[IN])) - Sum(a.OUT)) as Closing from dbo.OITM I1
    Left JOIN (Select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.Price, (sum(N1.inqty)-sum(n1.outqty)) as
    [Opening Balance], 0 as [IN], 0 as OUT
    From dbo.OINM N1
    Where N1.DocDate < @FromDate and N1.Warehouse = @Whse and N1.Warehouse >= @Whse1
    Group By N1.Warehouse,N1.ItemCode,N1.Dscription,N1.Price
    Union All
    select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.price, 0 as [Opening Balance], sum(N1.inqty) as [IN],
    0 as OUT From dbo.OINM N1 Where N1.DocDate >= @FromDate and N1.DocDate <= @ToDate and N1.Inqty >0 and
    N1.Warehouse = @Whse and N1.Warehouse >= @Whse1
    Group By N1.Warehouse,N1.ItemCode,N1.Dscription,N1.price
    Union All
    select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.price, 0 as [Opening Balance], 0 as [IN],
    sum(N1.outqty) as OUT From dbo.OINM N1 Where N1.DocDate >= @FromDate and N1.DocDate <=@ToDate
    and N1.OutQty > 0 and N1.Warehouse >= @Whse and N1.Warehouse >= @Whse1 Group By N1.Warehouse,
    N1.ItemCode,N1.Dscription,N1.price) a
    ON a.ItemCode=I1.ItemCode
    where  I1.ItmsGrpCod = @Group
    Group By a.Itemcode
    Order By a.Itemcode
    Regards,
    Priya

  • Query for Inventory transfer

    Hi All
    I have 3 location A,B,C
    And 5 warehouse for each location  Now  i transfer inventory A to B Location and B to C location . Some time A To A location With Diffrent Warehouse .
    So i want a report That How mach inventory we have transfered When My location is diffrent .  
      means From warehouse location  and To warehouse location should me diffrent .
    I want some Feild in this report like
    Docnum, Docdate, From warehouse,From warehouse Location, ItemName,Quantity,To warehouse,To warehouse Location 
    Thanks & Regard
    Areeba Ali

    Hi Areeba Ali,
    Try this...
    SELECT T0.DocNum, T0.DocDate, T0.Filler as 'From Warehouse' , T3.Location 'From Location', T1.Dscription, T1.Quantity, T1.WhsCode 'To Warehouse', T4.Location 'To Location' FROM OWTR T0
    INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OWHS T2 ON T0.Filler = T2.WhsCode
    INNER JOIN OLCT T3 ON T2.Location = T3.Code INNER JOIN OLCT T4 ON T1.Loccode = T4.Code
    Thanks
    Sachin

  • Query on inventory management

    Hi freinds,
    I wanted to guide me regarding this question  "what is the difference between unrestricted use and scheduled material" 
    As far i know unrestricted materail is the one which is available for ready usage
    Scheduled material is the "reserved material " which is reserverd to ensure the availability of material when required
    Is that right ??
    If we are asked to find a "goods movement record" for a particular material "
    Is that asking about "Material Document " ?
    please help me

    hi,
    yes what you said is correct because when any one ask you the material record then we use t.code MB51 which even shows the document number.
    Edited by: MANI ROOPA SD/MM on Apr 21, 2008 1:10 PM

Maybe you are looking for

  • I keep having kernel Panics caused when I try to move file from external hd to my mac.

    i keep getting the below panic report when i try to move a movie file from my external hd to my mac. My MacBook Pro runs 10.7.5 the hard drive (HD) is formatter to fat 32 so i can hook it to our xbox. The HD is a 4tb seagate backup + desk media. it i

  • Multitouchpad drivers won't install with Windows XP and bootcamp

    I just got a MacBook pro with the multitouch trackpad.  I have repeatedly reinstalled the driver then told windows to rescan the system, it identifies the trackpad then says "a problem occurred during hardware installation" and the trackpad does noth

  • How do I keep Mail messages from vanishing?

    I don't use  iCloud for much, but I have sent a few Mail messages from my iPad (iCloud address) and I have received a few at that address that I need to be able to view on my Mac and to have available for viewing on my iPad. The received messages con

  • FCP Issue with Crossgrade

    FCP will not open, nor will any of the other pro apps. The error is: ===== Thursday, June 22, 2006 7:07:07 PM US/Central ===== dyld: Library not loaded: /System/Library/PrivateFrameworks/ProKit.framework/Versions/A/ProKit Referenced from: /Applicatio

  • Displaying File Location in iTunes

    I can't seem to find a way to display my file locations in iTunes - I don't see it as a column that can be displayed. I'd like to be able to view this column to help with possible duplicate removal. I understand how to remove and even view the duplic