Generally it is not possible to use the DMS transactions (CV01N, CV02N or CV03N) in background mode. For this behavior only some of the DMS BAPIs could be used like BAPI_DOCUMENT_CREATE2 or BAPI_DOCUMENT_CHANGE2.
But please note that also BAPIs are not so flexible regarding the call by RFC or background processing. Therefore I would recommend you to use the API modules. In SAP note 504692 you will find some sample programs for special check-in cases.
I would kindly ask you to check this note and see if it contains necessary information for you.