Skip to Content

Opening stock will be the closing stock of previous date

Hi All,

Good day. I am developing an ALV report that will show opening stock(LABST) as well as closing stock(Calculated) for a range of date and materials. Problem here is that from MARD table I am getting only the last opening stock, because it has no common date field with MSEG table. So, I have to calculate the opening stock as the closing stock of previous date. How can I calculate this? Is there any FM to get the opening stock ?

Date          Material            Opening St       Closing St
27.03.2009	2100002		91.000		191.00
28.03.2009	2100002		191.000		123.00
29.03.2009	2100002		123.000		103.00

With regards,

Tripod.

Edited by: Tripod on Aug 23, 2011 12:13 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 06:32 AM

    BAPI_MATPHYSINV_GETDETAIL

    BAPI_MATPHYSINV_GETLIST

    CBP_SOP_OPENING_STOCK_READ

    check whether these are of any help..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2011 at 06:36 AM

    Kindly Try this FM::

       /SPE/MATERIAL_STOCK_READ  

    Kindly Update If it suffices the requirement or not...

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2011 at 06:42 AM

    The first 2 BAPIs as mentioned by Krishna might work...Please check...but the third one

     CBP_SOP_OPENING_STOCK_READ 

    is no longer in use....

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2011 at 07:24 AM

    Try not only to use MARD and MKPF/MSEG but also MARDH which contains closing stock of period preceding periods where movements happened. (ie. there is a record for May if a movement happened in June, and none for June if there was no movement in July, and no record exists for August as this is current period) - First look for MARD, MARDH records; and then only read MKPF/MSEG from last MARDH record found. (created back to 4.5A - [Material Master (Industry/Retail): Enhancements to Period Closing|http://help.sap.com/saphelp_45b/helpdata/en/35/b0e7ef87a62488e10000009b38f9b7/content.htm])

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.