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

Similar Messages

  • 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

  • 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

  • Set approval for inventory transfer document

    hi
    i am using sap b1 with 2005
    i want to set approval to particular product manager  when transfer item from one warehouse to other  warehouse in inventory transfer document
    for that i write query in query generator like
    SELECT T0.DocNum, T1.ItemCode, T1.Dscription, T1.Quantity, T2.SWW FROM OWTR T0  INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T0.DocDate >=[%0] and
    T2.SWW ='chandan'
    {chandan is name of product manager}
    so please send query that will support for approval template.
    regards,
    sandip

    In the Approval templates > Document tab ..only the documents listed can have an Approval Procedure tied to them.
    If Inventory transfer is not listed there, you might not be able to create one
    Suda

  • 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 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

  • Approval for Inventory transfer

    Hai All,
    Here is my scenario : I have 3 warehouses named store1 , store2 and strore3.
    When store1 makes inventory transfer to store2 it should be approved by store2 only.
    When store1 makes inventory transfer to store3 it should be approved by store3 only.
    The above case applies to store2 and store3 also while making inventory transfer.
    Is there any solution or work around for this scenario ?
    Regards
    S.Rajaram

    Hi Raja Ram
    Create one UDF on Header Level as To Warehouse
    SELECT 'TRUE' where $[$UDF]='warehouse1Code'
    SELECT 'TRUE' where $[$UDF]='warehouse2Code'
    SELECT 'TRUE' where $[$UDF]='warehouse3Code'
    Save this three quires.
    and select warehouse1 to warehouse1 user user defaults, same for 2 and 3.
    Go to Approval Stage and Create New Select the user as Warehouse 1 user
    Create same for 2 and 3
    1. Create Approval template 1 with orginaters 2 and 3 warehouse users. and stages as approval stage1 where warehouse 1 user is selected.
    Documents as Inventry transfer document.
    Terms Click on when the following applies.
    Quirey name Select the quirey name as  quirey with 1st warehouse
    Create for second and third warehouse as same.
    It will work fine for approval in inventory transfer.
    Edited by: venkata siva reddy pole on Jul 24, 2008 4:49 PM

  • 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 data transfer !!

    i want to copy the data of source table say "A" into destination table say "B" ,,, and at the same time the data shud be
    deleted from that source table "A"
    what query should i use to solve above problem .

    Hi,
    Please post your question in the appropriate forum.
    SQL and PL/SQL
    PL/SQL
    Thanks,
    Hussein

  • BusinessObjectInfo.ObjectKey = "" for Inventory Transfer

    Hi everyone,
    I am using B1 2005A SP01 PL18
    I catch the FormData Event (et_FORM_DATA_ADD) on ActionSucces = True and have a look at the BusinessObjectInfo.ObjectKey but its value = "".
    I have also tried to use B1 Tool Event Logger to see if it has a value, but to no avail. Other objects
    like Service Calls have (Obj. Type=191; <?xml version="1.0" encoding="UTF-16" ?><ServiceCallParams><ServiceCallID>18</ServiceCallID></ServiceCallParams>) once the call has been succesfully added.
    I have used the same method for a number of other objects that I use, and it has worked well. Does any one know if this is a bug that has been sorted out in a higher patch perhaps or how I can get hold of that information other than using the
    Company.GetNewObjectCode.
    I really nee to get the XML parameters used to be able to use the GetByKeys method of the InventoryTransfers object.
    Your help would be greatly appreciated
    Regards
    Tinus

    Thanks for the answer Ad, however, I am unable to use the GetByKeys method if I dont have the XML, for instance if I use
    sStockTransferNo = "5"
    oStockTransfers.Browser.GetByKeys(sStockTransferNo)
    I receive "System.Runtime.InteropServices.COMException (0xFFFFFBA6): Xml file validation failed".
    Any ideas ?
    Thaks again for the previous answer.

  • Need Inventory transfer query with bIn location information

    Dear Team,
    Please help me to create the query for inventory transfers with bin location information.
    WTR19 field is empty so that i have checked with tables OINM,OILM,OBTL
    But how can i link this tables..?
    Regards
    Sanu.

    Dear AndakondaRamudu,
    In the mentioned link i had already checked .I need the item movement bin transactions report inventory transfer using a parameter with UDF..
    Regards
    Ajith

  • Inventory Transfer Report By WHS

    Hi,
    Can anybody help me to create a cutom Query for stock transfer report from one Warehouse to Another warehouse by range of dates with Value for each Inventory Transfer.
    Regards
    Sumanth

    Hello Sindhi,
    I would suggest you to use the stockprice field that contains the item cost of the item and multiply it by the qty.
    Please try this query and let me know if it helps you.
    SELECT sum (T0.[Quantity]*T0.[INMPrice]) FROM WTR1 T0  INNER JOIN OWTR T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[DocDate] between '01.01.10' and getdate()
    INMPrice is the item cost, quantity is the quantity on that row in the document. As you want the query to work for a date range I added the where.
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Inventory transfer two report preview

    Dear Experts,
    Kindly help me upon our problem. We are generating a report for inventory transfer using our customized report that is set on default. The problem arises when we are clicking the preview 2 Report are generated, one is from our customized rpt file then the other is from the system report for Batch number (pld) format.
    Below is the result screenshot for the said problem. Sorry for blurring some important data, for company privacy. Thank you so much for your great help.
    Best Regards,
    jza

    Hi ,
      Go To
    1.Administration-->System Initialization-->Print Preferences
    2.Print Preferences->Per Document-->Document-->Inventory Transfer
    3.When Batch/Serial No. Exist, Print-->Doument Only.
    -Rajesh N

Maybe you are looking for