Hi GVD,
Before closing production order you should ensure all inspection lots associated with this order are completed with usage decision or should be in inactive or closed.
In QA32 transaction, in dynamic selection screen -> choose production order -> enter your order number and execute
find all inspection lots associated with this order, and clear inspection lot by carrying out usage decision and stock posting. Then inspection lot status changes to UD complete status after that it allows you to close the order.
If you do not want to do usage decision, then set deletion flag to inspection lot. Also check inspection lot is in released state or not, if not then create inspection plan and assign it to lot in QA02 and save the lot. It converts lot status to REL then you can either delete it or set UD to it.
Best regards,
Sharat