Explaining User Interfaces

Objectives

After completing this lesson, you will be able to:
  • Explain UI technologies used in SAP Fiori
  • Explain SAPUI5 development.
  • Use SAP Business Application Studio for SAPUI5 Development.
  • Use Visual Studio Code for SAPUI5 development.

UI Technologies

Watch the video to explore the tools and technologies in SAP UI.

Comparison SAP Fiori UX technologies: Web with HTML5, SAPUI5, SAP Business Application Studio; Native mobile with Apple iOS, Swift, Xcode, on the one hand and Android, Java, Android Studio on the other hand; Cross platform with SAP Mobile Services, SAP MDK, SAP Business Application Studio.

Most SAP Fiori apps are web apps built using SAPUI5 as UI technology. SAPUI5 is based on HTML5 and can be consumed on every device using a browser. The recommended development environment for SAPUI5 is the SAP Business Application Studio.

SAP Fiori also supports native apps. These apps are developed in the native programming language used on a device, allowing a better integration. Apple and SAP are cooperating to develop native apps for iOS using Apple Xcode as the development environment. The open source language Swift, which was originally created by Apple, serves as programming language (see https://swift.org). You can also develop native apps for Android using Java as the programming language in the Android Studio. In contrast to the cooperation with Apple, apps are not shipped by Google or SAP.

Cross platform SAP Fiori apps are developed using "low-level" code like metadata or scripts. The "low-level" code is dynamically interpreted to render a native mobile UI. The SAP Mobile Services provide the SAP Mobile Development Kit (MDK) for creating and interpreting "low-level" code. The MDK is integrated in the SAP Business Application Studio.

HTML5

HTML5 logo and icons for four Web browsers with minimum version compatibility: Microsoft Edge (v1), Mozilla Firefox (v10), Google Chrome (v1), Apple Safari (v3).

With SAPUI5 as a basis for web apps, browsers need a certain minimum release to process all code elements used in HTML5 and JavaScript. Google Chrome and Microsoft Edge both support HTML5 from the beginning. Mozilla Firefox and Apple Safari were updated to support it.

Caution

Although Microsoft Internet Explorer has officially supported HTML5 since version 8, it is recommended to switch to Microsoft Edge. Microsoft and SAP announced the end of support for Internet Explorer.

For more information about this topic, please read SAP Note 1672817Browser: Microsoft Legacy Edge and Internet Explorer Support Policy Note.

HTML5 logo with a chart: HTML5 is a markup language for structure, CSS3 is an annotation language for layout, JavaScript is a programming language for logic, jQuery is a JavaScript library for best practice.

Hypertext Markup Language 5 (HTML5) is a markup language used to structure webpages. In combination with Cascading Style Sheets 3 (CSS3) for the layout, these webpages can be visualized using a browser. For dynamic interactions in webpages, the programming language JavaScript is used. JavaScript code is organized in libraries from which it can be reused in other webpages. jQuery is a well-known library in the area of HTML5 that offers best practices.

SAPUI5

Slide on SAPUI5 highlights with features like JavaScript-based HTML5 rendering, CSS3 theming, AJAX support, integration in SAP platforms, and OpenUI5 under Apache 2.0 license. Logos and links included.

SAPUI5 was originally built on top of jQuery and added additional HTML5 browser rendering libraries. All extensions to jQuery aimed to make webpages SAP product standard-compliant in visualizing and handling. Today, most of the original jQuery libraries are replaced by SAP ones.

The original theme of SAPUI5, created in CSS3, was Gold Reflection. Today, SAPUI5 is closely coupled with SAP Fiori design implementing all supported themes in CSS3.

SAPUI5 extensibility options allow a wide range of adaptations:

  • Include custom JavaScript, HTML, and CSS in SAPUI5-based pages
  • Include custom JavaScript libraries
  • Create composite controls from existing SAPUI5 controls
  • Create new libraries and controls

Asynchronous JavaScript and XML (AJAX) was first implemented at SAP with Web Dynpro, and it is also used in SAPUI5 to present a native-like handling of web apps. Apps developed with SAPUI5 present a consistent user experience and are responsive across browsers and devices including smartphones, tablets, and desktops. The user interface (UI) controls automatically adapt themselves to the capabilities of each device.

SAPUI5 is the SAP user interface development toolkit for HTML5. Let's try to better understand SAPUI5.

Besides SAPUI5, SAP also provides OpenUI5 as a delivery of the UI development toolkit. The core containing all central functionality and the most commonly used control libraries are identical in both deliveries. Although very closely related, they have their differences:

OpenUI5

OpenUI5 is open source, free to use, released under the Apache 2.0 license. OpenUI5 provides all the important features needed to build feature-rich Web applications. The source is available on https://github.com/SAP/openui5/.

If you find a bug or have an idea for a new feature, you can propose a GitHub issue or a change. Please read the guidelines first: https://github.com/SAP/openui5/blob/master/CONTRIBUTING.md.

For more information, please visit https://openui5.org/.

SAPUI5

SAPUI5 is not a separate SAP product with a separate license. It is integrated in many SAP products. The first one was the AS ABAP 7.4, which included SAPUI5 in the UI technologies component SAP_UI.

The additional libraries in SAPUI5 include more controls on top of OpenUI5, like charts and smart controls. The exact feature range of SAPUI5 also depends on the platform.

For more information, please visit https://ui5.sap.com/.

Technically, you can switch between OpenUI5 and SAPUI5 (provided you have a product where SAPUI5 is included). Please check first, which SAPUI5 version is needed. The version numbers of OpenUI5 and SAPUI5 might differ on patch level (last number).

Three UI5 Demo Kit screens showcasing control categories: Responsive, smart, core, layout, and table controls, with search options including deprecated and experimental elements.

A library bundles a set of controls and related types to make them consumable by Web applications. There are predefined and standard libraries with many commonly used controls:

  • Responsive controls (sap.m)
  • Smart controls (sap.ui.comp)
  • Core controls (sap.ui.core)
  • Layout controls (sap.ui.layout)
  • Table control for desktop (sap.ui.table)

The core library (technically, this is the sap.ui.core library) defines a core set of types that can be used in other libraries. Developers can create their own custom UI libraries, making it easy-to-use their own controls alongside predefined controls.

Example showing the comparison of TypeScript and JavaScript, highlighting static type-check, type-sensitive code completion in TypeScript, and minimized source code in JavaScript, with transpilation process.

TypeScript is an extension of JavaScript that adds type information to the language. It helps developers catch errors early through type checking and by providing code assist in supporting code editors, for example through code completion and inline documentation. It increases development efficiency.

TypeScript is not much different from JavaScript. In fact, it is a super-set of JavaScript that adds some language features on top. As a simple example, if a variable is specified as number, then it is not possible to assign a string (which would be possible in JavaScript). The same is possible for more complex structures and classes. This type information is used by the code editor to help you writing code:

  • Error messages while you code
  • Code completion
  • Inline documentation
  • Easier refactoring and maintenance

Web browsers cannot execute TypeScript. Hence, a transpilation step is needed. It converts the code to JavaScript basically by stripping away all the type information and minimizing the code. This also means that the type safety and everything that TypeScript provides is purely focused on development time, not the runtime of the code. Nevertheless, the original source code can be made available to browsers using "source maps". During debugging, you can see the original TypeScript code you wrote.

SAPUI5 itself is written in JavaScript without any type information. But all the types of the SAPUI5 APIs are declared in separate type definition files. In the development environments provided by SAP, these type definitions are already added as dependencies and the transpilation step is also already set up.

Model View Controller (MVC)

Visualization showing a MVC architecture with a controller (JavaScript or TypeScript) managing updates to the model (OData, JSON) and view (UI5 Controls), with notifications and user interaction arrows.

The Model View Controller (MVC) concept separates the tasks in an application into three programmatic elements:

Model

Holds the data of the app and/or connection to the data source organized as OData, JSON, XML, or resource bundle.

View

Holds the user interface consisting of UI5 controls organized in libraries.

Controller

Holds the logic of the application as TypeScript or JavaScript reacting on messages from models and views and updating these.

In SAP Fiori, views are defined using XML. The only SAP Fiori app that uses HTML is the SAP Fiori launchpad, which provides a frame for the XML-based views. Controllers are developed using JavaScript and are either bound to a view or standalone to be used by multiple views. Data binding can be used on the views to connect to data in the models.

SAPUI5 Versions

SAPUI5 provides updates on a regular basis through maintenance and innovation versions.

Watch the video to get an overview of SAPUI5 versions.

Screenshots show the SAPUI5 versions on https://ui5.sap.com, inside of an AS ABAP, and of a running app.

In an on-premise scenario, the SAPUI5 libraries are stored in the SAP_UI software component of an Application Server (AS) ABAP. The customer is responsible to keep this up-to-date.

In a cloud scenario, the SAPUI5 libraries are loaded from the Content Delivery Network (CDN) of SAP. SAPUI5 and OpenUI5 versions are removed from the CDN one year after their end of maintenance. In addition, patches of versions in maintenance, which are older than one year, are removed.

Caution

Once a version is removed, applications using this version will break. To avoid a potential security risk, update the applications to a more recent version:

SAP Note 3001696 - Removed outdated SAPUI5 versions from SAPUI5 CDN - Fiori applications might stop functioning.

A full list of all SAPUI5 versions including their end of maintenance can be found under https://ui5.sap.com/versionoverview.html.

Which SAPUI5 versions are available on an AS ABAP is provided via https://<host>:<port>/sap/public/bc/ui5_ui5/index.html.

The version a running app is using is visible in the technical information dialog opened via CTRL+ALT+SHIFT+P on Microsoft Windows or via CTRL+ALT+OPTION+P on Apple Mac.

Note

For more information about this topic, see:

SAPUI5 Development Tools

Time to look at SAPUI5 development tools. These include SAP Business Application Studio and Visual Studio Code.

Let's compare the two tools.

Comparison between Visual Studio Code and SAP Business Application Studio including installation type, development environment, code base, extensions, and licensing.

Since 2020, SAP provides the SAP Business Application Studio (BAS), back then based on Theia, an open source project by Eclipse. Since 2022, it is based on Code OSS, an open source project by Microsoft. It is provided in the SAP BTP as a service subscription and brings its own runtime. It provides preconfigured environments, so-called Dev Spaces, with preinstalled runtimes and tools tailored for key scenarios. These are based on extensions such as the SAP Fiori tools extension.

Another tool where the SAP Fiori tools extension can be included is Visual Studio (VS) Code. It is developed by Microsoft based on the open source IDE Code OSS. Although not based on Theia, it is fully compatible. SAP offers the SAP Fiori tools beside others free of charge in the extensions marketplace of VS Code. VS Code can be downloaded under https://code.visualstudio.com/.

Note

Between 2014 and 2019, SAP provided the SAP Web Integrated Development Environment (IDE) based on Orion, an open source project by Eclipse. Today, it is recommended to use the SAP BAS instead.
Diagram showing Visual Studio Code connecting to ABAP Repository's Business Server Page, and SAP Business Application Studio on SAP Business Technology Platform linking via Cloud Connector .

Developing an SAP Fiori web app means developing SAPUI5 using the SAP Fiori tools extension in SAP BAS or VS Code. A project in the development environments can connect and, therefore, represents an SAP Fiori app delivered and managed in an Application Server (AS) ABAP as Business Server Page (BSP). The BSP serves as a container for SAPUI5 apps, although BSP was originally developed based on HTML4. The tools in the ABAP Workbench (SE80) have not been updated for this new role of BSP. The complexity of SAPUI5 is better handled in a pure web-based environment.

The Cloud Connector is a standalone software that is available free of charge to connect the services in the SAP BTP with the on-premise systems in the customer network. Once installed in the customer network, it establishes a secure SSL Virtual Private Network (VPN) connection to the SAP BTP. Therefore, it is not needed for VS Code. The Cloud Connector is available for download under https://tools.hana.ondemand.com/.

Two screenshots: Left - SE80 displaying BSP application EPMRA_SHOP. Right - SICF showing inoperable BSP service and operable SAPUI5 service.

In the ABAP Workbench (SE80), SAPUI5 artifacts can be displayed by opening the surrounding BSP application. This allows some administrative functions like assigning the BSP to a transport request or to another package. It is also possible to view the unformatted source code in the files, but it is not suitable to edit any artifacts.

All HTTP services of an AS ABAP are organized in the HTTP Service Hierarchy Maintenance (SICF). The HTTP service to run an SAPUI5 application can be found under /sap/bc/ui5_ui5 in the Internet Communication Framework (ICF). Applications without an own namespace are organized in the subfolder sap. The name of the service is equal to the name of the BSP application.

The HTTP service to run a BSP application can be found under /sap/bc/bsp. This does also mean that for a BSP housing an SAPUI5 application, the same applies. But these services are inoperable because there is no actual BSP application connected. These services can be ignored and therefore deactivated.

SAP Business Application Studio

SAP Business Application Studio interface with highlighted sections: BAS, Code OSS, SAP, and SAP Fiori. The screen displays project options and sample apps, shown in both light and dark modes.

When starting the SAP Business Application Studio (BAS), the Get Started page is shown. It offers buttons to start the development by creating, cloning, importing, or just opening projects. On the left side, side panels can be opened to jump to different parts of the development. The upper ones originate from Code OSS, the lower ones were included by SAP, like the one for SAP Fiori.

Screenshot flow in SAP BTP cockpit showing steps to create a new subscription for SAP Business Application Studio under Service Marketplace and Instances and Subscriptions sections.

The SAP BAS is hosted as a service subscription in a subaccount of the SAP Business Technology Platform (BTP). A subscription is standalone and runs without the need of a runtime environment or any other service. The entitlement, the right to provision and consume a resource, must be available in the subaccount.

From the Service Marketplace in the SAP BTP Cockpit of a subaccount, a service can be created by choosing a service plan. Creating the SAP BAS does not need any additional data and results in a service subscription in Instances and Subscriptions.

Screenshot flow in SAP BTP cockpit assigning all role collections for SAP Business Application Studio to a user.

For operating the SAP BAS, certain authorizations are needed. These are organized in the following role collections:

Business_Application_Studio_Administrator
Allows administrators to manage (export and delete) user data.
Business_Application_Studio_Developer
Allows developers to load and develop applications.
Business_Application_Studio_Extension_Deployer
Allows extension developers to deploy simple extensions.

Assigning a role collection can be done in the SAP BTP cockpit under SecurityUsers. Select the user and choose Assign Role Collection on the right. Then, select the role collections you want to assign.

For the role collections to be available, the service must be successfully subscribed.

Watch the video to see how to create a dev space in SAP Business Application Studio.

Screenshots of the Application Generator and Guided Development started via the command palette. Top: Running task with Control+Shift+P. Bottom left: SAP Fiori generator template selection. Bottom right: Guided development guide information.

Although the SAP BAS offers several buttons and menu entries to start a tool of the SAP Fiori tools, the most comprehensive list of tools can be accessed in the Command Palette. Choose HelpShow All Commands in the menu or use Control+Shift+P to show and run commands. Entering fiori in the Command Palette provides a list with all SAP Fiori tools to start from including generators and templates.

Operate SAP Business Application Studio

Business Example

You want to explore the features of SAP Business Application Studio (BAS).

Note

This exercise requires an account on SAP Business Technology Platform. The login information is provided by your system setup guide of your SAP Learning system.

Task 1: Prepare the SAP Business Application Studio for Operation

Steps

  1. Log on to SAP Business Technology Platform (BTP) using your SAP BTP account.

    1. In the Windows start menu, choose a Web browser.

    2. In the Web browser favorites, choose a suitable SAP BTP Cockpit in the SAP Business Technology Platform folder or enter https://emea.cockpit.btp.cloud.sap/.

    3. Log on using your SAP BTP account.

  2. In the SAP BTP Cockpit of your subaccount, create a service subscription for the SAP Business Application Studio (BAS) with the service plan standard-edition.

    1. In the SAP BTP Cockpit, choose your subaccount.

    2. On the left-hand side, choose ServicesService Marketplace.

    3. In the Search field, enter studio.

    4. Choose SAP Business Application Studio.

    5. Choose Create at the top right-hand corner.

    6. In the New Instance and Subscription popup, select the Planstandard-edition and choose Create.

    7. In the Creation Progress popup, choose View Subscription.

    8. Wait until the Status changes into Subscribed.

  3. In the SAP BTP Cockpit of your subaccount, assign the Business_Application_Studio_Administrator and Business_Application_Studio_Developer role collections to your user.

    1. In the SAP BTP Cockpit of your subaccount, choose SecurityUsers on the left-hand side.

    2. Choose your user.

    3. Choose Collapse the first column (the arrow in the separator).

    4. Choose Assign Role Collection.

    5. In the Assign Role Collection popup, in the Search field, enter studio.

    6. Select Business_Application_Studio_Administrator and Business_Application_Studio_Developer.

    7. Choose Assign Role Collection.

Task 2: Examine the Guides and Templates in the SAP Business Application Studio

Steps

  1. Start the BAS of your subaccount and create the dev space FioriDev.

    Note

    If the error is shown that the web page is not available, log off and close your browser sessions. Then log on again and repeat this step.
    1. In the SAP BTP Cockpit of your subaccount, choose ServicesInstances and Subscriptions on the left-hand side.

    2. Choose SAP Business Application Studio.

      Note

      If the error that the web page is not available appears, log off and close your browser sessions. Then log on again and repeat the step.
    3. Choose Create Dev Space.

    4. In the Dev Space name field, enter FioriDev.

    5. Choose SAP Fiori on the left-hand side.

    6. Choose Create Dev Space.

    7. Wait until the status changes to RUNNING.

  2. In the BAS, examine the available templates and guides for SAP Fiori.

    1. In the BAS, choose the FioriDev dev space.

    2. On the Get Started page, choose New project from Template.

      Note

      If the Get Started page does not appear automatically, choose HelpGet Started.
    3. Examine the available templates.

    4. Choose Ctrl+Shift+P.

    5. In the Command Palette at the top, enter fiori.

    6. Choose Fiori: Open Guided Development from the list.

    7. Examine the available guides.

      Note

      The warning symbol behind every guide just means that there is no project to apply changes to, yet.

SAP Extensions in Visual Studio Code

Screenshot of the Welcome page of Visual Studio Code showing start options and walkthroughs menu. Labeled: VS Code, Code OSS, SAP Fiori, and SAP BAS Desktop Client alongside respective icons.

When starting the Visual Studio Code (VS Code), the Welcome page is shown. It offers buttons to start the development by creating, cloning, importing, or just opening projects. On the left side, side panels can be opened to jump to different parts of the development. The upper ones originate from Code OSS. The lower ones are based on installed extensions, like the one for SAP Fiori.

Screenshot of the SAP Fiori Tools - Extension Pack in the extensions marketplace of VS Code with options to disable, uninstall, and auto-update. Left panel displays various SAP-related extensions.

The Extensions side panel grants access to the extension marketplace for VS Code. Assuming that an internet connection is available, a search for all existing extensions can be performed. You can read the documentation, install or uninstall, enable or disable, change settings, and check for updates. The search field also supports tags. Entering @ in the search field shows a list of possible search criteria like categories.

Hint

If you choose the vendor of an extension like SAP SE in the UI, publisher:"SAP" is put in the search field and all extensions of this vendor are shown.

SAP Fiori tools are an extensions pack consisting of seven extensions. It is recommended to install the whole extension pack with all included extensions in the same version. Other extensions may be valuable to support the development of SAP Fiori like the UI5 Language Assistant.

SAP Fiori Tools in Visual Studio Code

Screenshots of the Application Generator and Guided Development started via the command palette in VS Code. Top: Running task with Control+Shift+P. Bottom left: SAP Fiori generator template selection. Bottom right: Guided development guide information.

The VS Code only offers a few buttons and menu entries to start a tool of the SAP Fiori tools directly. The most comprehensive list of tools can be accessed in the Command Palette. Choose HelpShow All Commands in the menu or use Control+Shift+P to show and run commands. Entering fiori in the Command Palette provides a list with all SAP Fiori tools to start from including generators and templates.

Visual Studio Code interface showing steps to log on, start, and open SAP BAS through the desktop client with SSH connection and SAP BAS extensions noted.

The SAP Business Application Studio toolkit extension allows you to connect and access dev spaces of SAP Business Application Studio (BAS) in VS Code. It can be found and installed in the extension marketplace.

The extension adds the SAP BAS Desktop Client as a side panel. For the connection, the URL to access the SAP BAS is needed. The logon uses a Web browser window asking for your credentials and establishing an SSH connection in a new VS Code window. You can access and change the connection details choosing the blue SSH URL at the bottom of the window.

Accessing a dev space in VS Code loads all extensions of the dev space in the local VS Code window. This includes extensions, which are not available in the extension marketplace. In addition, you can add more extensions from the extension marketplace.

Caution

If you install third-party extensions while using a remote connection to SAP BAS, the third-party may be able to access your data from the dev space.

You can start and stop dev spaces, open the dev space manager, and connect to multiple dev spaces of different accounts. All settings are saved in the dev spaces but are used locally in VS Code.

Operate SAP Fiori Tools in Visual Studio Code

Business Example

You want to explore the features of SAP Fiori tools in Visual Studio Code.

Note

This exercise requires an SAP Learning system. Please consult your system setup guide on how to initialize Visual Studio Code.

Task 1: Examine and Operate SAP Fiori Tools in Visual Studio Code

Steps

  1. Start Visual Studio Code and check the status and details of the SAP Fiori tools - Extension Pack.

    1. In the Windows start menu, choose Visual Studio Code.

    2. Choose Extensions on the left-hand side.

    3. In the Search Extensions in Marketplace field, enter fiori tools.

    4. Choose SAP Fiori Tools - Extension Pack.

    5. Examine the details.

  2. In the SAP Fiori tools in Visual Studio Code, examine the available templates and guides for SAP Fiori.

    1. Choose Ctrl+Shift+P.

    2. In the Command Palette at the top, enter fiori.

    3. Choose Fiori: Open Application Generator from the list.

      Note

      When starting for the first time, you may need to wait for the @sap/generator-fiori to finish installation.
    4. Examine the available templates.

    5. Choose Ctrl+Shift+P.

    6. In the Command Palette at the top, enter fiori.

    7. Choose Fiori: Open Guided Development from the list.

    8. Examine the available guides.

      Note

      The warning symbol behind every guide just means that there is no project to apply changes to, yet.

Access SAP Business Application Studio in Visual Studio Code

Business Example

You want to access your SAP Business Application Studio in Visual Studio Code.

Note

This exercise requires an SAP Learning system and an account on the SAP Business Technology Platform. The login information is provided by your system setup guide including a guide on how to initialize Visual Studio Code.

Prerequisites

The dev space was created in exercise Operate SAP Business Application Studio.

Task 1: Examine the SAP Business Application Studio Toolkit and Access a Dev Space in Visual Studio Code

Steps

  1. Start Visual Studio Code and check the status and details of the SAP Business Application Studio toolkit.

    1. In the Windows start menu, choose Visual Studio Code.

    2. Choose Extensions on the left-hand side.

    3. In the Search Extensions in Marketplace field, enter sap business.

    4. Choose SAP Business Application Studio toolkit.

    5. Examine the details.

  2. In the SAP Business Application Studio Desktop Client, connect to your SAP Business Application Studio and access your FioriDev dev space.

    1. In your Visual Studio Code, choose SAP Business Application Studio Desktop Client on the left.

    2. Choose Connect Landscape.

    3. In the Landscape url field, enter the URL of your SAP Business Application Studio and choose Enter.

      Example

      https://dev-jw6tkqi9.eu10cf.applicationstudio.cloud.sap

    4. Select your landscape and choose Log in at the end of the line.

    5. In the Visual Studio Code popup asking for permission, choose Allow.

    6. In the Visual Studio Code popup asking to open the external website, choose Open.

    7. In the Web browser, log on using your SAP BTP account running your SAP Business Application Studio.

    8. Close the Web browser.

    9. In Visual Studio Code, select the FioriDev dev space.

    10. If the dev space is stopped, choose Start dev space at the end of the line.

    11. Choose Open in new window at the end of the line.

      Result

      The dev space opens in a new window of Visual Studio Code.

Log in to track your progress & complete quizzes