cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_DOCUMENT_CREATE2

Former Member
0 Kudos

Hello Expert,

I am using BAPI_DOCUMENT_CREATE2 to create documents.

If there is a duplicate document, i want it to be overwritten. How to make this possible.

Please suggest.

Thanks,

Kunal.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nishant,

In SAP DMS, you are prompted to create a new version of the earlier DIR you are attempting to create. You may incorporate the additional changes in this new version.

Regards,

Pradeepkumar H.

Former Member
0 Kudos

Hello Pradeep,

I am aware of that. but here the requirement is that there do not want to keep the old file.

Thanks,

Kunal.

Former Member
0 Kudos

In that case why dont you simply replace/delete the exisitng original file and replace it with a new one?

Regards,

Pradeepkumar H.

Former Member
0 Kudos

Hi Nishant,

For this try to use the BAPI_DOCUMENT_DELETE for delete the old document or set deletion indicator.

and then creare a DIR as per your requirement.

I hope this will resolve your query.

Regards,

Ravindra

Former Member
0 Kudos

Isn't there any way to replace the document attached only in the FM BAPI..CREATE

christoph_hopf
Advisor
Advisor
0 Kudos

Hi,

in this case you would have to use the BAPI_DOCUMENT_CHANGE2. I would recommend you to read the document details from the existing document info record and then hand it over to CHANGE2 BAPI. Here add the new original file and set the

deletion flag for the existing one. Then the new file should get uploaded and the previous file should be deleted.

Best regards,

Christoph