Inventory Transfer Query

hello all,
I 'm trying to write a sql that gives me the items transferred between subinventories. so far i have this sql:
select
distinct mmt.TRANSACTION_ID
,mmt.TRANSACTION_DATE
--,mmt.TRANSACTION_TYPE_ID
--,mtt.TRANSACTION_TYPE_NAME
,mmt.INVENTORY_ITEM_ID
,msi.DESCRIPTION
,mmt.ORGANIZATION_ID
,mmt.SUBINVENTORY_CODE
,mmt.LOCATOR_ID
,mil.SEGMENT1
,mil.SEGMENT2
,mil.SEGMENT3
,mil.SEGMENT4
,mmt.TRANSACTION_QUANTITY
,mmt.TRANSACTION_UOM
,mmt.ACTUAL_COST
,mmt.TRANSFER_TRANSACTION_ID
,mmt.TRANSACTION_SET_ID
,mmt.RCV_TRANSACTION_ID
,mmt.TRANSFER_ORGANIZATION_ID
,mmt.TRANSFER_SUBINVENTORY
,mmt.TRANSFER_LOCATOR_ID
from
mtl_material_transactions mmt
,MTL_SYSTEM_ITEMS_B msi
,MTL_ITEM_LOCATIONS mil
,MTL_TRANSACTION_TYPES mtt
where
mmt.INVENTORY_ITEM_ID(+) = msi.INVENTORY_ITEM_ID
and mmt.LOCATOR_ID=mil.INVENTORY_LOCATION_ID(+)
--mmt.TRANSFER_LOCATOR_ID=mil.INVENTORY_LOCATION_ID
and mmt.TRANSACTION_TYPE_ID=mtt.TRANSACTION_TYPE_ID(+)
and mmt.TRANSACTION_QUANTITY <= 0
--and mmt.SUBINVENTORY_CODE='yy'
--and mmt.TRANSFER_SUBINVENTORY='xx'
my problem is with the columns :mmt.LOCATOR_ID,mmt.TRANSFER_LOCATOR_ID and ,mil.SEGMENT1
,mil.SEGMENT2
,mil.SEGMENT3
,mil.SEGMENT4
as mmt.LOCATOR_ID is the locator transferred from and mmt.TRANSFER_LOCATOR_ID is used as the locator transferred to , the other columns are used to describe the locator segments,
the query above works fine for the mmt.LOCATOR_ID column and the segments also appear in the output. My poblem is with the mmt.TRANSFER_LOCATOR_ID column I didn't succeed to show it in my query correctly and when i tried putting them in two different queries and made a union between them the mmt.TRANSFER_LOCATOR_ID query didn't show me the segments when the the field is not nill.
I need also to differentiate between the segments columns when i use them for mmt.TRANSFER_LOCATOR_ID and mmt.LOCATOR_ID in order that i can map them to the report template.
Can u please help me....

I'm working on two tables:
MTL_MATERIAL_TRANSACTIONS & MTL_ITEM_LOCATIONS
i want the following columns from MTL_MATERIAL_TRANSACTIONS:
* TRANSACTION_ID (PK) NOT NULL NUMBER
* LOCATOR_ID NULL NUMBER Locator id for stock locators
* TRANSFER_LOCATOR_ID NULL NUMBER Transfer transaction opposing
locator id
and the following columns from MTL_ITEM_LOCATIONS:
* SEGMENT1
* SEGMENT2
* SEGMENT3
* SEGMENT4
where
MTL_ITEM_LOCATIONS is the primary key table with INVENTORY_LOCATION_ID & ORGANIZATION_ID is the primary key column and LOCATOR_ID & ORGANIZATION_ID is the Foregn key column.
I need my report output be like:
location from:
LOCATOR_ID,SEGMENT1, SEGMENT2, SEGMENT3, SEGMENT4
Location to:
TRANSFER_LOCATOR_ID,SEGMENT1, SEGMENT2, SEGMENT3, SEGMENT4
where the above "location to" may represent one or more records from the joined query.
How can I prepare the sql query.

Similar Messages

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

    Hi experts
    Stock Transfer on DEMO basis(Goods send on Demo and Retrun to office after Demo completes ) In customer Wise Reports
    Our solution:
    we  have created 2 warehouse .
    1. physical warehouse.
    2.demo warehouse.
    we are using  "Inventory Transfer"
    but  our client 
    asking Reports is
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Header 7
    Header 8
    Header 9
    Doc number
    customer Name
    Item Name
    warehouse2
    warehouse1
    DEMO Date
    Item Return Date
    Remarks

    Hi,
    Try this query with batch number:
    SELECT T0.[DocNum], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T4.[DistNumber],  case when T0.[Filler] = 'open' then T0.[DocDate] end as 'Sent date', case when T0.[Filler] = 'REJ_FG' then T0.[DocDate] end as 'Returned date' ,  T0.[Filler] as 'Warehouse 1', T1.[WhsCode] as 'Warehouse 2' FROM OWTR T0  INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry left join  OITL T2 on t1.docentry = T2.[ApplyEntry] and  T1.[LineNum]  = T2.[ApplyLine] and T2.[ApplyType] = 67 INNER JOIN ITL1 T3 ON T2.LogEntry = T3.LogEntry left join  OBTN T4 on T4.[ItemCode]  =  T3.[ItemCode]  and T3.[MdAbsEntry]  =  t4.[absentry] WHERE T0.[CardCode] = [%0] GROUP BY T0.[DocNum], T0.[DocDate], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T4.[DistNumber], T0.[Filler], T1.[WhsCode]
    Thanks & Regards,
    Nagarajan

  • Query to Lookup Ship To in a UDF for the Inventory Transfer

    Good Day Experts!
    I created a UDF for the Ship To Code in the Inventory Transfer Window.  The problem is I do not know how to create a query to be used in the Formatted Search for this UDF wherein it will lookup all the Ship To Codes in the table CRD1 of that particular  Customer selected in the Inventory Transfer window.  The objective is to choose a Ship to code just like in the sales document.
    My next problem would be how to display automatically the whole Ship To Address in another UDF based on the Ship To Code chosen in the UDF Ship To Code.
    Your inputs would be highly appreciated.
    Regards,
    Jen

    To get the Complete ShipTO Address, use the following Code
    SELECT T0.cardname+CHAR(13)+isnull(T0.Address,'')+CHAR(13)+
    cast(T0.Building as varchar(100))+CHAR(13)+isnull(T0.city,'')+CHAR(13)
    +isnull(T0.zipcode,'') as Address FROM CRD1 T0
    WHERE T0.CardCode =$[OWTR.CardCode] and  T0.cardtype='S' and
    T0.Address=$[OWTR.UDF1]
    Here Replace UDF1 with the Name of the UDF in which Shipto Address Names are shown as per my previous post.
    Hope you understand

  • 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

  • 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

  • FMS for auto populating itemcodes in detail grid of Inventory Transfer

    Hi All,
    Could anyone please give me the query for Formatted search to populate item codes in the detail grid of 'Inventory Transfer' automatically based on Production Order details, by selecting a 'Production Order No.' in a UDF in Inventory Transfer entry.
    I had tried the following FMS Query :
    Declare @LineNum Int
    Declare @ProdNo Varchar(10)
    Declare @ItemNo Varchar(40)
    Set @LineNum = $[$23.0.62]
    Set @ProdNo = $[OWTR.U_ProdOrderNo]
    Set @ItemNo = (Select WOR1.itemcode  From OWOR Inner Join WOR1 on OWOR.DocEntry = WOR1.DocEntry 
    And OWOR.DocNum = @ProdNo and WOR1.VisOrder = @LineNum - 1 )                 
    Select @ItemNo
    But user has to manually click on the itemcode FMS icon on each and every row to set the itemcode in that particular row.
    Can all the itemcodes get populated in 1 go just by selecting the Production Order No ?
    Thanks,
    William

    Hi William,
    You can also use the shortcut key Shift+Alt+F2 to open User Defined Table as specified by Nagarajan.
    Please check following link too
    Working with User Defined Values in SAP Business One | Packt Publishing
    Regards
    JO

  • 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

  • Batch No Variable in Inventory Transfer

    Dear Experts,
        I am trying to design a PLD with Inventory transfer screen. I need to capture the Batch Nos of the items transferred. I am unable to find the field name (or) system variable of Batch Nos. How can I find the system variable nos of Batch master data? I use SAP Business One 8.8 PL 10. Thanks in advance.
    Regards,
    Madhavan

    HI
    execut  Query In MSSQL it'll show u the field name....
    Edited by: Prabhakar G on Aug 13, 2010 10:22 AM

  • Problems with Draft - Inventory Transfer - SDK 2007

    Hi all, I have problems making a Draft document of a Inventory Transfer using the DIAPI, I know that the draft of inventory transfers is new in SBO 2007 and I have the correct version of the DIAPI installed, the problem is that I can't find the property "FromWarehouse", into the Draft Object.
    Thanks for help.

    Note that the header of this forum specifies:
    This forum is dedicated to development and deployment of .Net applications that connect and interact with BusinessObjects Enterprise, BusinessObjects Edge, or Crystal Reports Server. This includes the development of applications using the BusinessObjects Enterprise, Report Application Server, Report Engine, and Web Services SDKs.
    I do not think your query concerns any of the above mentioned products? If that is the case, please post to the correct forum.
    Ludek

  • Field integration between Inventory Transfer and Sales Order?

    Dear Gurus,
    Hope to find you well, we have to redefine our processes of sales. Now stock from a remote site will be transferred to inventory in transit warehouse recorded. Truck Number(UDF) and Document Number  (Inventory Transfer) will be used to trace inventory status and creating Crystal Reporting from Stock Uploading till the A/R Invoice are created. My Query is how can this be achieved in SAP B1 2007 A Patch 10. Please advice. Its very important for us.
    Please find trail that will help you understand:
    Process Mapping Help Needed
    Faisal
    Edited by: Faisal Baloch on Nov 17, 2011 7:02 AM

    Dear Faisal,
    Unlike the higher package, B1 has no option to link between Inventory Transfer and Sales Order. You have to add UDF and manually maintain the link.
    Thanks,
    Gordon

  • Approval procedure to check and pop up alert when Inventory transfer

    HI Experts,
    I want to do an approval procedure to check and pop up alert when Inventory transfer To warehouse 01 by Query.how to query for the following statement in Approval Procedure?
    Regards,

    Hi,
    This query is also used in the approval procedure of inventory transfer created:
    if (SELECT $[$5.1.0]) = '01'
    select 'true'
    it will gives alert after document approved or requesting approval.
    Rgds,

  • 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

  • Error while posting report in inventory transfer from draft

    hi, 
             we have entered all the details in inventory transfer at the row level.Due to editing purpose we have saved it as draft.but now while posting the document it displayed the error as "No Matching records found".
    ca anybody tell what is the reason????
    regards priya

    Hi Priya,
    Please go through note 1112941
    https://service.sap.com/sap/support/notes/1112941
    If itu2019s not the case, please help collect error in detail.
    Hope it helps.
    Regards,
    Jacqueline Jiang
    SAP Business One Forums Team

  • Sales Order/A/R Reserve Invoice & Inventory Transfer

    Hi
    Suppose I have 2 warehouses A and B. A has 3 units of a particular good and B has 6 units of that same good.
    I understand that if I want to create an A/R invoice for a sale of 7 units of the good, I have to transfer 1 unit from A to B or 4 units from B to A before the tax invoice can be created. Does this requirement to have the stocks in one warehouse also apply to an A/R reserve invoice? Can I create an A/R reserve invoice for 7 units of the good before the transfer is performed?
    My second question is this.
    A sales quotation may be created when the required goods are in different warehouses. Can I create a sales order with the required goods still in different warehouses?
    Thank you for your patience with my questions as I am new to SAP B1 and do not have access to a test system at the moment.

    Hi,
    Only Delivery or normal invoices are related to inventory. For Sales Order/A/R Reserve Invoice, you do not need Inventory Transfer.
    Thanks,
    Gordon

Maybe you are looking for