Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
DebjitSingha
Active Contributor

Introduction:


In past we did some fun exercise, where we tried to automate BW extraction via process chain and extractor under consideration only supported full extract. Goal was to figure out a way to extract delta only records without implementing delta logic in source system (ECC). Instead we tried to replicate logic in BW side itself.

Let me apologize for this clickbait kind of headline 😊.
We are not actually converting full extractor into delta. Instead I am  applying workaround via Infopackage filter code, that lets full extract pull delta records only. This infopackage based code can be applied on standard or custom extractors.

Prerequisites:


Business logic supports date or timestamp based delta selection at the source table or view itself. This means source table or BW extractor must have fields like created on, changed on etc. These date fields are available as selection in BW extractor.

Example:


In this exercise we are considering 0WBS_ELEMT_ATTR extractor and this supports delta out of the box. Though I am assuming that extractor only supports full extraction.

I know quite silly!!! to use a delta extractor and pretend as if this is full extractor 😊 but should be enough for this demo.

Step 1: Create two Infopackages 


Lets create two infopackges one for changed date (AEDAT) and other based on created on date filter (ERDAT).

Step 2 : Add Infopackage selection code.

BW send full extraction request to source system, though the request is tagged with filter conduction. One with created on date and other changed on date.  ABAP code checks system date and pass that value as filter.

This will take care of change records on current day.


This will take care of newly created records on current day.



*******************************************************
* Select and pass system date as infopackage filter
*******************************************************
data: l_idx like sy-tabix.
data: lower_limit LIKE SY-DATUM.
data: upper_limit LIKE SY-DATUM.
upper_limit = sy-datum .
lower_limit = sy-datum - 1.
read table l_t_range with key
fieldname = 'AEDAT'.
l_idx = sy-tabix.
*....
l_t_range-low = lower_limit.
l_t_range-high = upper_limit.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.

modify l_t_range index l_idx.

p_subrc = 0.

*******************************************************
* End of code
*******************************************************


If required we can set safety limit by adding offset to lower limit. Say 2-3 days of overlapping records. In case extraction failed or to address system downtime scenarios.

Step 3: Add both Infopackage into daily process chain.


Now instead of full IP add newly created IP's in process chain.

 

Conclusion:


Above short tutorial shows how to add code in Infopackge and take advantage filters. Here we used IP filters to extract only change and new records. Even though extract may support full extraction only. Same extraction can be done via manual date selection in IP. Though the goal was to automate the extraction via scheduled Process Chain.

Disclaimer:


This was done as part of fun exercise and are not intended for production scenarios. This does not mean one can not use this. If required please preform proper testing and tuning before implementing this in production.
3 Comments
Labels in this area