Skip to Content
0
Former Member
Nov 17, 2010 at 11:28 AM

Unable to automate deletion of old data (requests) from InfoCube using a PC

38 Views

Each week I copy open Notifications into a 'SnapShot' cube, from the Transaction Cube, using the current date to make it a unique copy/snapshot for that week. This is then reported on showing, amongst other things, the trend of open Notifications throughout the year.

In an effort to ensure this doesn't grow too big, I will only keep a rolling 52 weeks of data. I thought I could use a feature available when creating Process Chains called 'Delete Overlapping Requests from InfoCube' to manage the amount of data held (52 weeks only).

The variant used to delete the requests has been created linked to object type 'Data Transfer Process' (DTP) and the actual DTP used to load the 'SnapShot' cube ... I then click the 'delete selections' button. On the next window I select 'Request Selection Through Routine', then click 'Change Routine'. I entered the following code, which I borrowed from another thread:

data: datum(16) type c,

date type sy-datum.

date = sy-datum.

date = date - 365.

break-point.

concatenate date sy-uzeit into datum.

loop at l_t_request_to_delete.

delete l_t_request_to_delete where timestamp gt datum.

endloop.

  • append l_t_request_to_delete.

p_subrc = 0.

I get a message saying "No Requests for deletion were found'. Any ideas?