Our client is using a scenario, where the invoice will check delivery note on the GR document and will add the material doc number as 'Reference Doc' in IR doc. It is working fine for a single GR scenario. When a GR is revered due pricing reason and a new GR has been done with a reference to the same delivery note, the incoming EDI invoice is still picking the first GR, which is actually reversed and sitting in the system with blocked state with pricing difference. Is there anyway we can make changes in the system by config or ABAP to make the invoice point to the right material doc?? Please help.