QUERY FOR STOCK VALUATION

Folks
One of my client need a report as below..
*ITEMNO -- ITEMNAME-- O/S (in RS & QTY) --- PURCHASES  (in RS & QTY) -- ISSUES  (in RS & QTY) --- CLOSING STOCK  (in RS & QTY)*
It should have the provision to select DATEWISE.
Can anybody help me on this??
regards
KARTHIK

Hi Kartik,
Try the below query....
Declare @FromDate Datetime
Declare @ToDate Datetime
set @FromDate = '2005-01-01 00:00:00.000'
set @ToDate = '2011-01-01 00:00:00.000'
SELECT 
          T0.TransNum,
          T0.TransType,
          T0.CreatedBy,
          T0.BASE_REF,
          T0.DocDate,
          T0.DocDueDate,
          T0.CardCode,
          T0.CardName,
          T0.Ref1,
          T0.Ref2,           
          (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate  ),0)-
          isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0)) as [Opening Stock],
          T0.InQty,
          T0.OutQty,
    ((isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate  ),0)-
          isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0))+T0.InQty -T0.OutQty )AS [Closing Stock]
    FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode =T1.ItemCode LEft Outer Join OWHS T2 On T2.WhsCode =T0.Warehouse

Similar Messages

  • Change of material price for stock valuation

    Dear Ajay
    one bye-product material and its price is set as 80% of the FG value. My client simulated in Quality and the price is showing as 2300 but if He create the cost estimate in Production, it shows as 2100.   How to resolve this. Please show me in details whether to run MR21 for the bye-product or to do CKR1, or any other way, please whatever the process to do , explain in details. I always take your suggestion with deep knowledge and help and many times you solved my many issues.  This is required for stock valuation and Annual closing purpose.
    Regards
    mdas1810

    Hi,
    Its really difficult to say whats the reason.. Check the input prices in each client and also the activity rates also
    br, Ajay M

  • Re:Query for Stock Statement for a particular item..!!!!

    Dear SAP Experts,
    I need a stock statement query  for a particular item which contains:
    1.ItemCode
    2.Item Description
    3.Item Price
    4.Opening
    5.Receipts
    6.Issues
    7.Closing
    8. Value
    The selection criteria are:
    1.Warehouse code
    2.Item Name
    3.Posting Date
    Plz give me a good solution for this issue.
    With Regards,
    Revathy

    Check this
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    set @FromDate =
        (Select min(S0.Docdate) from OINM S0 where S0.Docdate >='[%0]')
    set @ToDate =
        (Select max(S1.Docdate) from OINM S1 where S1.Docdate <='[%1]')
    select * from
        SELECT T0.itemcode,
        min(T0.Dscription) as 'Item Description',
        min(B1.ItmsGrpNam) as 'Item Group', W1.Whscode, C1.Location,
        (isnull((
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate<@FromDate ),0)-
        isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate<@FromDate),0)
        ) as [Opening Stock],
        isnull((
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode
            and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate
            and O1.docdate<=@ToDate and O1.inqty>0
            and O1.transtype in (20,18)),0
        ) as [Purchase Quantity],
        isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate and O1.docdate<=@ToDate
            and O1.outqty>0 and O1.transtype in (21,19)),0
        ) as [Purchase Return Quantity],
       isnull((
            Select sum(isnull(outqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0
            and O1.transtype in (13,15)),0
        ) as [sale Quatity],
        (isnull
            Select sum(isnull(inqty,0))
            from OINM O1
            where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
            and O1.docdate<=@ToDate),0
            isnull((
                Select sum(isnull(outqty,0))
                from OINM O1
                where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
                and O1.docdate<=@ToDate),0)
        ) as [Closing Stock]
        FROM OINM T0
        INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
        INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
        INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod
        INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode
        INNER JOIN OLCT C1 ON W1.Location=C1.Code
        Group by T1.itemcode, T0.Itemcode, W1.WhsCode, C1.Location
    ) a
    where (a.[Opening Stock]
            +a.[Purchase Quantity]
            + a.[Purchase Return Quantity]
            +a.[sale Quatity]+a.[Closing Stock]
           ) !=0
    Regards,
    Bala

  • Actuals for stock valuated materials in a valuated project stock

    Hi friends!
    Iu2019m working with materials in the project, and we are going to do direct external procurement from the project. The material we are using are valuated stock and in the project I have valuated project stock.
    The requirements are that the vendor give us the material prices, and the material will not be consumed by the project(WBS/network). All the material will be collected to the special project stock until we decide to move the material to the unrestricted stock to be consumed by another department in the company. All the actual cost must follow-up in the project.
    This is what I do:
    From the project I create material components and I create the PO requisition I got the same price as in the project. Thatu2019s ok.
    When I convert the PO requisition to the PO I got no price but if I save I got the latest used price for the material and this could varied and it´s ok but should not work like this for this scenario.
    My doubts are when I do the goods receipt (MIGO) and the price of the material in the PO are not the same as the stock valuated price I got the difference as actuals in the project and the valuation of the material are in the project stock. If the price of the PO is the same as the valuation price I got no actuals in the project.
    When I register the invoice from the vendor (MIRO) I got no actuals either so I cannot do my project follow-up costs. When I check the cost they are in accounting (balance sheet account).
    When I do the material movement with 411Q to unrestricted stock I donu2019t get any actuals in the project either.
    Is this a normal behavior when using stock valuated materials in a valuated project stock?
    I SAP help I found this information for non valuated project stock:
    u201CAll the actual production costs appear in the project because no price variances can occur and all external procurement follow-up costs are debited to the WBS element.u201D
    But if the best practice is to use valuated project stock why follow-up costs cannot be done in the project?
    Please give me some ideas of this,
    Best regards
    Jose Marin

    If the mateiral was created using the no stock material material type then yes you can see this material in MM60.  Search using material type 'NLAG' for non stock. 
    Regards,

  • Query for stocks on hand

    I would like to know if it is possible to create a query that would display the stocks of all items on a specific date and will display the item cost or the purchase price of each item in stock. Let say for example, today is January 14, 2010. I would like to check how many stocks in my inventory last January 8, 2010. Does anybody knows how to create this?
    Thank you.

    Hi Don Elicor,
    Check the below thread, you will be get some idea or Solution.
    Inventory Report by Query
    Query for Inventory Activity for whse & dates
    Item Stock Report
    Item Stock Report
    Regards,
    Madhan.

  • Query for Stock Tranfer Mov-311

    Dear Experts,
    I want to make a query to know value of stock transfer from one storage location to another on certain date or from x date to y date. In MB51 there is no value appears, as there is no financial transaction.
    I am preparing query using SQVI, one table I have selected MSEG which other table I select so that value apprears.
    My company requirement is this, they want how much material in terms of quantity and value has been transffered from RM Store to WIP Store.
    Regards
    GR

    Hi G R,
    see below table data's from MM60
    MARA - Material master
    MAKT - Material text
    MARC - Material per plant / stock
    MARD - Storage location / stock
    MSEW - Material Valuation
    MARM - Units of Measure for Material
    Regards,
    Sankaran

  • Query for Stock Statement

    Hi Members,
    My customer needs an report "Stock Statement" with selection criteria as Date, ItemGroupwise and warehouse wise with following columns namely.
    Itemcode
    ItemName
    Opening Stock Qty
    Receipt Qty
    Issue Qty.
    Price.
    Kindly help me in this regard,
    Thanks in advance,
    Venkatesh.R

    Hi!
    Check these threads
    Re: Item Stock Report (2nd page)
    Item Stock Report

  • Stock valuation down to Storage location level

    Dear all,
    System setup for stock valuation is till Plant level. And understand that's how data stored in table MBEW and MBEWH until plant level only.
    Eventhough that is system standrd, is that possible to get the stock valuation until Storage location level?
    For eg: In MB5B, there is opening stock, closing stock and the material movement posting. I need to get opening and closing stock for each storage location.
    Could you please comment if there are tables store these data? Kindly comment.

    Hi Afshad Irani,
    Thanks for your reply. Understand from the previous post that stock valuation for storage location can be done via table MARDH or report MC.9, but this tools are excess base on period/month basis.
    My case, i need to report storage location stock for both (1)last month 06.2010 and (2)yesterday's stock 06.07.2010. So i can use MARDH table to report (1)last month stock for each storage location. While for (2) yesterday stock, table MARDH isn't help.
    Could you please advice further?

  • Stock valuation different for different storage location in same plant

    Hi SAP Gurus,
    Please provide me a detailed idea and solution for this.
    My client has simulated several transactions in MM.
    Say it has two storage location 1110 and 1120 under plant 1100
    Now in 1120 there are stock movements pertaing to a project (includes stock transafers from 1110 and issues made to project)
    Finally, the MB52 report is showing valuation of stock (unrestricted) at different rates for 1110 and 1120.
    My client is raising issue, saying the value should be same for stock under a single plant as valuation is done at plant level.
    Also, both the stock is under unrestricted category, so valuation should be same.
    What could be the issue?
    Any solution?
    The auditors will raise issue over this.
    Please help ASAP.
    Regards,
    Sumit

    Hi Sumit,
    In valuation using the moving average price (price control u201CVu201D), the system valuates goods receipts with the purchase order price and goods issues with the current moving average price.
    So, for Plant 1110 the rate could be the PO price used for procuring the material whereas for Plant 1120, it is the moving average price and hence the difference in rates.
    However the auditors would look after the Material Valuation at the Valuation Area level which is the Plant.
    Thanks,
    Ankur

  • Stock Transport for Non Valuated Account Assigned Material

    Hi Experts,
    I have to satisfy some unique requirement from my demanding FICO team to make certain process work our way.
    Following is the scenario...
    1. Plant A and plant B belongs to the same company.
    2. Plant A makes material X (non valuated, ind/coll indicator = 1).
    3. X calls for sub-assembly Y (non valuated, ind/coll indicator = 1) which is a make item in plant B. <b>X and Y belongs to different Profit Centers</b>
    4. Sales order placed at plant A for material X.
    5. MRP runs and creates a stock transport order in plant A to buy the non valuated material Y from plant B. STO is account assigned to the sales order.
    6. Plant B makes the material Y by creating a production order that is account assigned to the same sales order and does PGI to ships it out to plant A.
    7. Plant A GRs the material Y and this puts it in sales order stock. No value move, just qty move. Also no FI document created.
    8. Plant A issues component Y to the production order created for material X. Cost of Y doesn't show up in the production order as it is non valuated.
    9. Upon settlement of the production order in Plant B, the <b>ACTUAL</b> cost gets settled to the sales order in plant A. So at the time of settlement the <b>profit center switch happens for Y (i.e. the profit center for Y changes to match X's profit center)</b>
    This is a beautiful process from logistics point of view. BUT, my FICO has unique requirement for inter company sales for our organization. For them to consider a process as inter company sales, the following constraints has to be met...
    <b>1. Ownership of material remains with producing profit center until consumption by the receiving object. (with the above mentioned process the profit center switch happens during prod. order settlement)
    2. Cost for the consuming profit center will be moving average, standard cost or planned cost. (we are dealing with non-valuated materials and the settlement happens at actual cost)</b>
    I need your expertise to help me define a work aroud. I am thinking about a lot of options to somehow make it work but can't seem to get solutions. Following are my thoughts...
    1. Is it possible to possible to make the settlement with planned cost instead of actual cost?
    2. Is it possible to make a profit center switch during consumption rather during settlement?
    3. Is it somehow possible to create an underlying FI document during GR at plant A? (I know SAP does not create a FI doc. for non valuated materials).
    4. Or can plant B send an invoice to plant A for the STO? (I believe this can be done for cross-company STO) I am thinking doing an Invoice Receipt at plant A instead of doing a settlement might show up the cost for Y in the production order for X.
    An IR with the planned cost would be an awesome solution to get the buy-in from FICO. Can this be done?
    I hope you don't mind my lengthy message... Waiting for some positive response.
    Thanks.

    Anyone??? This is kinda urgent?

  • Query for Price difference account when item is not sold but not on stock

    Hi Experts!
    One of my clients accountant requires a report which will help for what to do with the balance of the price difference account.
    At the and of the year there are some postings on this account, but not every item that hadnt been on stock when A/P Invoice arrived were sold. Some item were waistrel and put into a waistrel warehouse, but not sold.Some item were sent back to the supplier, but not sold.
    Is it possibble to make a query for knowing where to post the balance of the price difference account? Not all should be post to the Cost of goods sold.
    Thank you in advance!

    Hi,
    The query is possible.  However, it is a complicated one. It is also need to involve detailed analysis to your transaction histories.  You may start from OINM table to check.
    Thanks,
    Gordon

  • Stock of material and moving average price for each valuation type

    Hi
    Is anybody aware of any standard report which will show the stock of material and moving average price of the material for each valuation type.
    M5BL is one report but would like to check if there is any other report.
    Regards
    Vaibhav Mahajan

    Hi,
    Check MB52, select 'Display batch stock' option.
    Batch is nothing but your valuation type.
    You can see those details there.
    Regards,
    Piyush

  • Query  for  Closing Stock goes beyond a particular value.

    Hi,
    The query for the following requirement:
    The Closing Stock goes beyond a particular value. The Closing Value of items crosses the pre-defined value.

    Hi,
    Yes it is related to the user selected date and stock level. Not answered Closing the thread.
    Edited by: Neela M B on Aug 28, 2010 3:08 PM

  • Stock Transport Order for non valuated material

    Hello,
    I am creating a Stock Transport Order for non-valuated material. I posted GI for STO mvt 351 and it decreases stock from issuing Storage Location, however when I am posting GR for STO mvt 101 the Storage Location field is not there in MIGO and after posting the quantity does not increase in receiving Storage Location which is not expected. Note that both issuing and receiving Plants are the same and the material type has quantity update in the Plant.
    Also in the STO the system is asking for Account Assignment Category which I do not need because there are no transportation costs. Can i overcome that ?
    Thanks,
    Wael

    Hi,
    The quantity update is set for the material type in the plant as I mentioned. Also since both issuing and receiving plants are identical and there is stock in the issuing SLoc this means quantity update is active.
    Thanks

  • Mov type for non valuated stocks

    hi friends
    please give movement type for non valuated stock items((material type)
    points will be assigned
    thanks in advance

    Movement Type defines a material movement. For what type of Material Movement do you require the movement type?
    Also, is there a reason why this should be different from that for a valuated material?
    Cheers.

Maybe you are looking for

  • Missing Plug-in Mail

    I'm having trouble sending a photo with my emails. It keeps saying Missing Plug-In when the email is sent from Mac Mail. I'm running Mountain Lion currently. I've also tried the Java Setting reset but it didnt help. Thanks

  • Iphone 5C setting appointments in GMT time zone, not my time zone

    Why is my iPhone 5C now recording my calendar appointments in GMT time, not my time zone. I started happening a few weeks ago. I just updated the iOS to version 8.1.2 and it is still happening. Any suggestions?

  • Why does my device not work as well anymore

    It's been quite some time since this device worked properly and consistently.  The GSM module is affixed to a window pane with all blue LEDs.  Occasionally, one or more may turn red and I'll have to reboot the device.  But even when it's up, my signa

  • Flash acceleration, doest it work for other flash content than video?

    Hi guys, I'm having issues with Flash using lots of CPU on Citrix servers. I've got 8 servers in one farm, almost all of then between dual-quad core intel CPUs. The problem is that various sites the users browse are flash based, not video related but

  • Can not install demo PRESIDENTIAL INAUGURAL ADDRESSES

    Hi friends, Whats the pre-requesite of installing the above demo pls? I got error ORA-20001 ...ENGLISH preferences loaded for Oracle Text. Thanks