Hi Scott Harvey,
The code which I wrote above was for multiple backend systems. But now sap has come up with the note with the above solution as well so you can refer to that or the above code .
http://service.sap.com/sap/support/notes/2124745.
Cheers
Gautam