Show TOC

Configuring SAP Fiori Apps for Offline UseLocate this document in the navigation structure

While preparing an SAP Fiori app for offline use, you can configure, for example, the following:

Bundling SAP Fiori Apps in Different Packages

There are user groups that need different offline apps. For example, some users only need the My Contacts app in offline mode, some need the My Contacts and the My Accounts app.

For each package of offline apps that you want to create, in Preparing SAP Fiori Apps for Offline Use, in step 2, do the following:

  1. In appConfig.js, in the bundleID property, enter a unique bundle ID.

  2. In the applications property array, only enter the values for the reuse library and the apps that are part of this package.

Displaying a Custom Name for the Offline App

On the mobile device of the user, a custom name for the offline app shall be displayed.

In Preparing SAP Fiori Apps for Offline Use, in step 2, do the following:

  • In appConfig.js, in the appName property, enter the name that the offline app will display.

Displaying a Custom Icon for the Offline App

On the mobile device of the user, a custom icon for the offline app shall be displayed.

In Preparing SAP Fiori Apps for Offline Use, after step 3, do the following:

  1. After the packager successfully downloaded the required assets from the front-end server, access the target directory where the packager assembled the data.

  2. For each operating system, in the /res/<OS>/icons folder, replace the icons with custom icons.

    Make sure that you provide matching icon names and resolutions.

Preparing Extended SAP Fiori Apps for Offline Use

You have extended an app and then want to make it available in offline mode.

Prerequisites

You have extended an app that is enabled to be available in offline mode.

The extended app contains the delta information compared to the original app. Therefore, you have to package the original and the extended app, but can decide which ones to display on the users' mobile devices.

For more information, see the app-specific documentation.

Procedure

  1. Make sure that the extended app contains a manifest.json file.

    If the manifest.json file is missing, copy it from the target folder of the app that you extended.

    Update the id and in sap.platform.abap, enter the path where the extended app is stored.

  2. Only if you redefined the back-end OData service and you do not use the CRM_ODATA back-end OData service:

    1. From cus.crm.lib.reuse, copy the sap.mobile section and paste it into manifest.json.

    2. Change serviceRoot so that it points to the redefined OData service, for example:

      serviceRoot: /sap/opu/odata/sap/ZCRM_BUPA_ODATA

  3. Only if you want to change definingRequests to define which data is synchronized with the back end:

    1. From cus.crm.lib.reuse, copy the sap.mobile section and paste it into manifest.json.

    2. Change definingRequests as required.

  4. Make sure that the extended app contains a resources.json file.

    resources.json lists all files of the extended app.

    If the resources.json file is missing, copy it from the target folder of the app that you extended and change it as required.

  5. Prepare the extended app for offline use.

    In the applications property array of the appConfig.js file, provide the following properties:

    • If you do not want to make the original app available on the launchpad, do not specify the intent property. That is, do not enter or delete the intent property.

      For example, for test purposes, you might want to make both the original app and extended app available.

    • For the original app: Set reuse to true.

    • For the app that contains definingRequests in the manifest.json file: Set scenario to true.

      By default, this is sap.cus.crm.lib.reuse.

    • In title, enter the name that the extended app should display.

    For the extended app, enter the following properties:

    Enter the values for the id, intent and url that you defined for the extended app.

    The following example shows an applications property array with an extended app:

    "applications": [
        {
           "id": "cus.crm.mycontacts",
           "title": "My Contacts",
           "url": "/sap/bc/ui5_ui5/sap/crm_mycont",
           "reuse": true
        },
        {
           "id": "cus.crm.myaccounts",
           "intent": "Account-MyAccounts",
           "title": "My Accounts",
           "url": "/sap/bc/ui5_ui5/sap/crm_myaccounts"
        },
        {
           "id": "sap.cus.crm.lib.reuse",
           "url": "/sap/bc/ui5_ui5/sap/crm_lib_reuse/sap/cus/crm/lib/reuse",
           "reuse": true
        },
        {
           "id": "poc.fiori.contacts",
           "intent": "ContactPerson-ZMyContactsExt",
           "title": "My Contacts Ext",
           "url": "/sap/bc/ui5_ui5/sap/zcrm_mycontacts",
           "scenario": true
        }
    ] 
  6. In Preparing SAP Fiori Apps for Offline Use, after step 3, do the following:

    After running the downloadfromfes command, in the Component.js file, comment out the following sections:

    The values of the  sap.ca.serviceConfigs  array. For example:

    metadata: {
    config: {
    "sap.ca.serviceConfigs": [
        //{
        //name: CRM_BUPA_ODATA",
        //serviceUrl: "/sap/opu/odata/sap/Z_CRM_BUPA_ODATA/",
        //isDefault: true,
        //useBatch: true,
        //countSupported: true,
        //mockedDataSource: jQuery.sap.getModulePath("cus.crm.mycontacts")+"/model/metadata.xml"
        //}, 

    The module registration for the original app. For example:

    //jQuery.sap.registerModulePath("cus.crm.mycontacts","/sap/bc/ui5_ui5/sap/crm_mycont"); 
  7. Continue with building the package.