Skip to Content

As a Product Owner, it is always good to see your product reach a new milestone. Last week, you’ve seen the announcement of Hybrid Application Toolkit release 1805 in Britt’s blog. In this release, we’ve made some fundamental changes in the way we build hybrid apps in the cloud from SAP Web IDE.

It is not my intention to repeat Britt’s blog; but let me just highlight the most important part of this release: Developers have a lot more control on what is packaged into a hybrid app. This opens the door to more possibilities and allows developers to more easily resolve challenges by themselves.

One of the hot topics we did not completely cover in this release is the ability to create offline apps. Many developers have been asking for this. Last December, I’ve announced our plans to ‘end-of-maintenance’ the HAT local add-on. We have provided you one offline specific template in SAP Web IDE (with that I mean the Eclipse Orion based version) that could only be used in conjunction with the HAT local add-on. The template is not available in SAP Web IDE Full-Stack. Our colleagues from SAP Web IDE are now advocating to migrate projects to the Full-Stack version. So how do you build offline hybrid apps in SAP Web IDE Full-Stack, if we don’t provide the template anymore?

Before answering, let’s look back into the history of this toolkit. When we started, we had no cloud build feature. Instead, we were relying on the locally installed tools for developing Cordova apps. There were templates in Web IDE that kept evolving over time. At some point we’ve decided to grab a snapshot of a UI5 Master Detail template and adapt it to support offline. This template was shipped with HAT, the Web IDE plugin. We then tried to keep up with changes in the original template. At some point, the original template was replaced with a Fiori Master-Detail Application template. We did not further update our offline template, unless really needed.

Although we could have created new mobile specific templates in HAT, we actually wanted the opposite: any template should by default support mobile; hence there should not be mobile variants at all. The functionality we’ve provided last year was actually doing this. When the HAT plugin in Web IDE was active, a newly created project was automatically enabled for mobile. We were adding some magic in the background to make this happen. However, although we’ve tried to make it easier, in reality things got a lot more difficult (especially troubleshooting).

We do not plan to provide you an offline template in SAP Web IDE Full-Stack. The main reason is that every app is unique and requires specific customization around the topic of offline. It is very difficult to provide you this as part of a one-fits-all template. Instead, we will give you guidelines on how to implement offline functionality in your app and provide you with an example below.

Creating an offline app based on the Fiori CRUD Master-Detail template

Prerequisites

Updated on 30 May 2018: changed data source to Mobile Service sample data service.

Before we start creating the app, let’s first ensure we can access the Mobile Service Sample Service from SAP Web IDE. In your SAP Cloud Platform cockpit, go to Connectivity > Destinations and create a new destination as shown below. Make sure you add the additional properties as indicated. The url is not completely visible is the screenshot. Please enter https://hcpms-<your account number>trial.hanatrial.ondemand.com/SampleServices/ESPM.svc. I am using a trial account for this blog post. You’ll obviously have to change the url for productive environments.

After saving the destination settings, it can take up to a few minutes to have the new destination active.

Now let’s start creating the app from scratch in SAP Web IDE Full-Stack. You can find this version of SAP Web IDE in your SAP Cloud Platform cockpit’s services list:

Although not required at this point, please make sure you have activated Hybrid Application Toolkit. Once you are in SAP Web IDE Full-Stack, go to the preferences and ensure the feature Hybrid App Toolkit is activated. Don’t forget to save your selection and reload SAP Web IDE.

When using a trial account, you will use the Cloud Build feature based on Mobile Service for development and operations. Customers who access a productive environment could see the following in the Hybrid Application Toolkit preferences (depending on your subscription):

Please ensure the radio button regarding Cloud Build Service is enabled for Mobile Service for development & operations.

Creating a new project from a template

In SAP Web IDE, please select File > New > Project from Template. To avoid possible issues with the latest innovation version, I have selected a CRUD Master-Detail template based on SAPUI5 version 1.52.

In the next step, fill in the details.

In this example I am using the Mobile Service Sample Service to consume OData from a Service URL. We have exposed this service to SAP Web IDE through the destination we have created earlier.

In the Template Customization step, I have selected the following:

Once finished, you can run the application from SAP Web IDE in your web browser. It will show you the data from the data source (read) and you can create new entries (create), change it (update) and remove entries (delete). Also referred to as “CRUD”.

Mobile enable the project

Right-click on your project to bring up the context menu and select Mobile > Enable as Hybrid Mobile Project.

This step will add a ‘mobile’ folder to your project, containing some source files only relevant for when your app runs on a device or emulator (as Packaged app, or Developer Companion app).

Take note that during the cloud build process, the contents of the webapp folder and the mobile folder will be merged into the www folder of your Cordova project. The index.html file in the mobile folder will replace the one in your webapp project (if your project has one).

We’ve decided to use this approach, so you can still deploy the webapp to SAP Cloud Platform.

Creating a hybrid app from this project

You can create a Packaged app based on this project by selecting in the context menu: Mobile > Build Packaged App.

In the first step of the build wizard, you can change the app’s name as visible on your device’s home page. You can also select an app icon and images for the splash screen.

In the next step, you indicate for which platform you want to build your app. You’ll need to provide a valid the signing profile. Currently, we only have one UI5 version to select from. We will add more versions later.

At this point you can hit the Build button. Once the Cloud Build Service is finished generating your app, a QR code and hyperlink will be displayed, so you can download the app onto your device.

During this build process, Hybrid Application Toolkit will automatically create a new application on Mobile Service, and also create the related Cloud Platform destination for you.

Adding Cordova plugins (optional)

Although not related to the offline topic, I have received several queries on how to add Cordova plugins. So let’s quickly discuss this.

In case you want to make use of one or more of the more than 2300 publicly available Cordova plugins in your project, open the context menu and choose Mobile > Select Cordova plugins. You can browse and search for plugins. Once you are done, make sure to save your selection.

When you trigger a new build, the plugins will automatically be added in your Cordova app.

Note that there is a tab called “Default (34)”, which does not allow you to make a selection. It merely lists down the plugins we add to your app by default. You’ll notice most of the Kapsel plugins are listed there. You don’t need to select them. They will be part of your app by default.

Adding the offline capabilities

Before we discuss the offline capabilities, I want to highlight one thing regarding Developer Companion: since this type of app is typically an online app, we cannot use Developer Companion for developing offline apps. Offline will only work for Packaged Apps.

Users who have already created offline apps before using our cloud build service are probably familiar with the way to add the Kapsel Offline OData plugin to the project. This is actually triggered by adding a “sap.mobile” section that defines ‘stores’ in the project’s manifest.json. We have kept this in the new delivery, so that existing projects can more easily transition. The content of this section is actually not important anymore. What matters is that this section is there. Before the HAT 1805 release, the content was used in the build process. As long as you specify the bare minimum, you are fine:

	},
	"sap.mobile": {
		"definingRequests": {},
		"stores": [
		]

As a result, your Packaged app built with Cloud Build Service includes the SAP Kapsel Offline OData plugin. Now we need to add some more code to make use of this.

Initializing the offline store

The file mobile/hybrid/sap-mobile-hybrid.js contains most of the bootstrap code for the hybrid app. You are free to make changes here. We are going to add a function to create and open the offline store that will be used to store the data relevant for the app on the device.

    openStore: function() {
        console.log("In openStore");
        jQuery.sap.require("sap.ui.thirdparty.datajs");  //Required when using SAPUI5 and the Kapsel Offline Store
        var properties = {
            "name": "store_mainService",
            "host": sap.hybrid.kapsel.appContext.registrationContext.serverHost,
            "port": sap.hybrid.kapsel.appContext.registrationContext.serverPort,
            "https": sap.hybrid.kapsel.appContext.registrationContext.https,
            "serviceRoot": fiori_client_appConfig.appID + "_" + mobile_appRoutes[0].destination,

		"definingRequests": {
			"supplierset": "/Suppliers/?$expand=Products"
		}
        };
    
        store = sap.OData.createOfflineStore(properties);
    
        var openStoreSuccessCallback = function() {
            console.log("In openStoreSuccessCallback");
            sap.OData.applyHttpClient();  //Offline OData calls can now be made against datajs.
            sap.hybrid.startApp();
        }
    
        var openStoreErrorCallback = function(error) {
            console.log("In openStoreErrorCallback");
            alert("An error occurred" + JSON.stringify(error));
        }
    
        store.open(openStoreSuccessCallback, openStoreErrorCallback);
    },  

An important piece to mention here is the serviceRoot specified in the properties. The serviceRoot is basically the location where the offline store will fetch its data, indirectly through Mobile Service. In this particular example I am using the Mobile Service Sample Service; but I could easily change this to use a different destination. The Cloud Platform destination used here was automatically generated by HAT, after triggering the build previously. Also note that the above code assumes one single data source and hence, one single offline store. If your app needs to consume data from multiple sources, you’ll need to open multiple offline stores here.

In the same file, the appLogon function needs to be adjusted a little bit. Once the logon is done, we call the newly added openStore function, instead of the startApp function.

		if ('serverHost' in context && 'serverPort' in context && 'https' in context) {
			// start SCPms logon
			sap.hybrid.kapsel.doLogonInit(context, appConfig.appID, sap.hybrid.openStore);

The last item to change is the dataSources uri specified in the project’s manifest.json. For this we need to know the connectivity configured for the application created on Mobile Service for development and operations. Go to the Mobile Service cockpit, select your application and select Connectivity.

You’ll have to construct the uri based on the Mobile Services url, add the Cloud Platform Destination name (and optional: add the relative path). See the example below.

Hardcoding the uri here is actually not a good solution and we are currently looking into improving this aspect. There are 2 issues with the current implementation:

  1. Hardcoding makes it less easy to transport the app to a different landscape. You’ll need to manually modify this uri when you move this app.
  2. The app will no longer work as online app (preview in the browser will fail and when you deploy the app to SAP Cloud Platform, it will also not be able to access the data source). If you want to deploy your app to SAP Cloud Platform as well, then you need to change this uri back to original.

I will update this blog once we have a better solution for this.

Read-only offline app.

Trigger a new cloud build and download your app on your device. After the authentication screen and passcode screen, the screen will go blank for a while. We should actually show something here, so the end-user knows what is happening. This is an improvement to be added later. At this point, the offline store is being synchronised with the backend database. Once this is done, the UI will show up and display the data (this can take around 15 seconds).

You can put your device into airplane mode and continue accessing the data.

Congrats! You’ve built an offline app.

It is nice to be able to Read data when offline, but how about Create, Update and Delete?

The application template is actually already allowing modifications, removal and adding new data entries. But how do we handle this when the device is not connected to the network? The data is simply stored in the on-device offline store. When network connectivity returns, we can synchronise the changes between backend database and on-device store.

To get the latest changes from the backend, we use the refresh function. To upload locally made changes to the backend, we use the flush function.

For the refresh, the most obvious way of implementing this, is as part of the pull-to-refresh. The flush should be triggered once the network connection is back. But for the sake of this demo and making it easier to test, I’ll just add two buttons to the footer bar: a Refresh and a Flush button.

Let’s open the file webapp/controller/Master.view.xml and add the following buttons in the customFooterContent.

	<semantic:customFooterContent>
	    <Button text="Refresh" width="80px" id="__button1" press="onRefreshButton"/>
	    <Button text="Flush" width="70px" id="__button0" press="onFlushButton"/>
	</semantic:customFooterContent>

Now open the file webapp/controller/Master.controller.js and add the following code for handling the button press:

		onRefreshButton: function() {
			if (typeof sap.hybrid !== 'undefined') {
				sap.hybrid.refreshStore();
			}
		},
		
		onFlushButton: function() {
			if (typeof sap.hybrid !== 'undefined') {
				sap.hybrid.flushStore();
			}
		},

I have added the type check to make sure these calls are only done for a hybrid app. The web app should not call these functions.

We will add the functions called in the file mobile/hybrid/sap-mobile-hybrid.js

	refreshStore: function() {
		console.log("Offline events: refreshStore");
		if (!store) {
			console.log("The store must be open before it can be refreshed");
			return;
		}
		store.refresh(sap.hybrid.refreshStoreCallback, sap.hybrid.errorCallback, null, sap.hybrid.progressCallback);
	},

	refreshStoreCallback: function() {
		console.log("Offline events: refreshStoreCallback");
	},

	flushStore: function() {
		console.log("Offline events: flushStore");
		if (!store) {
			console.log("The store must be open before it can be flushed");
			return;
		}
		store.flush(sap.hybrid.flushStoreCallback, sap.hybrid.errorCallback, null, sap.hybrid.progressCallback);
	},

	flushStoreCallback: function() {
		console.log("Offline events: flushStoreCallback");
	},

	errorCallback: function(error) {
		console.log("Offline events: errorCallback");
		alert("An error occurred: " + JSON.stringify(error));
	},

	progressCallback: function(progressStatus) {
		// console.log("Offline events: progressCallback");

		var status = progressStatus.progressState;
		var lead = "unknown";
		if (status === sap.OfflineStore.ProgressState.STORE_DOWNLOADING) {
			lead = "Downloading ";
		} else if (status === sap.OfflineStore.ProgressState.REFRESH) {
			lead = "Refreshing ";
		} else if (status === sap.OfflineStore.ProgressState.FLUSH_REQUEST_QUEUE) {
			lead = "Flushing ";
		} else if (status === sap.OfflineStore.ProgressState.DONE) {
			lead = "Complete ";
		} else {
			alert("Unknown status in progressCallback");
		}
		console.log(lead + "Sent: " + progressStatus.bytesSent + "  Received: " + progressStatus.bytesRecv + "   File Size: " +
			progressStatus.fileSize );
	},

The refresh and flush functions are asynchronous and will take some time. For demo purposes, I’ve kept the implementation rather simple and added some console logging to have an idea of what is going on. For your enterprise mobile applications, you should implement a way to inform the user about progress and update the UI when needed.

After saving all your code changes, please trigger another cloud build. The result will be an app that allows you to work with your data in online, as well as offline mode. You trigger a refresh to update the on-device store. You can flush the changes made in the on-device store to the data service.

What about data conflicts?

There is one important aspect that I will not discuss in this blog: data conflicts. How do you handle errors when data on the service has changed, while your device was offline, and your user also made changes on the same data?

I think this topic is worth a separate blog post.

Conclusion

With this blog post I’ve shown you how to create an offline app in SAP Web IDE Full-Stack. The example code provided is very basic. There is surely room for improvement to get this to production level apps. My goal was to show you the basics here, to get you started quickly. I hope this blog post is useful to you and I encourage you to try it out yourself. You can easily get started using our trial landscape.

Our online documentation is here.

 

Reporting issues

Although I have verified and tested the above flow several times and received confirmation from several users that this works, the results for you might be different. This might be due to interruptions in service availability or changes on the various systems involved. Also take note that I have not tested other scenarios (e.g. on-premise) myself. In case you are running into issues, you can leave a comment below. For SAP customers, partners and colleagues: please raise a (BCP) ticket for component CA-WDE-MOB.

Thank you!

To report this post you need to login first.

111 Comments

You must be Logged on to comment or reply to a post.

  1. Murali Shanmugham

    Thanks for the update Ludo. Happy to see we can now build offline apps using Cloud Build Service. Looking forward for more updates on this topic.

     

    (0) 
  2. Jason Scott

    Thanks for the update on this but I notice that iOS builds are always failing. I’m on an account using the ap1 datacentre…

    (0) 
    1. Britt Womelsdorf

      Hey Jason – Sorry about that…did you open a ticket?  We did have some issues with authorizations when the update was first rolled out but thought that they were all fixed.  What’s the error message you’re getting?

      (0) 
      1. Jason Scott

        Hi Britt, Just iOS failed to build with no further information. Android built and works fine. Its been a week since I last tried so I’m just running a new iOS build with a web-ide template app right now. I’ve tested again today and the iOS build was successful…

        (0) 
  3. Suerz 2017

    Hi Ludo,

    I didn’t get the meaning of your line “Users who have already created offline apps before using our cloud build service are probably familiar with the way to add the Kapsel Offline OData plugin to the project. ”

    Please tell me how to install Kapsel Offline OData plugin.

    Or below piece of code is Kapsel Offline OData plugin :

    },“sap.mobile”:

    { “definingRequests”: {},

    “stores”: [ ]

    Or if there are some certain steps please share that blog or stepwise document.

    Any help will be needful.

    Thanks

     

    (0) 
    1. Ludo Noens Post author

      With that, I meant that if you have created offline apps with Fiori Mobile before, you would have used the same approach and added a mobile section in the manifest. This triggers the service to add the offline plugin. If your project already contains this section, there is no change.

      If you used to build offline apps with HAT local add-on, then you had to select the plugin to be added in the build. There is no way to select Kapsel plugins in the current user interface.

       

       

      (0) 
  4. Former Member

    Hi Ludo,

    nice blog 🙂 How can one add Kapsel Plugins? In the Cordova Plugin Selection Dialog there is no possibility to add or mark a Kapsel Plugin and click the save button. Only the “normal” Cordova plugins got a extra column in which one can click and add the plugin.

     

    Am i missing something?

     

    Best regards

    Nils

    (0) 
    1. Ludo Noens Post author

      Hi Nils, the default list is automatically added by our cloud build service. We have added this list in the UI to inform developers which plugins are added by default.

       

      (1) 
  5. Adam Harkus

    Once the app is built, how can it be included in SAP Mobile Place so that our users can download it?

    Currently, all we have is the APK and the QR code to test manually, with nothing is SAP Mobile Place.

    Previously we had HAT setup to point to Mobile Secure, which did deploy to SAP Mobile Place, however, in this new process HAT points to Mobile Services for Development & Operations.

    Anyway, looks good, and testing the offline functionality now

     

    (0) 
    1. Britt Womelsdorf

      Hey Adam!  SAP Mobile Place is actually not a feature of Mobile Services.  I am very curious about how you’re using Mobile Place – feel free to contact me directly on the topic.  With that being said, for Fiori Mobile customers we did open up Mobile Place to be able to deploy any type of app, not just Fiori Mobile apps.  While a little bit cumbersome I admit, you should be able to download the app from Mobile Services and upload it as an “Enterprise app” to Mobile Place.  Let me know if you get stuck.

      (0) 
    2. Suerz 2017

      Hi Adam,

      Are you able to view offline app??

      I followed all the steps told by ludo but can’t be able to use app in offline mode.

      Thanks in Advance!!!

      (0) 
  6. Adam Harkus

    Thanks Britt.

    Just tried importing my  APK file in Mobile Secure (Enterprise App).

    I get the following error:

    All we’re trying to do is build offline apps, deploy them to a store (Preferably Mobile Place), and from there,notify registered users of updates.

     

    (0) 
    1. Ludo Noens Post author

      If Cloud Build Services is missing, this means you can only use cloud build with Mobile Service for Development and Operations. Are you using a trial account ?

      As for the “loading…”… does this happen on a specific project? Did you follow the steps detailed in the blog on creating a project from the CRUD Master Detail template?

      Regards,

      Ludo

      (0) 
      1. Mario Marković

        Yes, I am using a trial account, testing if our native app can be done in web-ide.

        Yes, I followed the step to create CRUD from the template, even tried with the same version that you use in the tutorial.

        So with witch projects does it happen the mobile loading? Isn’t that web-ide fully stable yet?

         

         

        (0) 
        1. Ludo Noens Post author

          Hi Mario,

          I cannot comment on the Web IDE stability. This only thing I can recommend is to clear your browsers’ cache and reload Web IDE to ensure everything loaded is up-to-date.

          As for the options: on a trial account, we only allow you to use Cloud Build Service through Mobile Service for Development and Operations. Hence, you have no option to select.

          Regards,
          Ludo

          (0) 
          1. Mario Marković

            Oke, I tried to clear cache and reload the app same result, even tried it in Microsoft edge

            When I opened the console I saw there are some javascript errors

             

            Maybe that is the reason that it doesn’t work?

             

            (0) 
          2. Mario Marković

            So I tried it again today and guess what it works 😀 But now I have a different problem when installing the app on android I get Choose certificate then I click select and nothing happens I get a white screen.

            (0) 
  7. Jason Scott

    The built app has weird padding surrounding it. I have created a webide worklist (standalone) template app as a test. I have converted it to a mobile packaged app as per the instructions in this blog post and built it for iOS – testing on my iphoneX.

     

    However when I run the app on my device I see strange whitespace surrounding the app. If I inspect the app with safari debug tools while running on the device I can see that this extra space is not coming from the sapui5 app. Maybe it is some cordova config for the webview?!?

    When I run the app from the WebIDE (even with simulating the i[honeX in Chrome) it does not show these whitespace areas at the top and bottom of the app.

     

    Similar padding is seen all around the app when you rotate it to landscape.

    (0) 
    1. Ludo Noens Post author

      Hi James,

      The issues you are seeing are specific for iPhone X, and maybe some other devices with large screen real-estate.

      I think for now, I can only provide you a partial solution. I’ll have to work with various teams (Kapsel, UI5) to sort this out.

      Set viewport-fit=cover in the meta tag in index.html (the one in the mobile folder).

      Other changes are related to CSS and splash images, which I currently cannot change from the Web IDE project.

      Regards,
      Ludo

       

      (0) 
      1. Jason Scott

        Thanks – will install on an iphone 6 and test….  Can’t test this on an iphone 6 unfortunately… All downloads to install fail about 3/4 of the way through now…

        (0) 
      1. Muthukumar P

        HI Ludo,

        As you said, both the link refers to local HAT setup for APP Update. PackagedKapselapp.ZIP is generated on Local HAT folder and is deployed to cloud

        But,my Customer wants to do everything in the cloud – App Generation and App Update,don’t want to use any local HAT setup. Please suggest a way out for this.

         

        Thanks,

        Muthu

         

         

        (0) 
  8. Jalakam Harsha

    Hi,

    When the application was built as packaged App I goyt the below error?  Any idea if I missed any step, or any configuration missed ?

     

    Below is the error log:-

    Error: /mnt/workspace/offlineAppSB/platforms/android/gradlew: Command failed with exit code 1 Error output:
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ‘:processDebugResources’.
    > com.android.ide.common.process.ProcessException: Failed to execute aapt

    * Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

     

     

    Regards,

    Harsha

    (0) 
    1. Ludo Noens Post author

      Hi Harsha,

      Our build service was facing some trouble with Android builds yesterday. These have been resolved.

      Please try again.

      Regards,
      Ludo

       

      (0) 
    2. Christian Engelmann

      Hi,

      I have the same issue when building the android companion app in the openSAP mobile2 course.

      My installation is:

      • Mobile SDK 3.0 SP15 + SDK 3.0 SP15 PL04
      • node.js Version 3.3.12
      • Git version 2.17.0.windows.1
      • Cordova 6.5.0
      • Kapsel SDK: kapsel@3.15.5
      • jdk1.8.0_171
      • Android Studio incl. Android SDKs 4.4, 5.1, 6.0 to 8.1
      • HAT 1.29.7

      Any help is appreciated! Thanks

      Christian

      (0) 
  9. Laxman Chittepu

    Hi Ludo,

    I tried to build Packaged app and getting the below error. Can you please help with your thoughts.

    “Build Failed with an exception”

    * What went wrong:
    Execution failed for task ':processDebugResources'.

    Regards,

    Laxman

    (0) 
    1. Ludo Noens Post author

      Assuming this was an Android build, we had some trouble with the service yesterday. Please try again.

      Regards,
      Ludo

       

      (0) 
  10. Kai-Markus Lüer

    I have a question regarding the combined URL for the manifest.json:

    We are using a cloud connector for our Fiori applications. The URL shown in the Connectivity window basicly lists the internal system like: https://eXXci.XX.XX.de:XX343 The mobile services URL is completely different: https://mobile-XXXXXX.dispatcher.hana.ondemand.com

    The destinations seems to be fine: com.sap.webide.XXXXXXXXXXXXXXXXX_YYY

    How are we supposed to use/combine them for the manifest.json? Thank you!

    (0) 
    1. Ludo Noens Post author

      Assuming you have created a SAP Cloud Platform destination for you data source, the Mobile Service destination will point to this. The uri needs to reference the Mobile Service destination, which is in the format https://hcpms-<userid-account&gt;.ondemand.com/<mobile service app id>_<destination name>.

      Before going for the mobile app, make sure you can consume your data with the web application (e.g. in preview).

       

      (0) 
      1. Kai-Markus Lüer

        Thank you for your response. Yes, we have created a Cloud Platform Destination. Do I have to name the OData Service itself aswell in the manifest or only in the hybrid coding?

        Best I could get was a 503 error.

        (0) 
  11. Laxman Chittepu

    Hi Ludo,

    Thanks for you prompt reply.

    When I’m trying to build app for iOS by providing the signing profile, its giving below error:

    “Code Signing Error: Provisioning profile “….” has app ID “…”, which does not match the bundle ID “com.sap.webide.x53a22ea63669…..”.”

    Please let me know how to configure bundle ID in SAP WebIDE. I tried to check in Project settings using my webIDE trail account, but could not find same.

    Regards,

    Laxman

     

    (0) 
  12. Tjarliman Rusadi

    Hi Ludo,

    Thanks for writing this blog.

    However, since I am using trial account, I have question when using HAT plugin inside the WEB IDE.

    You mentioned:

    “If Cloud Build Services is missing, this means you can only use cloud build with Mobile Service for Development and Operations. Are you using a trial account ? ”

    How can I user this Cloud Build feature? it there any documentation about this?

    Thanks

    Tjarliman

    (0) 
    1. Ludo Noens Post author

      Our online documentation is here: https://help.sap.com/viewer/8e5c63b6470a4255861c259f3b2d9b41/Cloud/en-US/ff3a6540704040afba7ee5e5a43b14f2.html

      Regards,
      Ludo

       

      (0) 
  13. Laxman Chittepu

    Hi Ludo,

    Thanks for reply related to wildcard bundle id.

    Can you please help me to provide bundle id in SAP WebIDE. I’m using trail account in SAP Web IDE.

    Regards,

    Laxman

     

     

     

    (0) 
  14. Tjarliman Rusadi

    Hi,

    When defining Data Connection in the CRUD template, what should I fill in in the second input field?

    I have tried to put :

    /SampleServices/ESPM.svc/

    /ESPM.svc/

    but none of them were working. Pls. help as I am still new for this.

     

    Thanks and Regards,

    Tjarliman

    (0) 
    1. Ludo Noens Post author

      If you take a close look at the screenshot I’ve provided, then you would see a “/”. That’s all you need.

       

      (0) 
      1. Tjarliman Rusadi

        Hi Ludo,

        Actually i have tried that too.

        Also, here is my SCP – Destination setting, and there seems no problem with this destination after I test its and successfully can connect to the service.

        Regards,

        Tjarliman

        (0) 
        1. Chinmaya Gorachanda Chaudhury

          Hi Tjarliman,

          I can see that you have used the account Name (i.e. p020365trial) in the User field of the Destination “mssampledata”. I believe it should be User ID (i.e. “p020365”)

           

          Please let me know, if it solves your issue.

           

          Thanks and Regards,

          Chinmaya

          (0) 
          1. Tjarliman Rusadi

            Hi Chinmaya,

            THanks for replying.

             

            Actually I dont have issue related to Destination my SCP account. I tested the destination and it is ok.

             

            (0) 
  15. Tjarliman Rusadi

    Hi,

    I decided to use this URL in manifest.js

    “uri”: ” https://hcpms-p020365trial.hanatrial.ondemand.com/com.sap.webide.x974331388bd244e185c25957a8fbe404_Northwind/“,

    like mentioned in the Mobile service definition

    but during synchronization in my phone, it has error saying that “An error occured while communicating with the OData server to retrieve result of request “https://hcpms-p020365trial.hanatrial.ondemand.com:443/…” etc

    so, how exactly to put the correct uri in the manifest.js file.

     

    Regards,

    Tj

    (0) 
    1. Ludo Noens Post author

      The serviceRoot in openStore() has to match with the uri specified in the manifest.json. You can also test the destination in the Mobile Service cockpit, to see whether you can retrieve data.

       

      (0) 
        1. Tjarliman Rusadi

          If I put in browser like below

          but the other one, can successfully retrieve the metadata

          So, can I put the actual uri in the manifest.js like the last one ?

          (0) 
          1. Tjarliman Rusadi

            I think I know now.

            My program work perfectly now, it can run offline.

            Thanks Ludo for making this blog.

             

            Btw, what I did was, I include the /sap/opu/odata/sap/”service_name”, in my SCP Destination (not in Mobile service).

            and in manifest.js file I put someting similar as mentioned in this blog.

            (1) 
            1. Adam Harkus

              Hi Tjariman

              I’m also using an on-Premise Cloud Connector.

              What’s the format you’re using exacty? Mine is below….

              Manifest.json

              “uri”: “(URL from Mobile Services)/(Destination Name From mobile survices)/sap/opu/odata/sap/ZSV_SURVEY_SRV/”,

               

              sap-mobile-hybrid.js

              “serviceRoot” : fiori_client_appConfig.appID + “_” + mobile_appRoutes[0].destination + “/sap/opu/odata/sap/ZSV_SURVEY_SRV/”,

              “definingRequests” : {
              “CompetencySet” : “/CompetencySet/”
              }

               

              (0) 
            2. Adam Harkus

              Hmmm.

              I’ve followed the above, now I’m getting.

              Retrieve metadata failed because the OData server returned HTTP code, 403, with message: Backend connection (Destination Name From mobile survices) is not mapped for this application configuration.

              (0) 
              1. Tjarliman Rusadi

                Hi Adam,

                Sorry, I for late reply.

                Did you manage to solve your issue?

                Anyway, in manifest.js, i did not put the /sap/opu/opdat/sap..etc…

                I just put everything like mentioned by Ludo.

                But, I put the /sap/opu/odata/sap/my_service  in the SAP Cloud Platform  (SCP) Destination (not in the destination of Mobile Service)

                In manifest.js file I put

                “uri”: “https://hcpms-<trial>.hanatrial.ondemand.com/<destination_name_in_mobile_service>

                Pls. be noted that destination name on mobile service is different with the one in SCP.

                Inside the sap-mobile-hybrid.js, I only change this definingRequest part to OData set exist in my OData service

                “definingRequests”: {
                “Employeeset”: “/EmployeeSet/”
                }

                 

                (0) 
            3. Suerz 2017

              Hi TJ,

              Can you please help as i am facing issue as you were facing.

              it has error saying that “An error occured while communicating with the OData server to retrieve result of request “https://hcpms-p020365trial.hanatrial.ondemand.com:443/…” etc

              Thanks

               

              (0) 
              1. Tjarliman Rusadi

                What I did was, I put the /sap/opu/odata/sap/my_service  in the SAP Cloud Platform  (SCP) Destination (not in the destination of Mobile Service)

                In manifest.js file I put

                “uri”: “https://hcpms-<trial>.hanatrial.ondemand.com/<destination_name_in_mobile_service>

                Pls. be noted that destination name on mobile service is different with the one in SCP.

                 

                (0) 
  16. Chinmaya Gorachanda Chaudhury

    Hi Ludo,

    Thanks a lot for the great document and step by step Guide. I am able to execute in our factory SCP account. It works fine in my Android Device.

    Do we have any documentation/guide for achieving PUSH notification for this app.

     

    Thanks and Regards,

    Chinmaya

    (0) 
  17. Satish Reddy Nallepalli

    Hi Ludo,

    Thanks for the document in detail.

    When will the Windows platform be supported for cloud build..? Is it in scope..?

    Can we still use the Full Stack WebIDE to extract the WebApp and use it for developing Cordova app on Windows..?

     

    Thanks

    Satish

    (0) 
    1. Ludo Noens Post author

      Unfortunately, Windows support is not in the scope for cloud build.

      You should still be able to extract the WebApp and use it for developing Cordova apps on Windows.

       

      (0) 
  18. Laxman Chittepu

    Hi Ludo,

    Can you please help me with path to configure bundle id in SAP Web IDE.

    I’m using trail account in SAP Web IDE and trying to build app for iOS. The error while building iOS app states

    Check dependencies

    Code Signing Error: Provisioning profile “iOSDevelopment” has app ID “com.sap.fiori.dev1”, which does not match the bundle ID “com.sap.webide.x53a22ea6366948b9915d0c8ac969b1eb”

    I have attached the screenshot of project settings in Web IDE which does not show any device configuration to define bundle id.

    Regards,

    Laxman

     

     

    (0) 
    1. Ludo Noens Post author

      There is currently no UI to change the bundle ID. We are aware of this limitation.

      For now, my advice is to register the “com.sap.webide.x53a22ea6366948b9915d0c8ac969b1eb” with your signing profile. 

      Thanks,
      Ludo

      (0) 
  19. Adam Harkus

    Does this work for destinations pointing to on-premise SAP systems via a cloud connector?

    Here’s what I have, as specified in the blog.

    Manifest.json:

    “uri”: “(URL from Mobile Services)/(Destination Name From mobile survices)/sap/opu/odata/sap/ZSV_SURVEY_SRV/”,

     

    sap-mobile-hybrid.js

    “serviceRoot” : fiori_client_appConfig.appID + “_” + mobile_appRoutes[0].destination + “/sap/opu/odata/sap/ZSV_SURVEY_SRV/”,

    “definingRequests” : {
    “CompetencySet” : “/CompetencySet/”
    }

     

    This is returning 503 errors in SCP (Mobile Service For Development & Operations).

    I also have run the OData Application Destination Test in Mobile Service for development and operations, which returns the oData fine once I add in /sap/opu/odata/sap/ZSV_SURVEY_SRV/

    I’ve also tried running the test without sap/opu/odata/sap/ZSV_SURVEY_SRV and that doesn’t return anything.

    Any suggestions?

     

     

    (0) 
      1. Adam Harkus

        I’ve now tweaked the destination, manifest.json and sap-mobile-hybrid.js as advised.

        SCPMs is now showing the following 3 warning errors.

        WARN
        Offline
        Completed MobiLink adapter request. Response code is >= 400. APPCID: ##### , requestURI: /MobiLink/ServletAsync, method POST, status 400 time since handoff(ms): 2
        ERROR
        Offline
        Retrieve metadata failed because the OData server returned HTTP code, 403, with message: Backend connection ##### is not mapped for this application configuration
        Level WARN
        Offline
        Delta download for an Offline OData client failed.
        Any clues?

         

         

         

        (0) 
        1. Tjarliman Rusadi

          I think there is a problem with the connection between your SAP Cloud Connector with your SCP account.

          If you try to test/ping your SCP Destination, was it working fine?

           

          Regards,

          Tjarliman

          (0) 
          1. Adam Harkus

            Hi Tjarlman

             

            Yes the destination works fine through SCPms, and was also working fine otherwise (for online apps etc).

             

             

            (0) 
    1. Ludo Noens Post author

      Hi Adam,

      At least in theory this should work for on-premise systems connection via cloud connector as well. I did not try that though.

      Are you able to create a working app if you follow the steps outlined in the blog, using the same sample data source? (Just want to make sure you have a working reference)

      The changes you mention look okay in my view. Are you able to get the offline store successfully initialised ?

      Cheers,
      Ludo

       

      Thanks,
      Ludo

      (0) 
      1. Adam Harkus

        Hi Ludo, No, SCPms is throwing out the following errors (also posting above).

         

        WARN
        Offline
        Completed MobiLink adapter request. Response code is >= 400. APPCID: ##### , requestURI: /MobiLink/ServletAsync, method POST, status 400 time since handoff(ms): 2
        ERROR
        Offline
        Retrieve metadata failed because the OData server returned HTTP code, 403, with message: Backend connection ##### is not mapped for this application configuration
        Level WARN
        Offline
        Delta download for an Offline OData client failed.
        (0) 
        1. Ludo Noens Post author

          We’ve fixed a problem related to the length of the destination name. Users who encountered the issue need to re-enable their Web IDE project by deleting the “mobile” folder of the project and then clicking the Mobile > Enabled as Hybrid Mobile Project menu. After that, rebuild the project. The new app will not show the 403 error in run-time.

          (0) 
  20. Tjarliman Rusadi

    HI Ludo,

    My next question is,

    If let’s say the first time I open the app in my phone, I don’t want it to download data from the server to my phone. I just want to see a button to do the download. Once I click this button, at that time data will be downloaded to my phone.

    Then after that I can do offline transaction using those downloaded data. After finishing the transaction, I have updated data in my phone, and I want to click another button to upload this updated data to the server.

    How can I do that?

    Do you have recommended solution for that? or do you have any recommended blogs or documentations for me to follow.

    Thanks

    Tjarliman

    (0) 
    1. Ludo Noens Post author

      The current example implementation initialises and opens the local storage right after the user authentication. Of course you are free to open the store at a later point in time. The flush button in this example will upload the updated data to the server.

      (0) 
  21. satish reddy

    Hi Ludo,

    Tried building the offline app using above steps mentioned in the blog. App got installed in mobile but getting below error.

    Could you please help!! 

     

    Thanks,

    satish

    (0) 
  22. Tjarliman Rusadi

    Hi Ludo,

    I have question regarding flush/refresh function.

    In an online app, when we click button to save data, actually it will trigger its corresponding method in its OData class (at the back end server) to work right?

    Now for this offline app, when we call flush/refresh, does it has the same concept as save data (in an online app) process? where one of the method of Odata class will be triggered. What method is that?

     

    Regards,

    Tjarliman

    (0) 
  23. Ludo Noens Post author

    For those who ran into runtime issues, reporting error 403 “Service is not mapped for this application configuration”:

    We’ve fixed a problem related to the length of the destination name. Users who encountered the issue need to re-enable their Web IDE project by deleting the “mobile” folder of the project and then clicking the Mobile > Enable as Hybrid Mobile Project menu. After that, rebuild the project.

    Thanks,
    Ludo

     

    (0) 
    1. Adam Harkus

      Hi Ludo

      I’ve rebuilt the project as instructed.

      Unfortunately, I’m now getting the following error when building..

      This is without even adding in the offline functionality.

      Total time: 15.347 secs
      Error: /mnt/workspace/Manage_Categories_14/platforms/android/gradlew: Command failed with exit code 1 Error output:
      FAILURE: Build failed with an exception.

      (0) 
      1. Ludo Noens Post author

        Hi Adam,

        Our Cloud Build Service currently has an issue with Android builds. We are looking into this and will update you once this is resolved.

        You can still go ahead with iOS builds, if you have a device.

        Regards,

        Ludo

        (0) 
  24. Jakub Plocki

    Hello,

    I’ve created SAPUI5 application, enabled as “Hybrid Mobile Project”, but during build following error occurred:

     

    BUILD FAILED
    
    Total time: 13.057 secs
    Error: /mnt/workspace/OfflineDemo/platforms/android/gradlew: Command failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring root project 'android'.
    > Failed to notify project evaluation listener.
       > Could not resolve all dependencies for configuration ':_debugApkCopy'.
          > Could not find com.android.support:support-v4:26.0.2.
            Searched in the following locations:
                file:/usr/local/android/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/26.0.2/support-v4-26.0.2.pom
                file:/usr/local/android/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/26.0.2/support-v4-26.0.2.jar
                file:/mnt/workspace/OfflineDemo/platforms/android/sdk-manager/com/android/support/support-v4/26.0.2/support-v4-26.0.2.jar
            Required by:
                project :
    
    ... support not found few times, required by variuos component...

    What I did wrong? I’m using fresh SCP trial account.

    Kind regards,
    Jakub

    (0) 
    1. Ludo Noens Post author

      Hi Jakub,

      Can you try this again? We had some build issues on the Cloud Build service due to recent Android changes. These have been resolved now.

      Thanks,
      Ludo

      (0) 
    1. Ludo Noens Post author

      This should work if you’ve created a destination at SAP Cloud Platform level to expose your connection over Cloud Connector. Are you able to use this data source in SAP Web IDE (preview / run) ?

       

      (0) 
      1. Suerz 2017

        Hi Ludo,

        Its working fine in preview/run mode and connection is also expose through cloud connector.

        But when i am creating app offline it is giving problem. I think i am not able to create URI                    properly in manifest.json.

        Can you please provide your comments what need to be change over cloud connector(on premise). I followed your blog end to end normal odata is working fine but on premise it is throwing error.Please provide the changes need to be done over cloud connector(on premise)

        Thanks

        Suerz

        (0) 
  25. Jayakrishnan Chandramohan

    Hi Ludo,

    When i try to migrate my Web IDE Projects into Full Stack it indicates so much of errors,warnings at the console . Even in this blog exercise also it indicates. But it wont stop me to build the app or deploy app in the device. It is working. So ,

    1. Is it Necessary to clear all the Errors before i go for Build/Deployment into device. (As a best practice, yes i know it has to be resolved, but will it be a show stopper?)

    2. Normally in SAP Web IDE if any error shows on the view or Controller file it will not let the app to run,. But In Full Stack it allows?

     

    Thank you,

    Regards,

    JK.

    Please clarify on this.

    (0) 
  26. Adam Harkus

    Hi Ludo

    i’ve now shortened my Destination name, and have got passed the previous 403 error.

    However, no data is being retrieved from my oData entity CompetencySet.

     

    sap-mobile-hybrid.js :

    serviceRoot”: fiori_client_appConfig.appID + “_” + mobile_appRoutes[0].destination,

    “definingRequests”: {
    “competencyset”: “/CompetencySet/”
    }

    Manifest.json

    “uri”: “https://mobile-####.dispatcher.hana.ondemand.com/com.sap.webide.################_RSA/”,

    My DESTINATION, as it’s using a cloud connector is suffixed with the Path to the Service. E,g.

    sap/opu/odata/sap/ZSV_SURVEY_SRV/

    I am still getting WARNING is SCPms but no errors.

    E.g.

    WARN
    Offline
    Completed MobiLink adapter request. Response code is >= 400. APPCID: #### , requestURI: /MobiLink/ServletAsync, method POST, status 400 time since handoff(ms): 2

    (APPCID has been removed for privacy purposes).

    Is the warning anything to concerned about?

    Why is the oData not being retrieved?

     

     

    (0) 
  27. Sumanth Thunga

     

    Hi Ludo,

    Thanks for the details on offline capabilities and steps to perform. Is this process supported for Standard SAP delivered Fiori Applications (Ex: HCM Fiori applications such as Pay Statement, Leave Request etc..)? When these applications are imported to “WEBIDE workspace”, Option to “Enable as Hybrid project” is grayed out.

    Is there a different process for these standard applications to mobilize using Hybrid Tool Kit and Mobile Services, along with Offline Capabilities.

    Another Scenario is when we have reusable UI5 components within the current Fiori application, Does Packaged app option going to pull all the dependent components? (or) the reusable component also needs to be enabled as “Mobile Hybrid project”.

    Thanks

    Sumanth

    (0) 
  28. Adam Harkus

    I’ve now built the offline app and am Debugging in Chrome.

    The issue is now that the Metadata is failing to load.

    saml2 isChallenge status: 200
    logger.js:775 saml2 authenticate called
    logger.js:775 2018-06-15 10:45:12.684100 [ODataMetadata] initial loading of metadata failed –

    In SCPms , the Security Configuration is SAML authentication.

    Will try with no authentication.

    Any idea why SAML isn’t working ?

     

    (0) 
    1. Adam Harkus

      Also, the Metadata call is returning “Note: Your Browser does not support Javascript or it is turned off, Press the Button to proceed.

      I’m using chrome + JS is enabled…..

       

      (0) 
  29. Adam Harkus

    I now have a fully working offlline enabled mobile app!

    3 issues to note.

    I reduced the length of my service name (E.g. RSA).

    “uri”: “https://mobile-####.dispatcher.hana.ondemand.com/com.sap.webide.################_RSA/”,

    As I was using on-prem oData via a cloud connector, My destination (RSA), had to include the path to my : sap/opu/odata/sap/ZSV_SURVEY_SRV/

    I needed to REMOVE dispatcher from my uri:

    E.g.  “uri”: “https://mobile-####.hana.ondemand.com/com.sap.webide.################_RSA/”,

     

    THANK YOU

     

    (0) 
    1. Ludo Noens Post author

      Hi Adam,

      Sorry for responding a bit late on this. I thought we had already fixed the issue with the length of the service name by releasing a patch. So, this is required after we’ve provided the patch ?

      As for the last item (need to remove dispatcher): are you using a trial account or productive account?

      Thanks,
      Ludo

       

       

      (0) 
      1. Adam Harkus

        Hi Ludo.

         

        I needed to reduce the length of DESTINATION name AFTER the patch was released.

         

        With regard to the dispatcher, we’re using a productive account.

        (0) 
    2. Suerz 2017

      Hi Adam,

      Can you please write the full steps for the changes you have done.

      As ludo have suggested to do changes in URI like this “Mobile Services url, add the Cloud Platform Destination name (and optional: add the relative path)”

      But in your case

      “uri”: “https://mobile-####.dispatcher.hana.ondemand.com/com.sap.webide.################_RSA/”,

      this is like this??

      But from Ludo’s blog:

      “uri”: “https://hcpms-<trial>.hanatrial.ondemand.com/<destination_name_in_mobile_service>

      I have hcpms in place of mobile(your URI url).

      Can you tell me how you are building uri and other steps for on premise step by step. As i am struggling from last one month.

      Thanks

      (0) 
  30. Adam Harkus

    It looks like the app isn’t working as expected.

     

    Basically, this is a list of “Competencies” each with an Active Flag (Checkbox – Ticked as default)

     

    When deployed as a Web App, Clicking on the active flag for a Competency unticks it. Ticking it again adds the tick back in.

     

    However, With the built hybrid mobile app (Offline and online) clicking on the tick creates another duplicate competency, with an unticked Active Flag,

     

    This results in a page of duplicate competencies.

     

    Is there an know issue with Checkboxes?

     

     

     

     

     

    (0) 
    1. Ludo Noens Post author

      Hi Adam,

      Is this app based on one of the standard Web IDE templates ? I am not aware of any issues with checkboxes. Maybe this is an issue with a specific version of UI5. We currently only provide version 1.50.8. (for our next release we plan to provide 1.54.6).

      Thanks,
      Ludo

      (0) 
      1. Adam Harkus

        Hi Ludo

         

        Yes it’s absolutely built on the standard SAPUI5 Application template in SAP WEB IDE.

         

        It’s just a simple List item with a label and Checkbox associated with it.

        <mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout" controllerName="ManageCompetencies.ManageCompetencies.controller.ManageCompetencies" displayBlock="true">
        	<App>
        		<pages>
        			<Page title="{i18n>title}">
        				<!-- Header help button -->
        				<headerContent>
        					<Button icon="sap-icon://sys-help" press="onHelpPress" tooltip="{i18n>help}"/>
        				</headerContent>
        				<!-- Content -->
        				<l:Grid defaultSpan="XL8 L10 M12 S12" defaultIndent="XL2 L1 M0 S0" class="sapUiResponsiveMargin">
        					<l:content>
        						<!-- List of Competencies -->
        						<List noDataText="{i18n>noCompetencies}" items="{path:'/CompetencySet',parameters:{select:'CompetencyDesc,CompetencyId,Active'},sorter:[{path:'Active',descending:true},{path:'CompetencyDesc',descending:false}]}" headerText="{i18n>active}" class="sapUiMediumMarginTop rightAlign">
        							<items>
        								<InputListItem label="{CompetencyDesc}">
        									<!-- If there is an X in the Active field, set the state of the CheckBox to TRUE -->
        									<CheckBox selected="{= ${Active} ==='X' ? true : false }" select="onSwitch"/>
        								</InputListItem>
        							</items>
        						</List>
        					</l:content>
        				</l:Grid>
        				<!-- Footer -->
        				<footer>
        					<Bar>
        						<contentLeft/>
        						<contentRight>
        							<Button text="{i18n>addNewCompetency}" press="onNewCompetencyPress" type="Accept" icon="sap-icon://add"/>
        						</contentRight>
        					</Bar>
        				</footer>
        			</Page>
        		</pages>
        	</App>
        </mvc:View>

         

        ..And here is the onSwitch function in the controller.

        	// Set CheckBox status, X for true, blank for false
        		onSwitch: function(oEvent) {
        			var oEntry = {};
        			var bindingContext = oEvent.getSource().getBindingContext();
        			var path = bindingContext.getPath();
        			var object = bindingContext.getModel().getProperty(path);
        			oEntry.CompetencyId = object.CompetencyId;
        			oEntry.CompetencyDesc = object.CompetencyDesc;
        			if (oEvent.getParameter("selected") === true) {
        				oEntry.Active = "X";
        			} else {
        				oEntry.Active = "";
        			}
        			var oModel = this.getView().getModel();
        			oModel.create("/CompetencySet", oEntry, {
        				success: function(oData) {
        					if (oEntry.Active === "X") {
                                MessageToast.show("Competency set as Active", { duration: 2000 });
                            }
                            if (oEntry.Active === "") {
                                MessageToast.show("Competency set as Inactive", { duration: 2000 });
                            }
        				},
        				
        		
        				error: function(oError) {}
        			});		
        		
        			oModel.updateBindings(true);
        		},

         

        The project itself is SAPUI v1.54.6. but the cloud build only gives you the option of 1.50.8.

        Nevertheless, I’ll change the project to v1.50.8 and build again.

        This works fine when deployed as normal online webapp (see below)

         

         

        (0) 
  31. Harsha Jalakam

    Hi Ludo,

    When I add the offline functionality and download the apps on mobile, I am getting the below error. We have just used the read functionality at the moment.

     

    ( The mobile when deployed without introducing the offline capabilities opens without any issues in the mobile app)

    Below are the configurations/changes we have done as per the guided set above and only the below changes differ in manifest.json and sap-mobile-hybrid.js, compared to tutorial.

    “dataSources”: {

    “ZTEST_FIGHT_SRV”: {

    “uri”: “https://hcmpms-pXXXXXXtrial.hanatrial.ondemand.com/com.sap.webide.x2723ff3aaa6944dca30e8bf6afbc9c16_XX3/”,

    “type”: “OData”,

    “settings”: {

    “odataVersion”: “2.0”,

    “localUri”: “localService/metadata.xml”

    }

    }

    }

     

                    “definingRequests”: {

    “SFLIGHT001Set”: “/SFLIGHT001Set/”

    }

    However when we open the above URL we get the below error in the browser.

     

    Regards,

    Harsha

     

     

    (0) 
    1. Ludo Noens Post author

      Hi Harsha,

      Are you sure the uri is correct? I expected to see “https://hcpms-pxxxx … instead of “https://hcmpms-pxxxx ….

      Regards,
      Ludo

       

      (0) 
  32. Sumanth Thunga

    Are there any issues or downtime for Mobile Build Packaged App from WEBIDE? Getting below error.

     

    Uncaught (in promise) Error: “Element com.sap.webide.hybrid.ui.steps.ApplicationInfoStepContent#__content0” is not valid for aggregation “stepContent” of Element sap.watt.ideplatform.plugin.template.ui.wizard.WizardStep#__step0

     

    Thanks

    Sumanth

    (0) 
    1. Ludo Noens Post author

      Hi Sumanth,

      We are working on a patch that should go out later today.

      Sorry for the inconvenience caused.

      Regards,
      Ludo

      (0) 
      1. Ludo Noens Post author

        Hi Sumanth and other users,

        We have released a patch just now to fix this. Please clear your browser’s cache and reload SAP Web IDE.

        Regards,
        Ludo

         

        (0) 
        1. Sumanth Thunga

          Hi Ludo,

          Thanks for help with the fix. Am able to build now. I am working on mobilizing HCM standard delivered app and it has Reusable Library HCM Common component. I am able to add that as a library resource into the packaged app. However, this is failing as HCM Common component uses different ODATA Service and main destination points to the different path.

          When data need to be pulled from multiple ODATA Services and Entities, where should this additional destination be defined as appRoutes.js is getting auto-generated?

          Could you please help suggest best options for handling multiple ODATA Services and stores.

          Thanks

          Sumanth

           

          (0) 

Leave a Reply