Hi,
You can get the data from S031. Ftech all the data for the material / plant as per your selection screen, with SPMON < Input month and year (From month, hope there will be Fom and To in the selection screen for month)
Then calculate sum of all MZUBB minus sum of all MAGBB. This is the stock on first month.
Now do for all subsequent months similar way till the To month.
Regards,
Sudeep.