cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete Document through code

Former Member
0 Kudos

Hello Experts,

I want to delete the Document through code.

I have used BAPI BAPI_DOCUMENT_DELETE but it is throwing error message as

You cannot set the deletion indicator (document is used in a BOM) .

Can you please suggest how to delete the document ?

Regards,

Ravindra Sahu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravindra

Please find the link below.Hope it will give you a clear idea.

IF the document is used in multiple BOM's then need to ensure what are the different links available to the document before deleting it.

Regards

Praveen

Answers (2)

Answers (2)

former_member188883
Active Contributor
0 Kudos

Hi Ravindra,

If you want to remove the original in CV02N through ABAP coding, then I think you can only implement BADI DOCUMENT_MAIN01 (method AFTER_READ_DATA) or DOCUMENT_FILES01 (method AFTER_ASSIGN_FILE) where you need to implement your own coding to delete the previous existing original file.

Hope this is useful.

Regards,

Deepak Kori

Former Member
0 Kudos

CV12 transaction for maintenance of BOM structure would be the only way which would permit you to delete DIR's that are part of a document BOM.See if this helps.

Regards,

Pradeepkumar Haragoldavar