Hi Jaime,
If your PO qty = 100 EA and GR was done in the system for partaial qty of 40 EA. Now the idoc comes in for 40 EA, one way to differentiate if this is different from the initial 40EA is through the delivery note. The iDOC would need to check the material document posted against the PO and see if the delivery note matches. If yes, do not process the iDOC.
If the GR is always done in full, have you looked at using purchasing value to have 0% over delivery or info record. You can also look at making system message M7 022 as warning, but this would be a global change.
Thanks,
Ashwin