Hello Mei,
If you have activated batch status management then you can restrict it in OMCG for 261 movement type.
Add characteristic LOBM_ZUSTD to batch and selection class if you want to select batches based on status
Also on In the Customizing Transaction OMCQ, the messages M7 665 or M7 670 set as error messages E
Refer KBA 1898563 - LO-BM : Batch determination return restricted batch
Best Regards,
R.Brahmankar