cancel
Showing results for 
Search instead for 
Did you mean: 

BAPIs for manual content versioning for originals of DIRs are available!?

Former Member
0 Kudos

Hello,

I wanna use a BAPI for the manual content versioning for originals of DIRs like it is possible in the GUI (menu "Originals" -> "Checkin as new Version"')  I found already the following 3 BAPIs which might be useful:

- BAPI_DOCUMENT_CHANGE2

- BAPI_DOCUMENT_CHECKIN2

- BAPI_DOCUMENT_CHECKIN_REPLACE2

However, when I tried to use those BAPIs, the original is replaced all the time. So, what do I have to consider here in order to get a content version of an original!?

BR, Jens

Accepted Solutions (0)

Answers (1)

Answers (1)

christoph_hopf
Advisor
Advisor
0 Kudos

Dear Jens,

from my point of view you have to use a BAPI sequence which simulates the checkout and checkin

process of the SAPGUI (e.g. CV02N).

So I think that the creation of content versions would be possible by using BAPI_DOCUMENT_CHECKOUTVIEW first and then BAPI_DOCUMENT_CHECKIN2 or BAPI_DOCUMENT_CHANGE2.

Best regards,

Christoph

Former Member
0 Kudos

Hello Christoph,

thanks for your response.

I already tried the mentoined three BAPIs for the checkin and therefore, as precondition, I had to checkout the original.

In order to checkin now the original as new content version, from my understanding, I somewhere should tell this to the calling checkin BAPI (BAPI_DOCUMENT_CHECKIN2 or BAPI_DOCUMENT_CHANGE2).

First, if I want to checkin an original as a new content version via the GUI, you can also do this explicit by choosing the action "Checkin as new Version". 

So, I don't know what field or flag has to be filled that this BAPIs work or is the manual content versioning not possible in background?

BR,

Jens

christoph_hopf
Advisor
Advisor
0 Kudos

Hi Jens,

if you create content versions for a file normally the function module  'CV120_KPRO_CHECKIN_NEW_VERSION' gets called. So maybe this can be used in a special program or report to create content versions.

There is no specific flag in the BAPIs to trigger the creation of a new content version. This is only made if the used document status has the flag for 'Content Versions' set.

Best regards,

Christoph

Former Member
0 Kudos

Hi Christoph,

yes, I've seen the function module  'CV120_KPRO_CHECKIN_NEW_VERSION'.

If I set the flag 'Content versions' in DC10 -> "document status" for a specific document type, then the creation of the content version is based on the document status. This works but this would be the way for the automatic content versioning, as described in the SAP help.

So, in order to set the content version manually, I'll follow your suggestion and will create an own function module although I would have prefered the use of a BAPI.

Thanks and regards,

Jens

KlausFliri
Explorer
0 Kudos

Hi Jens,

where you able to solve the problem. I'm facing exactly the same problem and I'm wondering if somehow you've found a way to make the existing BAPI's work ?

Or did you create your own function modul in order to solve the topic ?

Please let me know

Thanks & Best Regards

Klaus