Closing Stock Of material

Dear all
      Using MC.9 transaction we will get the closing stock of a material in any date directly.I want to know that from which table we will closing stock of a material in a particular date.From MBEW we will get current stock only but ieed the closing stock of a particular date..Help me if u have any idea..
Regards BIJU K SHARMA

closing stock showing in MB5B report for that date with the same filter conditions.
In closing stock u have to consider Stock.Avail. @ my hands
search for  table MARD in that MB5B
refer.
Re: closing stock of a particular date

Similar Messages

  • Tables/FM for opening/closing stock for material on given posting date

    Hi All,
    I had requirement of find the opening/closing stock for material on given posting date. The values we can find out using TCode - MB5B.
    But I cannt use MB5B to extract data because I need to find detials for thousands of material.
    Can you please adivce if their is any FM or tables through which i can find this detial on any given date apart from current date.
    Thanks & Regards,

    Hi,
    [https://forums.sdn.sap.com/click.jspa?searchID=19631709&messageID=6593903]
    [https://forums.sdn.sap.com/click.jspa?searchID=19631709&messageID=6630975]

  • FM for Opening And Closing Stock for Material

    Dear All,
        I need to Calculate the opening and closing stock of the material. If there is any FM for the same just let me know and if not kindly let me know the way out.
    Regards
    Amit

    Hi!
    The closing stock can be found in the MARD table.
    And the opening stock should be always zero.
    I think you wanted to know the yearly/monthly closing/opening stocks, then you have to gather all material documents from MKPF, MSEG tables, and calculate the stock, using the actual stock and subtract/add (depends on the movement type) the material document's quantity, until the given date.
    I don't know any FMs for this, maybe someone could tell you one...
    Regards
    Tamá

  • Opening & Closing Stock in transit

    Hi All,
    I Developed an abap report for Yield Statement with opening & closing Stock Quantities.
    How to Find opening & Closing For transit Stock for 641 movement.I mean how to display the current transit stocks date wise at plant level without SLOC.
    I Knew that current transit stock would be in Marc Table & previous closings in March Tables.
    I'm looking for the date logic with respect to displaying opening & closing dates of transit stock.Be it Date Wise Or Month Wise.
    Any help would be greatly appreciated.
    Thanks & Regards,
    Ravi S

    Hi Ravi,
    Please find the Link below hope they are very useful to you
    [Stock|Re: closing stock of a particular date]
    [Stock|Tables/FM for opening/closing stock for material on given posting date]
    Thanks
    kalyan

  • 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

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

  • Bapi/function module to get opening or closing stock for a posting date

    I am creating a report where i need to get the opening stock value and closing stock value  for the given starting date and ending date respectively for the PP report.
    The T-code for that is MB5B.
    So,can any1 plzz tell me how i can get the stock value for a starting date/ending date...
    Is there any BAPI or function module to find this out..
    or any logic?
    Thanks.

    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.

  • Closing Stock of Plant at BPC level

    Hi Experts,
    I am very fresher to work on BI-BPC integration project for SAP ABAP.
    Requirement is like we have input of TIME, PLANT, MATERIAL for this we need to fetch closing stock of material in BPC reprot.
    Closing Stock will not come directly from BI cube because its calculation part on the basis of input period.
    So please suggest me what are the different ways to achieve this.
    Regards,
    Dipesh.

    Hi Dipesh,
    you can do it  in two ways,
    1.Write your calculation part in default logic it will trigger by default when ever you submit your data through input period.
    2. Create  custum logic code and Datamanger package.Then trigger the data manager package after input the data in Input form.
    Note: Prefer second way rather than first bcoz default logic will trigger for all input forms when ever data is input, So it will create some disturbance.
    Thanks,
    Firoz

  • Related to Closing stock

    Hi,
    My req, is to find out closing stock of material that should be matched with MB5B.
    so have put logic, values Iam getting correct,but it takes time,
    So plz let me know is any other method to find out this??
    Logic is as follow:
    loop at it_final into wa_final,
    PERFORM closing_stock USING wa_final-werks wa_final-matnr
                                  CHANGING w_close_stock.
    modify table it_fianl transporting cl_stk.
    endloop.
    for credit quantity (issue quantity)****************
      SELECT SUM( a~menge ) INTO w_cr_menge
             FROM mseg AS a INNER JOIN mkpf AS b
             ON amblnr = bmblnr AND
                amjahr = bmjahr
             WHERE a~matnr = matnr AND
                   a~werks = werks AND
                   a~shkzg = 'H' AND
                   b~budat <= so_date-high.       " CR - H
    for debit quantity (receipt quantity)  ****************
      SELECT SUM( a~menge ) INTO w_dr_menge
            FROM mseg AS a INNER JOIN mkpf AS b
            ON amblnr = bmblnr AND
               amjahr = bmjahr
            WHERE a~matnr = matnr AND
                  a~werks = werks AND
                  a~shkzg = 'S' AND
                  b~budat <= so_date-high.           " " DR - S
    ****Stock in transit :Stock transfer movement type.641*****
      SELECT SUM( a~menge ) INTO w_101_651_menge
                    FROM mseg AS a INNER JOIN mkpf AS b
                    ON amblnr = bmblnr
                    AND amjahr = bmjahr
                    WHERE a~bwart IN rg_101_651
                         AND a~matnr = matnr
                         AND a~werks = werks
                         AND a~shkzg = 'S'
                         AND b~budat <= so_date-high.
    ****Stock in transit :Stock transfer movement type.642*****
      SELECT SUM( a~menge ) INTO w_652_459_menge
                    FROM mseg AS a INNER JOIN mkpf AS b
                    ON amblnr = bmblnr
                    AND amjahr = bmjahr
                    WHERE a~bwart IN rg_652_459_102
                    AND a~matnr = matnr
                    AND a~werks = werks
                    AND a~shkzg = 'H'
                    AND b~budat <= so_date-high.
      w_close_stock = w_dr_menge - w_cr_menge + w_652_459_menge - w_101_651_menge.
      CLEAR w_dr_menge.
      CLEAR w_cr_menge.
      CLEAR w_652_459_menge.
      CLEAR w_101_651_menge.
    endform.
    Thanks & Regards,
    Anagha Deshmukh

    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

  • 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

  • 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

  • Closing Stock of a Material

    If I know the Material Code and Plant then how can I determine the closing stock of that material for a particular date?
    I know that from the table MARD I can get the value of today's closing stock. But how can I know any other days closing stock.
    This is very urgent.
    Regards,
    Subhasish

    Hi
    Check this out.... <b>Though this is for Opening Stock</b>, you can have receipts and issues in that period for the material and then calculate the Closing Stock.
    *&      Form  GET_OPENING_STOCK
      ******* USE THIS LOGIC FOR GETTING OPENING STOCK OF A BATCH ******
      ********** THE WAY ITS DONE (TO SOME EXTENT) IN Trxn MB5B **********    
      **************** VERY USEFUL TO GET STOCK FASTER **************
    FORM GET_OPENING_STOCK .
      DATA: TOTAL TYPE P DECIMALS 3.
      CLEAR       OPTOT.
      REFRESH: IMARD, G_T_MSEG_LEAN.
      CLEAR:   IMARD, G_T_MSEG_LEAN.
    *- Select data from IMARD
      SELECT * FROM MARD INTO CORRESPONDING FIELDS OF TABLE IMARD
                                              WHERE WERKS = P_PLANT-LOW
                                              AND   MATNR = OPBAL-MATNR.
      IF SY-SUBRC = 0.
        READ TABLE IMARD INDEX 1.
        IF SY-SUBRC = 0.
          TOTAL = IMARD-LABST.
        ENDIF.
      ENDIF.
    *- Select data from MSEG and MKPF
      SELECT
                 MKPF~MBLNR
                 MKPF~MJAHR
                 MKPF~BLART
                 MKPF~BUDAT
                 MKPF~CPUDT
                 MSEG~MATNR
                 MSEG~WERKS
                 MSEG~LGORT
                 MSEG~CHARG
                 MSEG~SHKZG
                 MSEG~MENGE
               INTO CORRESPONDING FIELDS OF TABLE G_T_MSEG_LEAN
               FROM MKPF AS MKPF  JOIN MSEG AS MSEG
                        ON MKPFMANDT  =  MSEGMANDT  AND
                           MKPFMBLNR  =  MSEGMBLNR  AND
                           MKPFMJAHR  =  MSEGMJAHR
               WHERE MSEG~MATNR  =   OPBAL-MATNR
                 AND MSEG~WERKS  =   P_PLANT-LOW
                 AND MSEG~CHARG  =   OPBAL-BATCH
                 AND MKPF~BUDAT  GE  P_DATE-LOW.
      SORT  G_T_MSEG_LEAN    BY WERKS MATNR CHARG SHKZG DESCENDING.
      IF NOT G_T_MSEG_LEAN[] IS INITIAL.
        LOOP AT G_T_MSEG_LEAN.
          IF G_T_MSEG_LEAN-SHKZG = 'H'.
            TOTAL = TOTAL + G_T_MSEG_LEAN-MENGE.
          ELSE.
            TOTAL = TOTAL - G_T_MSEG_LEAN-MENGE.
          ENDIF.
        ENDLOOP.
    *- Assign Stock
        OPTOT = TOTAL.
      ENDIF.
    ENDFORM.                    " GET_OPENING_STOCK
    Regards,
    Raj

  • Report of daywise Material/Vendor closing stock

    Dear Friends,
    there is a requirement of stock report of closing stocks for each day in a month. Suppose a month has 31 days then the report will show 31 lines for each day closing stock in one go for a single material.
    Similar to vendor also. If we select a vendor for a particular period it should show 31 entries for each day's closing stock at vendor level.
    Rquest to find some ways for the report.
    Regards,
    ASK

    Try to create a custom Report as per your requriment , also check the std report ME80FN it may help you.

  • 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

    Hi,
        We have a requirement in which a Customized report has to be developed. The report needs to display the opening stock , Total reciept, consumption and closing stock for supplier wise material.
       We came across a standard report MB5B in which all these values are available. However inorder to display these values in a customized report we require a standard function module. Please provide us a std function module that can solve the purpose.
    If the std module is not available (i dnt come across one) kindly porvide an alternaitve for the same.
    Regards,
          Milan Thaker

    Hi,
    Use Submit Statement to get the output data from MB5b.
    Ex:
    Create selection screen with required filelds and use like this
    SUBMIT RM07MLBD with MATNR in r_matnr
                            with LGBST eq ''
                            with BWBST eq 'X'
                            with datum in datum
                            with bukrs in bukrs
                            with werks in werks
                            with lgort in lgort
                            with charg in charg
                            with bwtar in bwtar
                            with bwart in bwart
    Rgds
    Aeda

Maybe you are looking for