MCDOKDEL is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for With this report (program), you delete all the flagged documents of a selected document type from the data bank...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.
If you would like to execute this report or see the full code listing simply enter MCDOKDEL into the relevant SAP transactions such as SE38 or SE80
This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.
Selection Text: TEST = Test mode
Selection Text: P_CHECK = Execute checks
Selection Text: DOKAR = Document type
Title: Program for Deleting Documents with Deletion Indicator
Text Symbol: 017 = A bill of material is assigned to the document
Text Symbol: 016 = Document is assigned to a change master record
Text Symbol: 015 = Test mode
Text Symbol: 014 = System locking error
Text Symbol: 013 = Document already locked
Text Symbol: 012 = Deleted
Text Symbol: 011 = Note
Text Symbol: 010 = Ver
Text Symbol: 009 = Part
Text Symbol: 008 = Document
Text Symbol: 007 = Type
Text Symbol: 006 = Documents deleted
Text Symbol: 005 = Documents not deleted
Text Symbol: 004 = Used as document item in bill of material
Text Symbol: 003 = Used as PRT in task list
Text Symbol: 002 = Used as PRT in work order
Text Symbol: 001 = Used as quality assurance agreement or technical delivery term
INCLUDE: CV_CONSTANTS.
No SAP DATABASE tables are accessed within this REPORT code!
CV115_DOC_DEQUEUE CALL FUNCTION 'CV115_DOC_DEQUEUE' EXPORTING: pf_all = '' pf_dokar = deltab-dokar pf_doknr = deltab-doknr pf_dokvr = deltab-dokvr pf_doktl = deltab-doktl EXCEPTIONS: error = 1 OTHERS = 2.
FUNCTION_EXISTS CALL FUNCTION 'FUNCTION_EXISTS' EXPORTING FUNCNAME = '/PLMI/DIR_DELETE_ACC' EXCEPTIONS FUNCTION_NOT_EXIST = 1 OTHERS = 2.
/PLMI/DIR_DELETE_ACC CALL FUNCTION '/PLMI/DIR_DELETE_ACC' "#EC EXISTS EXPORTING IS_DIR_ID = is_dir_id.
CV115_DOC_DEQUEUE CALL FUNCTION 'CV115_DOC_DEQUEUE' EXPORTING: pf_all = '' pf_dokar = deltab-dokar pf_doknr = deltab-doknr pf_dokvr = deltab-dokvr pf_doktl = deltab-doktl EXCEPTIONS: error = 1 OTHERS = 2.
DOCUMENTS_DELETE CALL FUNCTION 'DOCUMENTS_DELETE' TABLES: documents = dtab.
DB_COMMIT CALL FUNCTION 'DB_COMMIT'.
DEQUEUE_ALL CALL FUNCTION 'DEQUEUE_ALL'.
CF_ST_DOK_DELETE CALL FUNCTION 'CF_ST_DOK_DELETE' EXPORTING: dokar_imp = deltab-dokar doknr_imp = deltab-doknr doktl_imp = deltab-doktl dokvr_imp = deltab-dokvr flg_test_imp = 'X' EXCEPTIONS: not_fhm = 01 order_usage = 02 plan_usage = 03.
GET_DOST CALL FUNCTION 'GET_DOST' EXPORTING: all = 'X' no_buffer = '' set = 'X' TABLES: wa = lt_doc_bom EXCEPTIONS: call_invalid = 01 end_of_table = 02 get_without_set = 03 key_incomplete = 04 key_invalid = 05 no_record_found = 06.
ENQUEUE_EMCVDOK CALL FUNCTION 'ENQUEUE_EMCVDOK' EXPORTING: dokar = ps_draw-dokar doknr = ps_draw-doknr dokvr = ps_draw-dokvr doktl = ps_draw-doktl EXCEPTIONS: foreign_lock = 8 system_failure = 12.
CF_ST_DOK_DELETE CALL FUNCTION 'CF_ST_DOK_DELETE' EXPORTING: dokar_imp = ps_draw-dokar doknr_imp = ps_draw-doknr doktl_imp = ps_draw-doktl dokvr_imp = ps_draw-dokvr flg_test_imp = '' EXCEPTIONS: not_fhm = 01 order_usage = 02 plan_usage = 03.
CLFM_DELETE_CLASSIFICATION CALL FUNCTION 'CLFM_DELETE_CLASSIFICATION' EXPORTING echt_lauf = 'X' object = lf_object table = 'DRAW' type = 'X' i_no_lock = 'X' EXCEPTIONS foreign_lock = 01 not_deleted = 02 system_failure = 03 table_not_found = 04.
CV130_ADDITIONAL_DATA_REMOVE CALL FUNCTION 'CV130_ADDITIONAL_DATA_REMOVE' EXPORTING: pf_select_data = '' pf_check = '' pf_del_class = 'X' pf_del_text = 'X' pf_del_valuation = 'X' pf_save_direct = '' CHANGING: ps_drad =
EXCEPTIONS: error_class = 1 no_select = 2 error_text = 3 OTHERS = 4.
CCCN_ECO_FOR_DOCUMENT_DELETE CALL FUNCTION 'CCCN_ECO_FOR_DOCUMENT_DELETE' EXPORTING eaennr = ps_draw-aennr edokar = ps_draw-dokar edoknr = ps_draw-doknr edoktl = ps_draw-doktl edokvr = ps_draw-dokvr flg_del_direct = 'X' EXCEPTIONS OTHERS = 1.
CV200_DB_TDWA_SELECT CALL FUNCTION 'CV200_DB_TDWA_SELECT' EXPORTING: pf_dokar = pf_dokar IMPORTING: psx_tdwa = ls_tdwa EXCEPTIONS: not_found = 1 OTHERS = 2.
CV120_GET_HOSTNAME * CALL FUNCTION 'CV120_GET_HOSTNAME' * EXPORTING: pf_batch = gf_batchmode * IMPORTING: pfx_host = gf_hostname * EXCEPTIONS: error = 1 * no_valid_frontend = 2 * OTHERS = 3.
CV120_CHECK_DATA_CARRIER CALL FUNCTION 'CV120_CHECK_DATA_CARRIER' EXPORTING: pf_dttrg = lf_dttrg IMPORTING: pfx_dctype = lf_dctype EXCEPTIONS: not_found = 1 OTHERS = 2.
CV120_KPRO_DOC_DELETE CALL FUNCTION 'CV120_KPRO_DOC_DELETE' EXPORTING: pf_batchmode = 'X' pf_check_ref = 'X' PF_DELETE_REF = lf_check pf_dokar = ps_draw-dokar pf_doknr = ps_draw-doknr pf_dokvr = ps_draw-dokvr pf_doktl = ps_draw-doktl EXCEPTIONS: error = 1 not_found = 2 has_references = 3 OTHERS = 4.
CALL FUNCTION 'CV120_DELETE_VAULT_FILE' EXPORTING: pf_dttrg = ls_file-dttrg pf_file = ls_file-filep pf_ftp_dest = gf_ftp_dest EXCEPTIONS: error = 1 OTHERS = 2.
CV120_FTP_OPEN CALL FUNCTION 'CV120_FTP_OPEN' EXPORTING: pf_show_progress = '' pf_vault = '' pf_ftp_dest = gf_ftp_dest EXCEPTIONS: error = 1 OTHERS = 2.
CV120_FTP_CLOSE CALL FUNCTION 'CV120_FTP_CLOSE'.
CV120_ARCHIVE_KEY_CREATE CALL FUNCTION 'CV120_ARCHIVE_KEY_CREATE' EXPORTING pf_type = 'M' pf_fileno = ps_file-appnr ps_draw = ls_draw IMPORTING pfx_objid = lf_object_id.
CV120_ARCHIVE_KEY_CREATE CALL FUNCTION 'CV120_ARCHIVE_KEY_CREATE' EXPORTING pf_type = 'A' pf_fileno = ps_file-appnr ps_draw = ls_draw ps_draz = lt_draz IMPORTING pfx_objid = lf_object_id.
ARCHIV_CONNECTINFO_GET_META CALL FUNCTION 'ARCHIV_CONNECTINFO_GET_META' EXPORTING: archiv_id = lf_archive_id object_id = pf_object_id sap_object = c_dms_sapobject IMPORTING: number = lf_connect_number TABLES: connect_info = lt_connections EXCEPTIONS: error_connectiontable = 01.
ARCHIV_DELETE_META CALL FUNCTION 'ARCHIV_DELETE_META' EXPORTING: ar_object = c_dms_arobject delete_flag = 2 object_id = pf_object_id sap_object = c_dms_sapobject EXCEPTIONS: error_connectiontable = 01 error_parameter = 02 OTHERS = 04.
CHANGEDOCUMENT_DELETE CALL FUNCTION 'CHANGEDOCUMENT_DELETE' EXPORTING objectclass = lf_obj_class objectid = lf_obj_id up_to_date = sy-datum disable_authority_check = 'X' EXCEPTIONS no_authority = 01 no_changes_found = 02.
CV120_CHECK_DATA_CARRIER CALL FUNCTION 'CV120_CHECK_DATA_CARRIER' EXPORTING: pf_dttrg = ptx_files-dttrg IMPORTING: pfx_dctype = lf_dctype EXCEPTIONS: not_found = 1 OTHERS = 2.
CHANGEDOCUMENT_DELETE CALL FUNCTION 'CHANGEDOCUMENT_DELETE' EXPORTING: objectclass = 'DOK_AUDIT' objectid = lt_cdhdr-objectid up_to_date = sy-datum disable_authority_check = 'X' EXCEPTIONS: no_authority = 01 no_changes_found = 02.
CV120_CHECK_DATA_CARRIER CALL FUNCTION 'CV120_CHECK_DATA_CARRIER' EXPORTING: pf_dttrg = lt_files-dttrg IMPORTING pfx_dctype = lf_dctype EXCEPTIONS: not_found = 1 OTHERS = 2.
ARCHIV_DELETE_META CALL FUNCTION 'ARCHIV_DELETE_META' EXPORTING delete_flag = '3' object_id = ls_objectid sap_object = 'DRAW' EXCEPTIONS error_connectiontable = 01 error_parameter = 02.
CV200_DB_DRAP_SELECT CALL FUNCTION 'CV200_DB_DRAP_SELECT' EXPORTING: pf_dokar = ps_draw-dokar pf_doknr = ps_draw-doknr pf_doktl = ps_draw-doktl pf_dokvr = ps_draw-dokvr TABLES: ptx_drap = lt_drap EXCEPTIONS: not_found = 1 OTHERS = 2.
SIGN_READ CALL FUNCTION 'SIGN_READ' EXPORTING: object_imp = '60' key_dms_imp = ls_rc77 TABLES: signs_dms_tab = lt_rc77b EXCEPTIONS: key_for_object_incomplete = 1 no_signatures_found = 2 OTHERS = 3.
SIGN_DELETE CALL FUNCTION 'SIGN_DELETE' EXPORTING: object_imp = '60' key_dms_imp = ls_rc77 EXCEPTIONS: key_for_object_incomplete = 1 no_signatures_found = 2 OTHERS = 3.
SIGN_SAVE CALL FUNCTION 'SIGN_SAVE' EXPORTING object_imp = '60' KEY_DMS_IMP = ls_rc77 EXCEPTIONS KEY_FOR_OBJECT_INCOMPLETE = 1 OTHERS = 2.
Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.
The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.
This will then be available for everyone to easily find by simply searching on the report name MCDOKDEL or its description.
MCDOKDEL - Program for Deleting Documents with Deletion Indicator MCDOKDEL - Program for Deleting Documents with Deletion Indicator MCDOKCHN2 - documentation and ABAP source code MCDOKCHN2 - documentation and ABAP source code MCDOKCHN - Change Person Responsible for Documents MCDOKCHN - Change Person Responsible for Documents