Hello,
You need to archive the batches with Zero stock. Use SARA with MM_SPSTOCK object, and flag "Only consider batch stock records without stocks".
Or use BAdI 'VB_BD_SELECTION' method PRESELECT_BATCHES here exclude zero quantity batches.
Best Regards,
R.Brahmankar