Hello,
I agree with Sue, this is something that you would only do in very special circumstances.
I've never found a need for it myself. Are you sure you have to do this?
But anyway...
I assume you're not trying to do this for a completed workitem. Maybe you could run it in debug and see exactly where SAP_WAPI_WRITE_CONTAINER goes wrong.
By the way, you should be using SAP_WAPI_READ_CONTAINER. Always use SAP_WAPI* when you can.
regards
Rick Bakker