cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186445
Active Contributor
0 Kudos

to derive timestamp from date/time, use convert statement in abap

eg.

CONVERT DATE sy-datum TIME sy-uzeit

INTO TIME STAMP timestamp TIME ZONE 'UTC+2 '.

former_member209702
Active Participant
0 Kudos

HI Tony,

Please check whether the timestamp value you are popolating i filed datum with the following statement:

concatenate date sy-uzeit into datum.

has same data format and type as the timestamp for the request.

If this is not same then you will not be able to find any request corresponding to timestamp.

- Geetanjali