cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete documents uploaded via the Report Management function

Former Member
0 Kudos

Hi,

I have a question about SAP REACh Compliance (v1.1), which is related to document uploading and removal.

I would like to know how to delete documents uploaded via the /TDAG/CPI08 transaction that can accessed from the Compliance Workbench transaction (/TDAG/CPM00). This functionality can be used to assign documents to Specification objects.

The issue that I have is not related to document uploading, but how to remove documents that have been uploaded. From the Compliance Workbench one can access the Report Management transaction (CG50) to access the documents uploaded. However, I have been unsuccessfull so-far in deleting documents from the CG50 transaction. Can anyone explain me how to do this?

Regards, Maarten

PS. I am aware that any document uploaded will be stored in the SAP DMS. As such, I am able to remove the document over there by means of flagging the document for deletion. However, the entry in the CG50 transaction remains, while the document cannot be opened (because it has been deleted offcourse).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maarten,

Use BAPI_DOCUMENT_DELETE or BAPI_DOCUMENT_DELETE_DIRECT to delete the documents marked for deletion.

Input the documents to be deleted, and execute the BAPI to permanently remove the DIR along with the original files.

Regards,

Pavan

Former Member
0 Kudos

Hi Pavan,

Many thanks for your reply.

I have tried this before. Doing so, as you suggest, will remove the document.

However, the reference to the document remains on the Report Management (CG50) screen. It looks like I am still able to access the document. Clicking on it will, however, result in a message saying the document has been removed. I would like to be able to remove the reference to the document on the Report Management screen (CG50) as well.

Greatfull if you can share with me how to do this.

Regards, Maarten

Former Member
0 Kudos

Hi Marteen:

You might want to try c1f3_reports_delete... the other option is to check some of the EHS specific document header tables - like ESTDH, ESTDJ and ESTDO.

I hope this helps.

Rob

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Maarten,

In EHS, to delete any document from DMS you have to use function module 'C1F3_REPORTS_DELETE'.

But before using 'C1F3_REPORTS_DELETE', the 'C1F3_REPORTS_READ' have to be called first.

Below the sample code you can try.

DATA: ls_scenario TYPE espap_scenario_type,

ls_addinf TYPE rcgaddinf,

  • Pass the recn in li_header

ls_scenario = '02'.

ls_addinf-valdat = sy-datum.

CALL FUNCTION 'C1F3_REPORTS_READ'

EXPORTING

i_scenario = ls_scenario

i_addinf = ls_addinf

i_flg_header = 'X'

IMPORTING

e_flg_lockfail = lw_lf

e_flg_error = lw_err

e_flg_warning = lw_war

TABLES

x_api_header_tab = li_header

EXCEPTIONS

no_object_specified = 1

parameter_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'C1F3_REPORTS_DELETE'

EXPORTING

i_addinf = ls_addinf

  • I_FLG_CHECK_ONLY = ESP1_FALSE

  • I_FLG_ALE_MODE = ESP1_FALSE

i_flg_header = 'X'

  • I_FLG_SUBJOIN = ESP1_FALSE

IMPORTING

e_flg_lockfail = lw_lf

e_flg_error = lw_err

e_flg_warning = lw_war

TABLES

x_api_header_tab = li_header

  • X_API_SUBJOIN_TAB =

EXCEPTIONS

no_object_specified = 1

parameter_error = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'C1F3_REPORTS_SAVE_TO_DB'

EXPORTING

i_flg_commit = 'X'.

.

Regards,

Mandeep