Showing posts with label selective deletion. Show all posts
Showing posts with label selective deletion. Show all posts

Saturday, September 24, 2022

DELETE_FACTS t-code to delete from BW InfoProvider

Normally in case a deletion of data is to be performed it is possibel to be done via RSA1 t-code or in case of BW/4 in its web environment (SAP BW∕4HANA Cockpit). If this task is supposed to be automated, it is possible to leverage deletion process in process chains. However, there is also a dedicated t-code for deleting of data from the fact table of BW’s InfoProviders. It is called DELETE_FACTS t-code. It is associated with ABAP program RSDRD_DELETE_FACTS. The program/t-code is also available in BW/4 based BW systems.

On its input screen, there is one mandatory parameter – Data Target that the BW InfoProvider on top the deletion is performed. Following that input field there are three radio buttons. Each of them controls mode of the program.

In case it is set to “Direct Deletion” the program asks for deletion criteria and deletion itself is performed as a next. The deletion criteria is just a filter that is setup by a user and is used for deletion. Only data that are returned by the filter criteria are deleted.

Next radio button is called “Generate Selection Program”. It generates either GP program for the InfoProv deletion. The generated program contains selection screen that serves as deletion criteria. User can input the filter in here. Once the deletion criteria are provided the deletion can be performed.

Finally, there is third radio button called “Generate Deletion Program”. The report is generated on the fly and the deletion criteria are static only available when the GP is generated. Thus no usage of ABAP program variants in this case.

Instead the GP program a real program name can be given in another option field of the selection screen – called “Name of report”.

The deletion itself is performed in a very interesting way. BW system copies the data are not supposed to be deleted (selection criteria reversed) to temporary DB table. The temp table is a copy of real InoProvider DB table. Next is that the system deletes the original (infoprov) table completely. Not just the data in the table but whole table is dropped. Finally, as a last step the system renames the temp table to original table. Reason why it is doing like that is a performance. You can read more details about this approach in a SAP Note listed below.

More information:

2918552 - [BW Central KBA] Selective Deletion

Thursday, February 28, 2019

Selective deletion logs – reviewed outside RSA1

Selective deletion of data in InfoProvider can be performed on manage screen in RSA1. There is a tab called Content and button Delete Selection that allows this activity. This button displays a pop up window that contains several other button for particular activities.




Main function of the popup is behind Deletion Selection that allows entering selection for the deletion. Once this is done, a job can be setup that will perform physical deletion.

Another button of the popup that I want to focus on is called a Log. This displays an ALV grid display of all selective deletions done on particular InfoProv in past. The grid can be further drilled down to details of each deletion.  Thsi shows all condition/selection that was used for deletion. 

Sometimes I want to evaluate deletion logs outside the RSA1 t-code. In order to this there is a Function Module called RSDRD_LIST_ACTION_LOG. Via the FM for which just InfoProv needs to be provided as input parameter the same ALV grid with the all selective deletions done on particular InfoProv in past is displayed.

The FM has another input parameter that is optional called I_WITH_AGGREGATES. This enables to display aggregate deletions at InfoProv as well.

Table which stored deletion logs is called RSDRDLOGHEADER. This si a header table with info on who, when, which InfoProv, Delete Mode and number of records that were deleted.

Detail information on which fields were used for the deletions is stored in table RSDRDLOGPOSITION. Key which links both tables is POSITION_ID.