Skip to Content
Technical Articles

Convert BW Extractor From Full To Delta – In 3 Easy Steps : Infopackage Routine

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
You must be Logged on to comment or reply to a post.
  • Thanks for sharing this.

    Is it applicable only where created and changed on dates are available ?

    also , we  can also create Function module based datasource in the source system if both the date fields are available for custom extractors...

    • You can implement infopackage routine where you can estimate increments. It can be by date, by number range etc.

      I can across a requirement where a very large WBS master data delta pointer got deleted and init without data transfer was not available option, this IP routine saved the day. Till we found wide open window for reinitialization.  One can always resort to DS creation baed on Function module/ cds/ table views etc, though there are alternate and much simpler option available if the requirement is simple enough to implement

      thanks,

      Debjit