Deleting Master Data in the Cloud

Introduction

When the master data are sent from SAP to the Cloud (e.g. Activity Codes based on SAP Inspection Catalog Codes), the IDocs are generated – every IDoc corresponds to one master data object. The IDoc contains the main segment (different one, depending on the object type). The segment contains a field playing the role of an identifier of the object. E.g. in case of Activity Code based on SAP Inspection Catalog Codes the IDoc with IDoc Type /PACG/ECM_ITYPE_SRERRCOD is issued for every Activity Code. The IDoc contains a segment /PACG/ECM_IS_SRERRCOD, the field ID identifies uniquely the object in the Cloud:


Every FSM Cloud Connector IDoc contains a segment /PACG/ECM_IS_CONTROL, playing a role of a control segment. The field TRANSACTION_TYPE informs the Cloud whether the object is to be created in the Cloud (or updated, if it exists) or deleted:

  • 'C' – corresponds to the creation/update request,

  • 'D' – corresponds to the deletion request.

 

If you want to delete the given object in the Cloud, you must create an IDoc with TRANSACTION_TYPE = 'D'.

Sending deletion requests using the programs sending the objects

Many programs sending master data from SAP to the cloud contain a checkbox "Delete flag", e.g.:

In that case the selected objects will be sent with TRANSACTION_TYPE = 'D' – they will be actually deleted in the Cloud. This approach can be useful if we have the master data object in SAP and we want to send it together with the information that it is to be deleted.

Using transaction /PACG/ECM_SEND_DELRQ

It can be the case however, that the object does not exist in the SAP any longer and we want to delete it in the Cloud as well. In that case resending this object with deletion flag is problematic. In that case the transaction /PACG/ECM_SEND_DELRQ can be used.


Two ways of usage of this transaction are possible:

  1. We know the identifiers of the objects; we want to delete the object in the Cloud for the given identifiers.

  2. We do not know the identifiers of the objects, we rather would like to say "delete the objects which were created from SAP by the IDocs type X, created within last Y months".


In that case the IDoc with IDoc Type /PACG/ECM_ITYPE_OPERATION, Message Type /PACG/ECM_OBJDELREQ is used. The IDoc is generic, its data contains the object type used in the Cloud (e.g. ACTIVITYCODE) and the identifier sent by SAP (e.g. G5ZKAMCAU2).


Tip: Open the XSLT Transformation and locate the node "idElement" to find out, what Cloud Message Type should be used:

Deleting the objects for the given identifiers

You know, that you want to delete the Activity Codes with the identifiers X1 and X2. Execute the Transaction /PACG/ECM_SEND_DELRQ with the following Selection Screen:


You provide the identifiers in the field "Object key":


The following protocol is generated:

Deleting the objects based on the IDocs sent

You don't know the identifiers of the objects which are to be deleted. Instead the objects which have been created by the outgoing IDocs should be retrieved from the database, their identifiers should be collected and then the deletion request should be sent. You execute the program providing the selection criteria for the IDocs search:

Enter the following fields:

  • Basic type: the IDoc type of the IDoc:

  • Segment type: The Segment name, in which the Identifier is passed:

  • Field name: field holding the identifier of the object:

  • Created on: date range, when the IDocs were created.

It is good practice to execute the program with the parameter 'Write Identifiers on Screen" = X and "Test Mode" = X. In that case the outgoing IDocs will not be created and the identifiers determined by IDoc search will be written on the screen:


Once you have verified the identifiers, you can uncheck the "Test Mode" – the IDoc with deletion request will be sent to the Cloud:

 

If you'd like to help us improve the documentation, please provide your feedback using the communication channels listed /wiki/spaces/PFCC/pages/1561427969. Learn about support possibilities here.