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.

Similar Messages

  • BAPI function module to get condition type and its values based on delivery number?

    Hi All,
    I would like to have the BAPI function module to get condition type value based on delivery number before invoice is created.please provide detail program for as a reference .please reply as soon as possible its urgent.
    Regards,
    saaikumar.

    If you haven't already, you may first need to search via the SAP transaction "BAPI" in the area this is applicable to.  Failing that I do hope you get an answer.

  • Function module to get detials of blocked stock of Material

    Hi al.....
    I like to know the function module to get details of blocked stock of material
    for particular plant.... like blocked by sales order or damaged material ..etc..
    Thanks...

    Hello ,
    just check this FM
    please just read the document of the FM.....
    ME_CONFIRMATION_READ_GR_BLOCK
    RV_MATERIAL_STATUS_BLOCK
    MATERIAL_MAINTAIN_DARK_DB
    MATERIAL_MAINTAIN_DARK
    MATERIAL_MAINTAIN_DARK_PR
    MATERIAL_MAINTAIN_DIALOGUE
    MATERIAL_MAINTAIN_DIAL_RETAIL
    MATERIAL_MAINTAIN_DARK_RETAIL
    This May help....u.....
    Thank u,
    santhosh

  • Function Module to get PO details based on Plant and PO date

    Hi
    1. Is there any Function Module to get PO details based on Plant and PO date?
    2. Is there any Function Module to get Material document details based on PO number?
    Thanks
    Narendra

    hi,
    check these standard reports.
    ME2L - By vendor
    ME2M - By material
    MSRV3 - By service
    ME2K - By account assignment
    ME2C - By material group
    ME2B - By tracking number
    ME2N - By PO number
    ME2W - By supplying plant
    also chck this func module.
    REPL_LIST_PURCHASE_ORDER_READ
    reward if hlpful.

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

  • 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

  • Reg:Opening and Closing Stock For Plant

    Hi All,
      i want to calculate the opening stock and closing stock for plant wise for the given Posting Period Date.
    Am having the opening balance and closing balance for all months but i need it as month wise.
    considering this example,
    the date is from 15.01.2010 to 15.03.2010 and for one plant
    considering this example,
    am having the opening stock from as 15.01.2010  to 15.03.2010 as 10,000 and the closing stock as 15,000.
    but i need in month wise like below,
    from 15.01.2010 to 31.01.2010 what is the opening stock and closing stock?
    from 01.02.2010 to 28.02.2010 what is the opening stock and closing stock?
    from 01.03.2010 to 15.03.2010 what is the opening stock and closing stock?
    this is purely based on plant wise and not material wise?
    could anybody say clearly how can i acheive this scenario?
    i have referred MB5b,mc.9 transaction programs but still confused how to go with plant wise for a particular period?
    Thanks & Regards,
    Suresh
    Edited by: suresh suresh on Mar 24, 2010 10:15 AM

    Hi,
    Refer to link below:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c1/3766e7449a11d188fe0000e8322f96/frameset.htm
    Regards,
    Venkat.

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

  • BAPI or Function Module to get open orders and open quotation details

    Hi,
    I have requirement to get all the open orders(as in VA05) and all the open quotations( as in VA25) for a sold-to-party. Could you please let me know if there are any BAPIs or Function Modules for the same.
    Thanks,
    Surekha.

    Hi,
    Check if the below helps:
    1.  BAPI_SALESORDER_GETLIST for VA05
    2. BAPI_QUOTATION_GETDETAILBOS for VA25.
    Regards,
    Vivek

  • BAPI function module to get process orders for certain material

    Dear experts ,
    kindly , I need my vb application to get all CRD , but not DLV Process orders for Material X.
    Into SAP , I use the COIO , then set material to X , then display flag CRTD included , and Exclude DLV.
    Question now , What is the function module that does this. what is the table name , and how to set search parameters.
    my code will be like this
    theFunc = functionCtrl.Add("BAPI_PO_GETDETAIL") ' get po data
       theFunc.exports("purchaseorder") = t.Text
                 returnFunc = theFunc.call
            returnParam = theFunc.imports("po_header")
            retTab = theFunc.tables("po_items")
            For Each rr In retTab.Rows
                tt1.Text &= (rr("MATERIAL")) & vbTab
            next
    Thanks
    Waleed

    Hi,
    Check if the below helps:
    1.  BAPI_SALESORDER_GETLIST for VA05
    2. BAPI_QUOTATION_GETDETAILBOS for VA25.
    Regards,
    Vivek

  • Ask Function Module to get  "Open Qty" on outbound delivery

    hi All,
    Does anybody know what is the FM I can use to get "Open Qty" (RV50A-LFPMG) ? at VL01N
    or do I have to count it manually to get the open qty?
    I hope not, but if yes, does the value comes from :
    Open Qty = VBAP-LSMENG - (all delivery qty value for SO Line item).
    Thanks!
    Willy

    Hi...
    Take the open qty as ordered qty (field: MENGE)-delivered qty(field: WAMNG) from EKET table.
    Regards,
    KP

  • BAPI or Function Module to get MSEG table data based on PO Number (EBELN)

    Hi
    1. Is there any BAPI /  Function Module to get PO details based on Plant and PO date?
    2. Is there any BAPI / Function Module to get Material document details(MSEG data) based on PO number?
    Thanks
    Narendra

    Hi,
    check the Bapis Givem below
    BAPI_PO_GETITEMS
    http://abap.wikiprog.com/wiki/BAPI_PO_GETDETAIL1
    you will get the detail.
    Regards

  • BAPI/Function module for FAIV06

    Hi All,
    I want post the debit/credit material document using transaction FAIV06.I searched for BAPI/function module but nothing found.
    if you know any bapi/function module or is there any alternate method for posting the document.
    please help.
    Thanks.

    I think there is  only a BAPI to get the details of a Info record BAPI_INFORECORD_GETLIST. For creagting / updating you will have to write a BDC.
    regards,
    Ravi
    Note : Please mark the helpful answers

  • Querying a BAPI Function Module

    Is it possible to write a query on the BAPI Function Module. For example I have a views in oracle database and i can query the views based on some condition and get the required data from the views. In the same way is it possible to query the BAPI function module to get the data based on given condition

    Hi Nikki,
       You can use FM RFC_READ_TABLE to read data from any SAP table.
      Also check following post by Raja -
         RFC_READ_TABLE for SAP Web AS - Code Sample
    Cheers,
    Sanjeev

  • 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

Maybe you are looking for