Functionality You can use this method to set a deletion indicator for a document inforecord (DIR). Notes The system does not delete any data from the database. You have two options for deleting a DIR with a deletion indicator fromthe database:
- By using BAPI Bapi_Document_Delete_Direct>
- By using program MCDOKDEL> (report for deleting documents with a
deletion indicator) Enter the document type for which you want to delete all documents witha deletion indicator. Since there may be several documents with the samedocument type (and a deletion indicator), first run the program in testmode. Then you can run the report live.Example Example program> *************> **Define variables required> ************> DATA: ls_doc LIKE bapi_doc_draw2, * BAPI return structure> ls_return LIKE bapiret2. *******************************************> ** Assign document data (which document is to be deleted or> ** where is the deletion indicator to be set)> ******************************************> ls_doc-documenttype = 'DRW'. ls_doc-documentnumber = 'DOKUMENTNUMMER'. ls_doc-documentversion = '00'. ls_doc-documentpart = '000'. ******************************************************************** > ** Call the BAPI that deletes the document or sets the deletionindicator> ******************************************************************** > CALL FUNCTION 'BAPI_DOCUMENT_DELETE' EXPORTING: documenttype = ls_doc-documenttype documentnumber = ls_doc-documentnumber documentpart = ls_doc-documentpart documentversion = ls_doc-documentversion IMPORTING: return = ls_return. ** Any errors?> IF ls_return-type CA 'EA'. ROLLBACK WORK. MESSAGE ID '26' TYPE 'I' NUMBER '000' WITH ls_return-message. ELSE. COMMIT WORK. ENDIF.
|