cancel
Showing results for 
Search instead for 
Did you mean: 

Selective Deletion For DSO and InfoCube...

former_member189979
Participant
0 Kudos

Dear All,

I'm working on SAP NetWeaver BW 7.3 and I have a scenario in which I need to delete the contents/data of DSO and InfoCube for Current Year/Month. I will load daily current month data and need to schedule the deletion of current month/year records from DSO and InfoCube before loading the new records. Say; today is 11-06-2015 and I have to delete previously loaded data which will be from 01-06-2015 to 10-06-2015 and then I will load new data till today (11-06-2015).

1. How can I make this "Selective Deletion" automatic for DSO and InfoCube for currently Year/Month data deletion?

2. Is there any variant for Process Chain to be utilized for this particular task?

3. How can I achieve this particular task in hand?

I will appreciate your reply.

Many Thanks!

Tariq Ashraf

Accepted Solutions (0)

Answers (9)

Answers (9)

saurabh301
Explorer
0 Kudos

Hi Tariq,

I am considering your cube name as ZCUBE and field which you are planning to use for selective deletion is 0CALDAY.

The automation can be done using below steps:

1. Goto Tcode DELETE_FACTS.

2. Provide the ZCUBE in data target and ZCUBE_SEL_DEL in Name of report.

3. Click the radio button "Generate Selection Program" and press F8.

4. Goto Tcode SE38 and edit mode of ZCUBE_SEL_DEL.

5. Seach for the line " L_SX_SEL-IOBJNM = '0CALDAY'

6. Add the code written below just after the clear  L_S_RANGE statement.

 

     C0XX-high = sy-datum - 1.

     d_mon = C0XX-high+4(2) - 1.

     concatenate C0XX-high(4) d_mon C0XX-high+6(2) into C0XX-low.

     (There will be an if statement before L_SX_SEL-IOBJNM = '0CALDAY' like IF NOT C0XX[] IS INITIAL". Replace the XX of C0XX with the numeric value which apperars in the if statement.)

     declare a variable as

      data: D_mon type LFMON.

7. Save and activate the report.

8. Create a variant and specify any value for the 0CALDAY ( to and from date)

9. Include this program and variant in ABAP process variant of the process chain just before you load the data.

Hope this helps.

Please test the code once to be sure.

Thanks,

Saurabh

former_member214415
Active Participant
0 Kudos

Hi Tariq Ashraf,

What is your data source? If data source is delta capable then do delata load.

Thanks

Swapna Jain

former_member186445
Active Contributor
0 Kudos

what are you loading in BI? also full per month or a delta? if you're doing a delta to psa/dso, no need to delete the data.

just with the info you've given you should be able to have this running ok with the step delete overlapping requests from infocube in your process chain.

don't see any reason why you should do a selective deletion. by the way a selective deletion on a dso is not that simple. there's a how to paper available on scn, but it requires some work to have it up and running without any loss of data.

Br,

M.

ekta_wadhwani
Explorer
0 Kudos

You may use the Process Type ABAP Program in your Process Chain. Use tcode Delete_facts and generate the program for your infoprovider/Infocube.

Then you may give the selection for current month in calmonth as sy-datum.

I have used this selective deletion program in one of my project to delete the content of Infocube.

You would find many PDFs on how to implement this.

Thanks,

Ekta

former_member189979
Participant
0 Kudos

Hello Ekta,

Thanks a lot for your reply. This what I'm looking for, as I have to retain my historical data (from Jan, 2014 to May, 2015) and first delete current month loaded data into InfoCube and then reload current month data into InfoCube; extraction is not a problem. But how to automate/schedule current month deletion is a challenge or task in hand.

Would you please share or elaborate more on your tried/tested solution for this?

Many Thanks,

Tariq Ashraf

ekta_wadhwani
Explorer
0 Kudos

Hi Tariq,

In my project I was getting one year to date file which contains data for all the months starting from jan till current month.

Frequency of file: every month

To avoid duplicate data : I was required to delete previous file and reload.

therefore, I used selective deletion program in which I have derived calmonth from sy-datum and set that calmonth on selection screen of generated selective deletion program.

tcode : DELETE_FACTS

enter the name of Infocube

click on radio button : generate selection program

System will generate a program name

copy that program name to Z- name and then you can edit the program as per your requirement;save the variant.

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

for cube - use the process chain step - delete the data target form the info cube - while loading to cube.

it will delete the total data while loading to cube as per today.

DSO - use above option for DSO also

delete the change log table -> in 7.x have delete the change log table while for pervious days (30 or 60 days or 1 month ) depends on the requirments.

use the process chain setp - change log table deletion.

PSA data - use the proces chain setp - delete the PSA request.

in generally we will keep the data in change log table and PSA table - will delete it every 3 months as per client requirment.

Thanks,

Phani,

former_member189979
Participant
0 Kudos

Hello Phani,

Thanks a lot for your reply. As, I have mentioned before that my source system is "DB Connect" and I have loaded a historical data for previous year: 2014 and data for 2015, Jan to 2015, May. Now, I have to delete only the current month data into InfoCube and reload it again from "View/Table" for the current month. I know that manually I can use the "Selection Deletion". But I need to automate or schedule this process for every new month; which will be my current month. I just need to delete current month data till yesterday and reload it again including today's records as well.

Many thanks!

Tariq Ashraf

Loed
Active Contributor
0 Kudos

Hi,

Do a selective deletion on your DSO and CUBE..

Afterwards, do a FULL LOAD from PSA extract 6/1/2015 to 6/11/2015 and do a DELTA load fr PSA to DSO and DSO to CUBE..

Regards,

Loed

former_member189979
Participant
0 Kudos

Hello Loed,

Thanks a lot for your reply. But I don't want to do this manually on daily basis, I need to automate/schedule it. I have to retain the historical data (from Jan, 2014 to May, 2015) and need to reload the current month data after deleting the previously loaded current month data.

Many thanks!

Tariq Ashraf

former_member182346
Active Contributor
0 Kudos

Hi,

It doesn't sound like one time activity. Do you want to do it on regular basis for whole month ? if yes then what is the loading strategy you are planning.

There are steps available in PC where you delete the previous request and load new called delete and reload.

First you need to identify which kind of loading strategy you want to adopt.

As suggested by Els - it is always better to go ahead with delta where ever possible.

Thank-You.

Regards,

VB

former_member189979
Participant
0 Kudos

Hello Vinod,

Thank you so much for your reply. Yes, I need to perform this activity on daily basis for current month only. I have to retain the historical data (from Jan, 2014 to May, 2015) into my InfoCube. I know, I can do it manually by using "Selective Deletion" for the current month. But how can I achieve this particular task for this month: June, 2015 and for next months as well.

How can I automate this task or schedule it?

Many thanks!

Tariq Ashraf

Former Member
0 Kudos

Hi Tariq,

Why don't you use delta loads towards your DSO and cube ?

Kind Regards,

Els

former_member189979
Participant
0 Kudos

Hello Els,

Thanks a lot for your reply. As, I have mentioned before that my source system is "DB Connect" and I have loaded a historical data for previous year: 2014 and data for 2015, Jan to 2015, May. Now, I have to delete only the current month data into InfoCube and reload it again from "View/Table" for the current month. I know that manually I can use the "Selection Deletion". But I need to automate or schedule this process for every new month; which will be my current month. I just need to delete current month data till yesterday and reload it again including today's records as well.

Delta loads from DSO and to InfoCube will not serve my purpose at all.

Many thanks!

Tariq Ashraf

former_member183241
Active Participant
0 Kudos

HI Ashraf,

As per your requirement, You have to delete previous data and upload data to till date(full upload). you can follow below process.

1) Delete Data from PSA, DSO and CUBE

2) Load Full Data.

There is an variant available for delete All content from PSA, DSO and Cube in process chain, Please use 'Complete Deletion of Data Target Contents' variant for Cube and DSO data deletion and 'Deletion of Requests from PSA' variant for PSA Deletion.

Regards,

Kashif Ali Khan

former_member189979
Participant
0 Kudos

Hello Kashif,

Thanks a lot for your reply. My DataSource is DB connect source system DataSource. I have loaded historical data for previous year:2014 and previous months (Jan to May) and I have retain my historical data. Since, I'm getting my data from a DBMS/DB and for some reason I have to delete and reload current month data on daily basis and retaining the historical data into InfoCube. Therefore, I can not use your suggested solution.

What else I can do to achieve this?

Many Thanks!

Tariq Ashraf

former_member186445
Active Contributor
0 Kudos

if you have a new datasource, you could create a second cube for the new source and keep historical data in your first cube. create a multicube holding the two cubes and your problem should be solved.

M.