1

I am trying to extract data from a SAP's Basic Sample Service via OData, I registered. It is working fine in 'normal mode' and is returning like 302 records. What I am failing to get is data in delta mode with like 20 records, instead it is still returning 302 records.

I am hitting this URL. To get data in delta mode I am sending this header Prefer: odata.maxpagesize=20,odata.track-changes

I am very new to this, so please pardon me if I have missed something. Any kind of help would be very appreaciated. Thanks

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
Alex Jones
  • 768
  • 9
  • 23

1 Answers1

1

I believe this annotation is not implemented in SAP implementation of Odata, so you are out of the luck. It is supported though in ODP, but not in Gateway OData.

To enable delta tracking in OData service SAP has its own guidelines:

  1. Generating delta token

  2. Extend GET_ENTITYSET_DELTA method

  3. First OData query on entity set will return a delta token

  4. Which you then use to query delta

    /sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products_DQ?!deltatoken=’005056A2025C1EE2BFE687AFDC2FAAF4_20130807073741′
    

Read this official guide for more info

https://blogs.sap.com/2013/09/30/how-to-implement-basic-delta-query-support-in-sap-netweaver-gateway/

Minimum GW required version: Netweaver 740, SAP_GWFND SP04

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • thanks for the answer man. I was out of luck search about it on web. – Alex Jones Jul 02 '20 at 09:11
  • does this require changes on server side? I don't have access to those – Alex Jones Jul 02 '20 at 09:11
  • yes it does, you need to implement delta handling in service implementation (pt2), also if this service is published using annotation `@odata.publish true` so it doesn't support custom handling and you are out of the luck as well – Suncatcher Jul 02 '20 at 10:01