Programming

SAPUI5 Q&A: Your SAPUI5 Questions Answered by Paul Modderman

Paul Modderman, author of our book SAPUI5: The Comprehensive Guide, sat down last week to answer reader questions about the programming language on our LinkedIn page. Here's a recap of what was asked, and what Paul had to say.

 

Q: Why should I use SAPUI5 and not some other web technology to write apps?

If you’re doing web development with SAP as your backend, SAPUI5 is a powerful choice. It’s designed to work smoothly with OData, which SAP Gateway and SAP HANA output natively. It flows right into the SAP Fiori launchpad, and works quite well as single apps which are part of a larger experience of unified enterprise applications. If you’re doing web development and SAP is not your backend, SAPUI5 is probably not your first choice, and probably shouldn’t be. But I do not see that as a downside for SAPUI5!

 

 

Q: I have done extensive coding in ABAP; however, I'm not that familiar with JavaScript or XML or HTML5. I have tried to learn them separately on other websites, but that knowledge will not help us in UI5, as SAP has its own kind of wrapper, and it is not "true" JavaScript or HTML5 coding. When a system creates controller, model, etc. files automatically in SAP Cloud Platform, it is not easy to follow the code that is automatically generated. What do you recommend that we should do to understand it better?

Browse the sample controls at https://sapui5.hana.ondemand.com/#/ and flip back and forth between the live screens and the code behind them. I have learned so much just by laser-focusing on one control and watching its various options come to life in the samples. By the way, SAPUI5 is true JavaScript and true HTML5! But you are certainly correct that SAPUI5 has its own flavor of accomplishing single page applications, distinct from other frameworks, just as those frameworks are distinct from one another.

 

Q: It seems development in UI5 takes a very long time. Do you agree? We used to create screens in SE51 and code in a very short period of time. Now it takes weeks to develop in UI5, especially by the time you understand OData and code. What do you recommend to make the development faster?

To make development faster, I recommend a few things:

 

Make yourself faster. Get accustomed to source control so it’s easy to try something new without fear of destroying your old work. Always be writing code just to try something. My project files are littered with little apps that are intended only to teach me one new thing. That one new thing always comes in handy either right now or later on.

 

Make your team faster. Some folks have a better grasp of OData and others might lean toward front end work. For those who work on the front end, learn how to use mockserver.js so you can avoid having to wait for an OData service.

 

Give yourself permission to understand that this does take a little longer. SAPUI5 is geared toward making a better experience for the end user. Even if it’s easy to smash out an ALV report or something similar in ABAP, by using SAPUI5 you’re making a commitment to improving the work lives of many many people.

 

Q: Why does deploying to SAP Cloud Foundry take so long?

There is some good discussion in this SAP Blog post. A few points:

  1. Could partial deploys work for you?
  2. One commenter was experiencing long deployments because of long upload times. Is that part of your issue?
  3. I am no stranger to builds that seem to take longer than they should, and this happens in a lot of cloud environments (e.g. Google Cloud, with App Engine Flexible, can take similar amounts of time to deploy). I think part of the issue is that flexible provisioning of resources to do the deployment can be time-consuming.

 

Q: Is there a way to improve web IDE auto code completion?

You can do a couple things:

  1. Update es-lint rules to help with annoying warnings you don’t want, or warnings that you do want. Check out this SAP Blog post.
  2. SAP has a beta version of TypeScript enablement in SAPUI5. This one is coming in the future, and I can’t personally make any guarantees about availability/usage, but getting TypeScript involved in JavaScript projects makes it so that many editors can do better content assistance.

Q: The project I'm currently working for is planning to switch the SAPUI5 major version (from 1.52 to 1.71). Do you have any tips for updating the SAPUI5 major version? In this specific situation (update from 1.52 to 1.71) should we expect major compatibility issues within custom developed apps?

You should not expect major compatibility issues. As a general statement, SAPUI5 is very good about maintaining compatibility across minor versions. (Using SAP’s terminology as shown here, 1.52 to 1.71 is a “minor” version upgrade.) If you stick with the public APIs and don’t use sap.ui.extend very much, you will almost certainly be safe. You should, of course, absolutely test your apps when you switch to the new version. If you can get buy-in from your project, use it as an opportunity to automate some of your testing!

 

Q: For the SAP Fiori desktop app should we use the sap.m controls or the sap.uxap?

They're both well-enough supported and powerful that your choice should really depend on the experience you're planning to make for your users. If the Object Page layout is the best choice for your app, then move toward those uxap controls. But there's no reason you can't mix and match. The sections of the Object Page can certainly contain sap.m controls.

 

Q: The sap.ui.cor.util.Export control is deprecated. Is there a replacement?

Not a quick and easy one I've seen. Looking for some examples in my old code, I will reply again if I find a nice slick example.

 

Q: What do you think about wrapping all SAPUI5 CRUD calls in JS Promises? Is it worth it (considering the overuse of Promises increases CPU usage)?

I don't know about all of them. I think the current CRUD style with the success and error callbacks works pretty well. But I have seen some cool things where you go "I want these 6 requests to happen, and then I want to do something after they're all done" that Promises helped with. It was a little more elegant than $batch handling.

 

Q: What is the status of the new Business Application Studio IDE?

It's generally available for Cloud Foundry customers.

 

Q: SAP Cloud Platform Site for Cloud Foundry is so limited compare to site for NEO, should we continue to use NEO?

Cloud Foundry is where innovations happen; I would go to Neo wherever I can.

 

Q: Apart from your book, openSAP website, and SAP's SAPUI5 site, what other websites or resources do you recommend so we can learn more?

Here are a few resources I recommend:

 

Learn SAPUI5 in Our Rheinwerk Course!

Learn to use SAPUI5 to develop modern, responsive SAP applications in this comprehensive course. From basics to advanced programming, integration, and customization, this is your one-stop shop! Get access to course recordings by clicking the banner below.

 

SAPUI5

 

This post was originally published 4/2020.

Recommendation

SAPUI5: The Comprehensive Guide
SAPUI5: The Comprehensive Guide

From web apps to user interfaces, get the skills you need to develop with SAPUI5! Master the fundamentals—design guidelines, IDEs, TypeScript, and more—and then dive into development. Create your first application and learn about SAPUI5’s libraries, controls, layouts, and managed objects. Integrate data into your applications using RESTful and OData services, and then enhance them with SAP Fiori elements and custom controls. With information on deployment, debugging, security, and generative AI, this guide has everything you need to become an SAPUI5 expert!

Learn More
Paul Modderman
by Paul Modderman

Paul J. Modderman is a senior product architect and technology evangelist for Mindset Consulting. He has more than 10 years of software development expertise, specializing in ABAP, ABAP Objects, .NET, Python, and Java. At Mindset, Paul ideates and develops innovative software products based on SAP, often integrating SAP with cutting-edge cloud software such as Google for Work.

Comments