Calculating opening and closing stocks at a plant (on specific dates)

Hi,
I am to develop an ABAP-report. On the selection screen, I'll have plant, material, and a date range (date_1 and date_2). The report should show opening stock on date_1, closing stock on date_2, and then there is more segregation based on movement types (along with both stock-quantity and stock-value). I am stuck at how-to's around calculating opening (and closing) stock on a particular date.
Secondly, transaction MB5B has 3 options : batch stock, valuated stock, special stock ... One of these options uses table MBEW and other uses table MARD ... Which (all) tables will I need to use so as to get both stock-quantities and stock-values ?
Please advise. Thank you.
Regards,

Hi
for second question answer is
you need to consider all batch stock, valuated stock, special stock ... One of these options uses table MBEW and other uses table MARD to get both stock-quantities and stock-values
hope it helps
Edited by: ppkk on Dec 10, 2008 10:58 AM

Similar Messages

  • Opening and closing Stock report at Storage location level- date wise

    Dear all
    Is there any standard report to view opening and closing stock at storage location level? ( we have MB5B which resets the entry screen if we enter SLOC details).
    Thanks
    Sam

    Do  I have the option of  selecting Storage Location wise opening and closing stock on a particular date or period, that is what I have requested? Is it possible, evenafter selecting storageloc/batch stock and entering all the SLOCs in the selection creen, the report output does not contain any SLOC, and using ctrl+F8 or display variant does not have SLOC as a field also.
    pls gudie
    sam

  • Opening and closing stock at storage location level

    Dear all
    I need a std report which will give the opening and closing stock at storage location level, Or should I go for dev. if yes please guide me.
    Regards
    Samuel

    Hi,
    check if you can use S_P00_07000139 report, select "Display stock movement by plant (with amount) and further select Sloc from layout.
    Regards,
    Vikas

  • Material opening and closing stock for a given day- Tables or FM

    Dear Friends
             i have to make a report  , related to Material opening and closing stock for a given day  , i check the T-Code- MB5B ,
    it is not giving correct date . is any functional module is available  ? . i checked some table like mbew , mard . it is also not giving correct requirement . Please help

    Hi
    Goto transaction MC.9, Give your Material and,Plant and the date which you need to know the closing stock. Do make sure that in the high and low values you are giving the same date there. I guess no such FM are available for this. You can refer the  [Link|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=15856]  for some help.
    Regards
    Vinodh
    Edited by: Vinodh_AN on Dec 15, 2010 9:19 AM
    Edited by: Vinodh_AN on Dec 15, 2010 9:25 AM

  • Opening and closing stock report

    Hi,
    i have to develop  a report in abap of stock (Opening and closing stock) with each material, plant, business area & monthly date wise. I got some fields from mseg like material number, plant, business area but i didnt get fileds like opening stock, purchase, consumption & closing stock
    in report fileds should be like
    material number
    plant
    business area
    posting date
    opening stock
    purchase
    consumption
    closing stock
    kinldy help <removed by moderator>
    Moderator message: Welcome to SCN!
    Moderator message: please search for available information, ask a functional consultant near you.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|Asking Good Questions in the SCN Discussion Spaces will help you get Good Answers]
    Edited by: Thomas Zloch on Nov 21, 2011 3:35 PM

    Yes umesh from external 99% of your stock from mvt 101, 501 is very rare case & 561 is not from external source it is initial stock updation which will be done only once when you are going live & later 561 mvt will be normally blocked for use.
    You can also sort in MB5B more than one movement type click on multiple selection (that is on yellow arrow icon) & in single value tab enter mvt 101 below that 501.
    This will give you report for mvt types 101 & 501 in this way you can also sort reports for more than one mvt type.
    Regards
    Rang
    Message was edited by:
            Ranganath Mysore

  • Functional Specification For Opening And closing stock On Particular Date

    Dear Gurus,
    I am creating report for opening and closing stock on particular date in which batch and storage location should also be included. I want to know the tables and fields for the same.I have searched the forum and got report on month basis but I want this report on posting day basis.kindly suggest tables and fields. Thanks in Advance

    Dear sir,
    There are many other colums that client wants to add which are not present in MB5B transaction.columns which client wants to add are as follows...
    Material Number                                                   
    Material Description                                       
    Material Type                                                                        
    Material Group                                                                     
    External material Group                                                            
    Movement Type     
    Plant     
    Storage Location     
    Customer Number     
    Customer Name     
    Vendor Number     
    Vendor Name     
    Posting Date     Receipt Doc. Number
    Issue Doc. Number     
    Reference Issue Document Number     
    Opening Stock Quanity     
    Material Receipt Quantity     
    Material Issue Quantity     
    Material Closing Stock Quantity      
    Value Of Closing Stock
    And for this I want  tables and logic for the same. kindly provide the solution for the same.

  • Opening and Closing Stock -Calendar Day Interval

    Dear All,
                Regards.I got a requirement where I need to calculate the Opening and Closing stock -Daywise..Did checked the related threads which stated to create 2 Restricted KF's upon Calmonth.Hence i tried the same replacing Calmonth with Calday,but those 2 Restricted KF's are empty at the Query output level!!!!!!!!(Note : 0TotalQtystock shows the Closing stock by default)..It would be really helpful if someone could take time to update on this..
    Manythanks
    Arun

    Hi,
    Stock key figures are normally set to calculate closing stock with respect to time. e.g. day end stock, week end stock, month end stock.
    To calculate Opening balance -
    1. create a new calculated KF on your stock key figure with no calculations.
    2. Set  exception aggregation as "First Value" for this calculated key figure in the query definition.
    3. Use this calculated key figure instead of main key figure.
    This setting works for all the time characteristics present in the cube.
    Regards,
    Anup

  • Calculate Opening and Closing Stock

    Hi all,
          Plz tell me logic how to calculate Opening Stock and Closing Stock of material of any particular date of month...........
    Thanks in Advance.
    Pradip Pawar

    Hi Pradeep
    for a particular month for calculating opening stock is
    use this logic
            SELECT MBLNR BWART ZEILE MATNR WERKS LGORT SHKZG ERFMG ERFME
           FROM MSEG INTO CORRESPONDING FIELDS OF TABLE IT_QUAN FOR
              ALL ENTRIES IN IT_FINAL WHERE MATNR = IT_FINAL-MATNR.
      IF IT_QUAN[] IS NOT INITIAL.
    GETTING THE MATERIAL DOCUMENTS FOR SPECIFIED PERIOD
          SELECT MBLNR BUDAT FROM MKPF
                     INTO CORRESPONDING FIELDS OF TABLE IT_BUDAT
                     FOR ALL ENTRIES IN IT_QUAN
                     WHERE ( BUDAT GE DATE1 AND BUDAT LT DATE2 )
                     AND MBLNR = IT_QUAN-MBLNR.
          SELECT MBLNR BUDAT FROM MKPF
                     INTO CORRESPONDING FIELDS OF TABLE IT_BUDAT1
                     FOR ALL ENTRIES IN IT_QUAN
                     WHERE MBLNR = IT_QUAN-MBLNR
                     AND BUDAT LT DATE1.
        ENDIF.
        CLEAR INDEX.
    IF THE MATERIAL DOCUMENT NUMBER IS NOT FOUND IN THE SPECIFIED PERIOD
    *REMOVE IT
        IT_QUAN1[] = IT_QUAN[].
        LOOP AT IT_QUAN.
          INDEX = SY-TABIX.
          READ TABLE IT_BUDAT WITH KEY MBLNR = IT_QUAN-MBLNR.
          IF SY-SUBRC NE 0.
            DELETE IT_QUAN INDEX INDEX.
          ENDIF.
          CLEAR IT_QUAN.
          CLEAR IT_BUDAT.
        ENDLOOP.
        SORT IT_QUAN BY MATNR.
        LOOP AT IT_FINAL.
          INDEX = SY-TABIX.
          LOOP AT IT_QUAN WHERE MATNR = IT_FINAL-MATNR
                            AND WERKS = IT_FINAL-WERKS
                            AND LGORT = IT_FINAL-LGORT.
            IF SY-SUBRC = 0.
    IF IT IS IN CALCULATE QUANTITY
              IF IT_QUAN-SHKZG = 'S'.
    check the unit if it is gram then devide by 1000.
                IF IT_QUAN-ERFME = 'G'.
                  IT_QUAN-ERFMG = IT_QUAN-ERFMG / 1000.
                ENDIF.
                IN_QTY = IN_QTY + IT_QUAN-ERFMG.
              ENDIF.
    IF IT IS OUT CALCULATE QUANTITY
              IF IT_QUAN-SHKZG = 'H'.
                IF IT_QUAN-ERFME = 'G'.
                  IT_QUAN-ERFMG = IT_QUAN-ERFMG / 1000.
                ENDIF.
                OUT_QTY = OUT_QTY + IT_QUAN-ERFMG.
              ENDIF.
            ENDIF.
          ENDLOOP.
          IT_FINAL-IN = IN_QTY.
          IT_FINAL-OUT = OUT_QTY.
          MODIFY IT_FINAL INDEX INDEX.
          CLEAR: IN_QTY,OUT_QTY.
          CLEAR IT_FINAL.
          CLEAR IT_QUAN.
          CLEAR INDEX.
        ENDLOOP.
        CLEAR: IN_QTY,OUT_QTY.
        CLEAR IT_FINAL.
        CLEAR IT_QUAN.
        CLEAR INDEX.
    FOR OPENING BALANCE
        CLEAR INDEX.
        LOOP AT IT_QUAN1.
          INDEX = SY-TABIX.
          READ TABLE IT_BUDAT1 WITH KEY MBLNR = IT_QUAN1-MBLNR.
          IF SY-SUBRC NE 0.
            DELETE IT_QUAN1 INDEX INDEX.
          ENDIF.
          CLEAR IT_QUAN1.
          CLEAR IT_BUDAT1.
        ENDLOOP.
        SORT IT_QUAN1 BY MATNR.
        LOOP AT IT_FINAL.
          INDEX = SY-TABIX.
          LOOP AT IT_QUAN1 WHERE MATNR = IT_FINAL-MATNR
                            AND WERKS = IT_FINAL-WERKS
                            AND LGORT = IT_FINAL-LGORT.
            IF SY-SUBRC = 0.
    IF IT IS IN CALCULATE QUANTITY
              IF IT_QUAN1-SHKZG = 'S'.
                IF IT_QUAN1-ERFME = 'G'.
                  IT_QUAN1-ERFMG = IT_QUAN1-ERFMG / 1000.
                ENDIF.
                IN_QTY = IN_QTY + IT_QUAN1-ERFMG.
              ENDIF.
    IF IT IS OUT CALCULATE QUANTITY
              IF IT_QUAN1-SHKZG = 'H'.
                IF IT_QUAN1-ERFME = 'G'.
                  IT_QUAN1-ERFMG = IT_QUAN1-ERFMG / 1000.
                ENDIF.
                OUT_QTY = OUT_QTY + IT_QUAN1-ERFMG.
              ENDIF.
            ENDIF.
          ENDLOOP.
          OPEN_QUAN = IN_QTY - OUT_QTY.
          IT_FINAL-OPEN_QUAN = OPEN_QUAN.
          MODIFY IT_FINAL INDEX INDEX.
          CLEAR: IN_QTY,OUT_QTY.
          CLEAR IT_FINAL.
          CLEAR IT_QUAN1.
          CLEAR OPEN_QUAN.
          CLEAR INDEX.
        ENDLOOP.
        LOOP AT IT_FINAL.
          IT_FINAL-CLOS_QUAN = IT_FINAL-OPEN_QUAN +
                                       IT_FINAL-IN - IT_FINAL-OUT.
          MODIFY IT_FINAL INDEX SY-TABIX.
          CLEAR IT_FINAL.
        ENDLOOP.
    reward points to all helpful answers
    kiran.M

  • Opening and closing stock from mb5b

    Hi Experts
    I am writing a code which will display goods reciept, issue, transfer, etc according to movement type .
    I have done the coding but the problem is I am not getting the opening stock by period , I want to get sum (lbkum)  sum (salk3) into some formulae column .. I want to get the sum of lbkum from mbewh joining mseg,mkpf  as period -1
    ie if I select 04.03.2009 , I want the sum of stock from mbewh based on period -1 . so what formale I have to write
    to get the opening stock on the date selected . The date range is selected from mkpf .
    I want to get stock on whatever date selected from mkpf.
    SELECT SINGLE * FROM mardh
    WHERE matnr = p_matnr
    AND werks = p_werks
    AND lfmon = p_buper
    AND lfgja = p_gjahr.
    Regards
    Piroz

    you can get all data using MC.9 report
    here you can get opening and closing stock with values based on material, plant, storage location
    Kindly make sure while giving period
    here it will take period in month and year i.e if you want opening stock for April then you have to give it as 03.2008 to 03.2008 and closing as 04.2008 to 04.2008
    Regards
    Edited by: WISH on Apr 23, 2008 1:15 PM

  • How to find opening or closing stock for a plant

    hi experts,
                    can u help me to know is there any function module to know the opening and closing stocks of plant for particular period per each material type. Or the way to follow to find it

    Hi Kiran,
    You would like to findout opening and closing stock of a particular period and of a particular period....
    If we would like to findout opening and closing stock of material A as of 18 / 8 / 2008,
    then do like this.
    go to MBEW table .. there u get opening stock as on today. Today the date is 20/8/2008. from today's opening stock if we add / subtract the movements which have happened on 19/8/2008 and 18/8/2008 u'll get opening and closing stock as on 18/8/2008.
    U get the movements from MKPF ( material doc header) and MSEG (material doc item ) based on posting date. In MSEG u get movement type.
    If the movement type is 101, it means the stock is added.
    If the movement type is 102, it means the added stock is reversed.
    from today's opening stock deduct the stock with moverment type 101 and add the stock with movement type 102.
    This will give u opening stock as on 18/8/2008.
    To get closing stock of 18/8/2008 ..... the opening stock of 19/8/2008 is 18/8/2008's closing stock.

  • MB5B Report table for Open and Closing stock on date wise

    Hi Frds,
    I am trying get values of Open and Closing stock on date wise form the Table MARD and MBEW -Material Valuation but it does not match with MB5B reports,
    Could anyone suggest correct table to fetch the values Open and Closing stock on date wise for MB5B reports.
    Thanks
    Mohan M

    Hi,
    Please check the below links...
    Query for Opening And  Closing Stock
    Inventory Opening and Closing Stock
    open stock and closing stock
    Kuber

  • Opening and closing stock balances

    Hi
    What report can i use to show the opening and closing stock balances of materials for the last 12 months.
    Thanks
    Vinesh

    You can view the report in MMBE.
    other than this you can try
    MBEWH and MARDH
    Also follow the link:
    Re: op.& closing stock detail in MM
    Thanks
    Nisha

  • Material wise reciept and Issue report with Opening and Closing Stock

    Hi
    I need a report,Material wise Receipt and issue with Opening and Closing stock.Is there any standard report available in SAP ?
    Or we have to go for Customised Report.
    Please reply

    Hi,
    MB5B gives total receipts - if i click on the receipts i can view the multiple material documents - BUT is there any way to drill down the reciepts or view the breakup of the receipts on the same screen OR is there any other report for this.
    Regards,
    Laxmi

  • Inventory opening and closing stock with value report

    Hi All,
    Is it possible to get details of both opening and closing stock with value of each items of last financial year (2009-10) in inventory report?
    Mizan

    Hi..
    you can  try this query
    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,
    Bhavank

  • Table name for opening and closing stock

    Hi gurus,
    i want table name for opening and closing stock .  How to calculate this opening and closing stock in report.
    Murali.

    Murali,
    Check out in OINM, which maintains all the details of the stock transactions..
    Hope it might help you..
    Regards
    Gattu

Maybe you are looking for

  • How do I replace pages in a PDF?

    I converted a document but one page is a draft and I need to delete and add the final page to the document, how can I do that?

  • Flash clouds pictures

    The camera on my iPhone 4S works fine if I don't use the flash.  When the flash is used the picture is just a haze.  Is there any way to adjust the flash?

  • Issue with Date

    Hi, I am calculating a date based on a date field and few conditions. the Calculated Key figure or formula is working fine but my issue is for a particular condition the value is displayed as 0/0/0000 i would like to show as blank at this place. Is i

  • Object - Expand appearance in SDK

    Hi, do you know of equivalent SDK call to reproduce UI action Object -> Expand appearance? I tried to use ExpandSuite -> Expand and GetFlattenedArt from ArtStyle suite but the results are different         Luky

  • Transfer Memo Pad files from 9900 handset to Q10

    Is it possible to transfer Memo Pad files from a 9900 handset to a Q10 handset, either via doing a backup/restore using BB Desktop Software, or by other means? I have a lot of info stored in Memo Pad files on my 9900 that I'd like to transfer to the