0

I'm starting to look into adding offline functionality to a mobile app developed in SAP Web IDE on SAP Cloud Platform.

There's some standard SAP functionality that allows an offline data store to be created by simply updated the Manifest.json

"sap.mobile": {
    "_version": "1.1.0",
    "definingRequests": {},
    "stores": [
        {
            "name": "ZSV_SURVEY_SRV",
            "serviceRoot": "/SAPUI5-ABAP-SFI/",
            "definingRequests": {
                "SurveySet": "/Surveyset"
            }
        }
    ]

However, the actual oData used would be far too large to hold offline in practice, so what are the other options ? Can the data be filtered ? and how ?

Is jquery.sap.storage still used?

Adam Harkus
  • 2,050
  • 2
  • 36
  • 64

1 Answers1

0

Your best bet is to use the SAP Offline OData plugin. I used that before with rather good results.

A neat feature is that you can specify which entity sets you want to store offline, so that would allow you to trim down the data that's stored on the device by quite a bit.

Documentation for Kapsel plugin, Offline OData: https://blogs.sap.com/2017/01/24/getting-started-with-kapsel-part-10-offline-odatasp13/

Chris Neve
  • 2,164
  • 2
  • 20
  • 33
  • Thanks. I'm intrigued to know how this flushed back to the online oData though. If I create a new record offline (id = 1), what happens if some else has already taken up id 1 online in the meantime? – Adam Harkus Nov 27 '17 at 12:46
  • Ideally, IDs aren't generated client side. But if they are, I dare say the server can decide how that's handled - either by throwing a conflict or by updating the existing record (bad use case for most scenarios, but still a possibility). – Chris Neve Nov 27 '17 at 12:48
  • See here for more on that: https://stackoverflow.com/questions/42652950/how-to-handle-sap-kapsel-offline-app-odata-conflicts-properly?rq=1 – Chris Neve Nov 27 '17 at 12:49
  • Each entity has a unique primary key (integer). Which is auto generated when a new record is created. I'm not physically passing it in. The link doesn't specifically explain how duplicating this between offline / online is handled. – Adam Harkus Nov 27 '17 at 13:12
  • I can only point you to the doc at this point, I don't remember all the details... I just added the link to my answer! – Chris Neve Nov 27 '17 at 13:20