Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
olov
Explorer
Hi Community,

Today I'd like to share my findings regarding the calculation in MC44 transaction code.

The reason why I've decided to write this post because of the lack of information regarding the work of the transaction. When you see the results of the transaction execution you should understand where the numbers come from. This would be helpful when users got confused and ask you why the results they see in inventory controlling reports like MC.7 or MC.9 are different from MC44.

Overview:

MC44 is used to analyze Inventory Turnover.

The selection screen will look as below in my example:


MC44 Selection screen


 

The formula for Inventory Turnover is the following:

Inventory turnover = Usage (period) / Average stock = 9,000 / 2,851 = 3,16

Usage (period) here is the total usage quantity for the period 01.02.202X to 25.05.202X.

The question is how the average stock (2,851) was calculated. 


Inventory Turnover result


Investigation and Finding:

I have tried to use the following formula as was mentioned in 3153200 note ("Average stock quantity/value calculation in document"):

average stock = (beginning stock value + n stock value at month´s end) / n + 1

And the result was different from 2,851. I reported to SAP that the note 3153200 is not working in this case.

The SAP support advised the following way to find the correct formula:

Go to the program LMCB3U11 -> Function module 'BESTAND_MINIMUM_MITTEL' -> then find the following piece of code:
  LFD_BESTAND = AKT_BESTAND.
MIT_BESTAND = 0.
MIN_BESTAND = AKT_BESTAND.
CLEAR EXIT_FLAG.
LETZTE_BEW = BIS_DATUM.
LOOP AT MATERIALBEW.
IF MATERIALBEW-BUDAT <= BIS_DATUM.
IF MATERIALBEW-BUDAT < VON_DATUM.
MATERIALBEW-BUDAT = VON_DATUM.
EXIT_FLAG = 'X'.
ENDIF.

MIT_BESTAND = MIT_BESTAND + ( LFD_BESTAND - MIT_BESTAND )
* ( LETZTE_BEW - MATERIALBEW-BUDAT )
/ ( BIS_DATUM - MATERIALBEW-BUDAT ).

IF LFD_BESTAND < MIN_BESTAND.
MIN_BESTAND = LFD_BESTAND.
ENDIF.

IF EXIT_FLAG = 'X'.
EXIT.
ENDIF.
LETZTE_BEW = MATERIALBEW-BUDAT.
ENDIF.

LFD_BESTAND = LFD_BESTAND - MATERIALBEW-ZUGANG + MATERIALBEW-ABGANG.

IF MATERIALBEW-BUDAT GE BIS_DATUM.
MIN_BESTAND = LFD_BESTAND.

ENDIF.
ENDLOOP.

Cycle to count Average stock


So, debugging led me to the following findings:

LFD_BESTAND is a current stock and before the first iteration of the cycle is equal to the actual stock that you can find in MB52. Later it will be recalculated.


LFD_BESTAND = 5


MB52 - Display Warehouse Stocks of Material


MIT_BESTAND is an average stock and before the first iteration of the cycle is equal to 0.

MIT_BESTAND = 0

LETZTE_BEW is last movement date and before the first iteration of the cycle is equal to "to date" 26.05.202X (we have a period 01.02.202X - 25.05.202X on the selection screen)

LETZTE_BEW = 26.05.202X

BIS_DATUM is a "to date" and in each iteration of the cycle is equal to "to date" 26.05.202X.

BIS_DATUM = 26.05.202X

MATERIALBEW-BUDAT is a posting date in the document. So average stock is calculated with every movement/document.

We have 7 (1-7) movements during the period 01.02.202X - 25.05.202X and the first date (8) 01.02.202X:



The list of posting dates and received and issued quantities


So the formula:

MIT_BESTAND = MIT_BESTAND + ( LFD_BESTAND - MIT_BESTAND )


                                * ( LETZTE_BEW - MATERIALBEW-BUDAT )


                                / ( BIS_DATUM - MATERIALBEW-BUDAT ). 


can be read as:

average stock= previous average stock + (current stock - previous average stock)
                           * (last movement date - posting date )
                           / (to date - posting date)

LFD_BESTAND (current stock) is reculculated on each iteration:

LFD_BESTAND LFD_BESTAND MATERIALBEW-ZUGANG + MATERIALBEW-ABGANG 

that can be read as:

Current stock = last current stock - valuated stocks receipt quantity + quantity of valuated stock issues

Below you can see the calculation for every posting/movement date:


Calculation of each step


Now we can see how the value 2,851 was calculated.

So, this value will be used in the Inventory turnover formula.
Inventory turnover = Usage (period) / Average stock = 9,000 / 2,851 = 3,16

Conclusion:

The MC44 transaction takes into account all the movements/postings that happened during the timeframe. Average stock is not calculated as (beginning stock value + n stock value at month´s end / n + 1). You can debug the average stock calculation in LMCB3U11 -> Function module 'BESTAND_MINIMUM_MITTEL'. The cycle has the formula:

average stock= previous average stock + (current stock - previous average stock)
                           * (last movement date - posting date )
                           / (to date - posting date)


Thank you for reading!

1 Comment
Labels in this area