You need to set this message number 280 for message class M8 as error message, then system will not allow you to post the invoice if the material is in quality inspection.
So define this IMG settings in Logistics invoice verification ---system messages and if not include this message number 280 as error message.
There was similar requirement from my client for the same. At that time contacted the OSS.
The message no.280 is there but you can not configure it.
Not allowing to post the external document like Invoice as it comes leads to so much descripency in real time.
The best solution what SAP has given is in QM control key just tick the Invoice and when the invoice of that perticular material comes for posting you can post but that will be blocked for the payment if the material is not cleared from the Quality.
As the material cleared from Quality, you can release the Invoices and if the material is rejected can raise the credit memo.
Define a control key (if required) by enabling block invoice in the QM control in procurement tab. - maintain a short text to identify this control key.
<b>2. In Material Master</b> - Quality Management view, in the Procurement data tab, call this QM control key. Also enable QM in procurement active.
Doing this for the identified material in the material master, the invoice against this material will always be in block status as long as the material is in Quality Inspection.
Please use the QM control key 0007( delivery release, invoice block) in the quality view of material master under procurement data.
then you will be able to block the invoice.
Please check the scenario in your DV server. It will definitely work.