cancel
Showing results for 
Search instead for 
Did you mean: 

create new version, checkout, checkin workflow not correct via abap

christoph_nagl
Participant
0 Kudos

Hey,

I wrote an abap programm with the following workflow:

- I create a new version of the document CVAPI_DOC_CREATE_NEW_VERSION

- I check out the new version with CVAPI_DOC_CHECKOUTMODIFY

- I check in the file with the new content CVAPI_DOC_CHECKIN

And now there are 2 files in DMS with the same version. But there should be only one document with version 01.

The method CREATE_NEW_VERSION creates an dms document. But also the CVAPI_DOC_CHECKIN method creates an document in dms. But the checkin method should override the new version.

Thanks for your support.

BR,

Christoph

Accepted Solutions (0)

Answers (2)

Answers (2)

christoph_nagl
Participant
0 Kudos

Hey,

Now I add the call of GET_DETAIL method before checkin and now it works that the same version of document is override.

Thanks!

Christoph

christoph_hopf
Advisor
Advisor
0 Kudos

Hi Christoph,

unfortunately it is very hard to suggest a detailed solution for your individual program. Personally I would recommend you to

use the following sequence:

- I create a new version of the document CVAPI_DOC_CREATE_NEW_VERSION

- BAPI_DOCUMENT_GETDETAIL2 to read out the current document data

- I check out the new version with CVAPI_DOC_CHECKOUTMODIFY

- BAPI_DOCUMENT_GETDETAIL2 to read out the current document data

- I check in the file with the new content API_DOCUMENT_MAINTAIN2 or BAPI_DOCUMENT_CHANGE2.

If you enter the storage category in the table DOCUMENTFILES of the mentioned function modules the file should be

checked in again. For further information on the DMS BAPI behavior please see the attached documentation to SAP note 766277.

Best regards,

Christoph

christoph_nagl
Participant
0 Kudos

Hey,

Thanks for you response.

But I have to update the file with new binary content - so I have to use the CVAPI_DOC_CHECKIN methode because in this method I have the opportunity to checkin with new binary content?

But when I checkin, the method creates a second file with the same version and do not override the same file in dms system.

Thanks.

BR,

Christoph