And what have you tried? Where are you stuck?
In a simple outline:
1) You sell a steel casting with ID# ABC123
2) For some reason, Joe Blow decides it's not what he wanted and wants to return it.
3) You look up ID# ABC123 on an RMA form. On that form is the original sale date, price, etc. and other pertinent info (CustomerID, for example).
4) On that same form, there is a drop-down of the usual reasons (didn't work, wasn't the right size, broken when it showed, etc. -- whatever reasons you expect), and there's also a Notes field for things that don't fit the usual reasons and for extra info.
5) Once this info is entered, you timestamp and datestamp the record you just entered on the RMA form.
6) When the product shows back up at the warehouse, you confirm the issue the customer described (broken, wrong size, whatever), and then you check a box that says "RMA Merchandise Received" or something.
7) A separate query looks for the "RMA Merchandise Received" checkbox at some given interval and so long as your QA Manager has signed off on it, a check is cut or another product is sent.
I know you were just seeing if this was already written, but without knowing at all what inventory program you have to begin with, I didn't know where to start, so I generalized it. The RMA part is maybe a day or two or work, at least given the detail you've provided.