cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Multiple Request from Cube Loaded in a Day but Keeping the Latest Request

haque_mirza
Explorer
0 Kudos

Hello All,

Scenario: Dataflow: PSA --> Infocube. There are multiple request that is being extracted in a single day and we need to keep the latest request and delete all other request for that day. So, in that way we will have 30 request in a month.

How to delete all the request for a day, but keeping the latest request in the cube but not deleting the request from previous day. I guess this can be achieved using Process Chain - Delete Overlapping Request from Infocube. I did some testing, but unable to achieve the desire result. Can anyone suggest some options.

Thanks,

Mirza

Accepted Solutions (0)

Answers (4)

Answers (4)

FCI
Active Contributor

You can find a sample code here.

Regards

FCI
Active Contributor
0 Kudos

Why don't you use a routine based "delete overlapping request" ?

haque_mirza
Explorer
0 Kudos

Hi Frederic,

Can you help me with the code, as i searched and didn't get the code for it. Sample code will also help.

Thanks,

Mirza

bhavinvyas
Active Contributor
0 Kudos

Try with selective deletion option,

see this blog which explains how to generate the selective deletion program which you can modify based on your requirement and add it in process chain.

https://blogs.sap.com/2013/08/06/selective-deletion-in-process-chain/

Thanks,

Bhavin

haque_mirza
Explorer
0 Kudos

Hi Bhavin,

Please check my requirement, it’s not based on day/date it’s based upon time on a day. And I already went through that blog also.


Thanks,

Mirza

former_member231709
Active Contributor
0 Kudos

At least, there are two ways for this .

1. If you can modify extractor. Add new field "download date" (for example, with name ZDATLOAD) to the extractor structure (you don't have to add this infoobject to cube) and fill this field in the extractor by loading day (for example, if data is uploaded today then ZDATLOAD = '20191204'). Next, when loading into the cube in the DTP filter, configure the filter for ZDATLOAD by system variable sy-datum . In your process chain after DTP (to cube) insert process "Delete Overlapping Request" for your DTP.

2. If you can't modify extractor. Add to cube new characteristic "download date" (for example, with name ZDATLOAD) and fill this char. in transformation from system variable sy-datum (day of uploadinf data). In your process chain after DTP insert a program to selective deletion data by ZDATLOAD. f.ex: https://archive.sap.com/documents/docs/DOC-11751

The first option is better.

haque_mirza
Explorer
0 Kudos

Hi Eugeniy,

Can you please explain the first option in more details, as i guess you have mentioned your option based upon date, but my requirement is little different. Say on 20191204 we extract data 4 times (say at 2AM, 6AM, 8PM & 10PM), I need to delete the overlapping request based upon the time for a day, so that finally the cube will have 1-request for 20191204 @10PM and all other 3 time request needs to be deleted. So, for a day I will one request in a cube and also the last updated request into the cube. Also we have Date & Time is available in the extractor.

Thanks,

Mirza

former_member231709
Active Contributor
0 Kudos

Add the "download time" to extractor and in chain process "Delete Overlapping Request" write a routine to analyze time of requests and deleting their. Or you can adapt Bhavin Vyas solution (based on selective deletion)for your requirements