cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine Data Deletion

Former Member
0 Kudos

Dear Experts,

Good Day!

We have a custom data source which is not delta capable. But, the data will be changed periodically.

In order to behave this data source as delta capable, we are loading this data periodically (1h interval real time timestamp) with some workaround.

That is, records that are fetched from the data source in the 1h interval are taken and deleted from the target DSO beforehand by a start routine.

Once the records are deleted in the start routine, the new data is then loaded to the target.

Problem is, the above methodology is not recommended by SAP, as it requires deletion of entries in the same database table, for which the data is about to be loaded.

Any ideas on how to overcome this or how to alternatively work this out as a standard practice is highly appreciated.

Let me know for any clarifications and I'm happy to elaborate.

Br, Harish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harish,

If i understand you correctly, you are deleting already loaded data from target DSO (Active table) which have common key in your current loading or source package(PSA->DSO) in Start routine.

Another Option, Load the data (PSA -> DSO) to target DSO with timestamp without data deletion. Then create a self lookup transformation on the DSO with following code in start routine with full upload in DTP.

  1. Fetch the maximum timestamp of the data load i.e newest records with changes.
  2. Based on timestamp value, delete all the newest records from the source package.
  3. Update the rest of the records with RECORDMODE value = "D".
  4. This will delete the earlier records which are not changed in the newest request. And the new request will give you delta records for your further update.


Keep semantic group of key in the DTP load form PSA to DSO to have all the same key in same data package.

Might help you to standardize your data load.

Thanks.

Former Member
0 Kudos

Hi Sumit,

Thanks for your response. I'll try this and update on this.

Br, H

Answers (4)

Answers (4)

yasemin_kilinc
Active Contributor
0 Kudos

Hi Harish,

I have a similar scenario with infocubes. I have never tried with a DSO, you can try that. I use selective deletion for this case. With selective deletion in DSO, create a deletion report. It creates a program, you can use the same code to create your own program. While creating the program you need to read the PSA table of the DSO to determine the records that will be deleted. In the process chain you first load the infopackage (so that PSA is filled), then run the abap program (your own program) then run the DTP.

It works very will with the infocubes, hope it gives an idea for your problem.

Regards

Yasemin...

Former Member
0 Kudos

Hi Yasemin,

I'm planning to implement the self loop transformation with recordmode= 'D' where I don't need to directly delete entries in the db table using a delete statement which is of my prime concern.

However if it didn't work out, I'll try as you suggested. Many thanks.

Br, H

yasemin_kilinc
Active Contributor
0 Kudos

Hi Harish,

Please inform us about how you proceed. I hope that works out

Regards

Yasemin

Former Member
0 Kudos

Hi Yasemin,

I have used self-loop transformation and it works perfectly.

Thanks Yasemin and Sumit for your valuable suggestions.

Appreciate your time.

Br, H

Former Member
0 Kudos

Hi Harish,

Glad it worked for you.

Regards

Sumit

yasemin_kilinc
Active Contributor
0 Kudos

Hi Harish,

Thanks for sharing the solution. I am glad your problem is solved.

Regards

Yasemin...

Former Member
0 Kudos

Hi Harish,

Can you explain in more detail what you wan't to achieve? Now im reading this is what you're doing:

1. Full loads to BW (as delta is not possible)

2. Full load to the DSO

3. in the startroutine you delete all data in the DSO?

4. you load your new data set.

If you are deleting all data before loading it, why not using the varaint in a processchain "delete content of DSO" beforehand loading the new data, as suggested by

Cheers

Former Member
0 Kudos

Hi Mathijs,

See my reply to Anshu.

Br, H

anshu_lilhori
Active Contributor
0 Kudos

Hi,

If you have to delete the whole data and reload the new data again..Then in your process chain just add the two steps:

Delete the data from PSA and Delete the contents of target.

So everytime new data will be loaded and the old data will be deleted.

Why do you require the Start routine for this purpose if you have to delete the whole data altogether ?

I hope this is what you are trying to convey.

Regards,

AL

Former Member
0 Kudos

Hi Anshu,

Thanks for your response.

I do not want to delete the entire contents before loading data, but only those records that are fetched in the one hour time interval are only deleted. For that I have maintained a timestamp field in the DSO that will fetch me the last hour's records.

Assume that I have 200 records coming in the subsequent load and out of which 100 are already loaded in the last hour, then I have to delete these 100 records which I'm performing via start routine.

Problem is, this is not the recommended practice by SAP as I'm deleting the target db entries in a routine for which I'm about to load data. Any suggestions on how to handle this?

Br, H

Former Member
0 Kudos

Hi Harish,

Cant you load using RDA(real time acess) since you load periodicallly every  1 hr.

Delta will be supported as well.

Thanks

Nayab

Former Member
0 Kudos

Hi Nayab,

The data source itself is not delta capable and RDA is out of option here.

Br, H

jino_jose
Active Participant
0 Kudos

Hi

How does this custom datasource is created, Is it on top of view, table or function module. check whether any fields can be used to enable delta.

Why do you want to delete the data. If it is a standard DSO only the changes were updated to the active table.

Thanks,

Jino.

shanthi_bhaskar
Active Contributor
0 Kudos

Hi,

If the target is DSO then why we are deleting..it should overwrite the existing records..

SB

Former Member
0 Kudos

Thanks SB and Jino for your responses.

The datasource is based on function module and there are no timestamp based fields to make it delta capable.

Moreover, it is item level data and chances are that some items will be deleted and hence I cannot use DSO overwrite option.

Br, H