Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delta based data distribution with changing selection conditions - advice needed

egor_malov
Contributor
0 Kudos

Dear colleages,

In my z-development I have some record type that is maintained in SAP system and is supposed to be distributed to external non-SAP system.

There is a lot of data, so it should be possible to pass changes/delta.

I decided on the approach that is commonly used in offline scenarios:

  • (when a record is saved) track every change (including deletions) with timestamp in a special Exchange Table
  • (when the client code requests delta data) quiery this table to get subset of records that were changed since the previous sync session (via delta token)

This approach is described in several blog posts, for example https://blogs.sap.com/2015/04/07/3-how-to-implement-lightening-fast-odata-services-with-exchange-tab...

My question is how to extend this approach to the case when you want to distribute only subset of records, and this subset is defined dynamically.

Here is an example:

Let's say my record type is 'product' that has 'category'.

Initially there are 10 records in my table ( 5 sort of fruits (category = fruit) and 5 sorts of vegetables). And they are perfectly synced into the receiving system.

At some point it is decided that only specific categories (currently, fruits) should be replicated. So, I need somehow to arrange that there are only fruit records left in the receiving system.

I can see two ways to notify the receiving system:

1. in response to the next delta request return an error 'no delta load is possible, full load needed'

2. provide a list of pseudo-deleted records (that are not really deleted in the source system, but should be deleted in the target system as they no longer match the criteria).

Way 1 seems ok to me (not very efficient, but customizing data are not going to change often, so not too many extra full loads) .

Way 2 looks too complicated in implementation.

Which one do you think is better?

I have some experience in building OData entity sets, but not with delta ones, so maybe there is some canonical approach to this problem I don't know of?

1 REPLY 1

former_member1716
Active Contributor

Your Second option seems to be a better one, Up to my Knowledge i don't see other approaches to this scenario.