How to create a back-end CS Document?

I want programmatically create a calendar document in back-end document.Which fields must filled in to avoid any error reopening in front end ?

Thank you in advice.