Process RMA from the customer.
Move the returned inventory to the org where the original PO was received.
Perform a return-to-vendor (RTV) transaction on the original po (assuming the PO is not finally closed)
Generate a debit memo if necessary.
Receive the replacement part.
Apply the debit memo to pay for the replacement part.
Do not generate debit memo at all.
Hope this helps