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: 
karthikarjun
Active Contributor
0 Kudos

Hi,

As we know SAP Next transformations are SAP Fiori/UX design approach. The main agenda for this transformations are to reduce more number of clicks in SAP Screen and Code Once RUN on ANY DEVICE.

Scenarios:

- Tablet/Mobile

- WareHouse Area

- Wifi Health : weak

- Assume my user id have thousands of records. If I am calling all the time to hit GW services, my application performance will move to Bad health. So what to do?

Sol: OFFLINE DATA

Here is the solution to solve this problem. While rendering SAP UI5/Fiori application (view) we should call services at one time and use below code to store all user details into local memory ( Not in application memory).

var filePath = "MyFileName.JSON";

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(FS) {

     FS.root.getFile(filePath, {create:false, exclusive:false},

         function(fileEntry) {

             fileEntry.file(function(file) {

          var reader = new FileReader();

          reader.onloadend = function(e) {

          funCall(this.result);

          };

          reader.readAsText(file);

          });

         }, fail);

  }, fail);

function fail(){

  var objJSON = null;

  funCall(objJSON);

  }

Based on create:false/true flag, we can read or create new file from/to local memory.

This way will helps you to do offline functionality :smile: .

Thanks,

Karthik A

1 Comment
Labels in this area