Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Selective Delection in DSO by date

$
0
0

Hi Rogerio,

 

Adlins third link (http://scn.sap.com/docs/DOC-26875) is a great solution.

 

Read it first to get an understanding of the type of approach to the solution.

 

Below is a variation of the above solution that is more optimised for performance and written in sequence of the build activities you will need to do.

 

A ‘5 day old’ requirement is fundamentally driven by the needs of the down stream data targets. It is not in any way related to the fundamental design of the DataProviders and their DataSets supplying the data to the DataStore.

 

With this insight you can safely proceed to apply your logic to the DataStore with special consideration to the down stream DataTargets. A few points to note:

  • The DataProvider(s) that supply the data to the DataStore need to pass all their new records in, exactly as they currently are. No change required. Their DTPs will still have all your current selection filters but will not have anything to do with the ‘5 day old’ requirement;
  • This means the DataTargets activation process is generating true delta records into its change log table. Excellent.

 

Now we add a circular load on the DataStore itself and apply the ‘5 day old’ requirement here. Create an InfoSource that contains only the following InfoObjects:

  • All the InfoObjects that define the semantic key of the DataStore.
  • The 0RECORDMODE characteristic.

 

Now create two transformations. One from the DataTarget to the InfoSource and the second from the InfoSource back to the same original DataTarget. Map all InfoObjects as straight through for the transformations.

 

Create a DTP that is a FULL load. We want to process all records in the active table of the DataStore every time this DTP is executed.

 

Add a start routine to the first transformation, the one from the DataTarget to the InfoSource. This start routine will be looping through all records and will have access to all InfoObjects of the DataStore. Within the loop that processes the current DataPacket in the start routine we can now assess the date of each record and determine if it should be deleted (older than 5 days) or kept (5 days old or younger).

 

The action to be done is determined by the value assigned to the 0RECORDMODE characteristic.

 

<source_fields>-recordmode = ‘D’. “This record will be deleted from the DataTarget.

 

<source_fields>-recordmode = ‘ ’. “This record will be kept in the DataTarget.

 

Note: The kept record is assigned a “SPACE”, ASCII 32 (#20 hex), “Blank” character value, not an empty string. A “ “ character value is used to identify what is known as an “After-Image” record.

 

Once your have processed all the records in the DataPacket you can apply a second piece of code to optimise the load time by only allowing the records to be deleted to be loaded back into the DataTarget.

 

delete source_package where recordmode = ‘ ’.

 

Each time you execute and activate the full circular load on the DataStore you will remove records from the active table and also capture a 100% accurate delta load generated into that DataStores change log table for all the dependant down stream DataTargets to get their data from this DataProvider.

 

You will need to add this circular load into your process chain. It should be done after all DataProviders have been loaded and activated into this DataTarget and before any of the down stream DataTargets are loaded.

 

Result: The ‘5 day old’ requirement has been implement on the DataStore, optimised for delta loading into down stream cubes and easily integrated into the nightly load window.

 

Hope this helps.

 

Kind regards,

John.


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>