Skip to Content

Inventory Ageing ABAP report

Recently I came across the requirement to get inventory ageing directly from SAP ERP 6.0 instead of calculating it on excel sheets with batch isn’t configured.

As a prerequisite, the company is using the FIFO method for ageing. So I used T-Code: MB5B to get stock value and quantity on a specific date.

How MB5B works.

MB5B is calculating stock on a specific date by reversing the usual equation of stock calculation

Ending balance = Begining balance + Input – Output

Current stock is known by kept on MBEW-LBKUM and value on MBEW-SALK3 and Input and output is known by material documents so we are left with only one unknown variable “Begining Stock” which is equivalent to “Stock on earlier date”. so the stock equation will be

Stock on earlier date = Ending Balance ( Current Stock ) – In + Out

 

How is inventory ageing works

Based on the date in the selection, the ageing report will calculate the beginning date and end date for each interval and submit these parameters to MB5B along with material code and plant code, then the result will be retrieved to the ageing report and processed to be displayed in the ALV.

Report screenshots

How to create the report

The full illustration of how to create the report is available on the Github

 

 

Thanks for reading.

6 Comments
You must be Logged on to comment or reply to a post.
  • Really nice work.

    In 14 years of experience, i always find customers developing this kind of reports for their specific needs  and your github project is a good start for further customization!

  • An incredible report! Thank you so much, saved us a ton of work. If you’re still out there, is there a way to change this report so that it accepts the alphabetic characters? Our factory uses letters in some material codes of the finished product. I am not an ABAPer but I know how to alter the code, just need a pointer of where it is constrained. Any help would be greatly appreciated. Best regards from UK!

  • Hi

    Sorry unable to understand the logic. Please tell me the logic if I want to calculate the stock which are above 3, 6 months and 12 Months .

    Is this formula work Stock on earlier date = Ending Balance ( Current Stock ) – In + Out

    • Take for example below stock movement for one material code.

      Date Qty Balance Comment
      01.01.2020 100 100 In
      01.02.2020 -30 70 Out
      01.03.2020 -10 60 Out
      01.04.2020 60 120 In
      01.05.2020 -15 105 Out
      01.06.2020 -40 65 Out
      28.09.2020 -10 55 (Current Stock) Out

      applying the above formula to get the stock on 01.03.2020

      Stock on 01.03.2020 = Current stock – In + Out

      Stock on 01.03.2020 = 55 – 60 + 10 + 40 + 15 = 60