SAPB1 Web Client
SAPB1 Web Client
2024-09-26
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Tile Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 Working with Fiori App Extensions in Web Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Setting Up Fiori App Development Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Creating MTA Development Descriptor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
Developing a Hello World SAP UI5 App in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Developing a Fiori Worklist App in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Developing an Advanced Fiori Worklist App in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
3.2 Working with URL Mashup Extensions in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
Creating a URL Mashup App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating MTA Development Descriptor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Packaging the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Deploying the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Accessing the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Sample Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3 Working with Angular App Extensions in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Creating an Angular App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Packaging the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
Deploying the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Accessing the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Interacting with Service Layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Sample Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
3.4 Working with React App Extensions in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
Creating a React App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Packaging the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Deploying the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Accessing the App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Interacting with Service Layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Sample Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.5 Working with Vue App Extensions in Web Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7 Working with APIs That Generate Web Client Views URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
7.1 Generating Web Client Object Views URLs with APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257
Getting Variant List by Object Name and Object Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Getting URL of Object's List View by Object Name, Object Type and Variant GUID. . . . . . . . . . . 260
Getting URL of a Specific Record's Detailed View by Object Name, Object Type and Object Key
Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261
Getting URL of a Configuration Object's Detailed View by Object Key Value. . . . . . . . . . . . . . . . 263
Sample Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265
Example App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
7.2 Generating Web Client Analytics Views URLs with APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268
Getting View Codes by Analytics Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Getting Analytics View Variants List by View Code and Analytics Type. . . . . . . . . . . . . . . . . . . . 270
Getting URL of a Specific Analytics View by View Code, Analytics Type and Variant GUID. . . . . . . 271
Sample Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Example App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
The following table provides an overview of the most important document changes.
SAP Business One, Web client supports customers and partners in developing their own applications using
various technologies, managing the applications in a unified life cycle management, and interact with Web
client API and the Service Layer in a straightforward and intuitive manner. The capability of the Web client
extensibility is supported in the following aspects:
• The extensibility service is designed to support various types of extension applications, mainly consisting
of Fiori/SAPUI5 applications, URL mashup applications with an external backend service, and typical
frontend applications created by HTML/CSS/JavaScript. In the meantime, the extensibility service is
able to provide cross domain accessibility for the deployed applications in order to achieve better data
integration and create a more functional extensibility.
• A set of SAP Fiori tools are leveraged to facilitate the Fiori application development process. With these
tools, users do not need to build applications from scratch. Instead, typical Fiori applications with various
templates could be scaffolded quickly, effectively and efficiently. Meanwhile, the Service Layer is also
enhancedto adapt to these tools, so that users are able to build complicated applications by simply
following the steps in the tools' template.
• A standard application packaging technology (Multi-Target Application) is adopted to package the Web
client extension, which makes it possible to integrate with other SAP application platforms. The SAP
Business One Extension Manager supports the extension deployment and life cycle management.
• To embrace the open source world and the most popular frontend framework beyond the SAP community,
the extensibility service supports React, Vue, Angular and Blazor apps. Therefore, users from these
ecosystems, by leveraging their own expertise and knowledge other than just Fiori/SAPUI5, could fulfill
their potential to develop various applications with the most cutting-edge technology.
• As of SAP Business One 10.0 FP 2405, Web client UI API is exposed. It allows customers and partners
to create UI extensions on top of Web client, so that they can customize UI pages to suit their individual
business need.
Note
The backup and restoration of the Web client extensions relies on the recovery and backup features of
the SAP Business One database. The specific sections Backing Up Databases, Restoring Databases and
Backup Policy can be found in the SAP Business One Administrator's Guide and the SAP Business One
Administrator's Guide, version for SAP HANA.
The Web client extensibility-related databases are stored in the SLD (System Landscape Directory)
database. For more information, please refer to the backup and restoration of the database.
To develop the Web client extensions, you need to set up the environment before starting the development.
The Visual Studio Code Plugin for Web Client provides you with an all-in-one environment. If you install the
VS Code plugin, the development environment is set up for you automatically and doesn't require any manual
setup. You can write, debug, and test your extensions directly within VS Code, eliminating context switching.
Also, you can build and deploy your extensions directly to Web Client in a few easy steps.
As the development is based on Visual Studio Code, which supports Windows, Linux and MAC, if you want to
manually set up the development environment, the basic steps on how to prepare the environment on the three
different platforms are provided for you.
The following matrix provides you with an overview of which components should be installed for developing
different apps.
Components URL Mashup App Fiori App Vue App Angular App React App
Chocolatey (for X X X X X
Windows only)
Node.js X X X X
make X X X X X
mbt X X X X X
mta X X X X X
Yeoman generator X
generator-fiori X
vue_cli X
create-react-app X
@angular/cli X
Installer
The Visual Studio Code Plugin for Web Client installer is provided in the SAP Business
One installation/upgrade package. You can get the installer for the VS Code plugin from Upgrade
CD\Packages.x64\SDK. Run setup.exe and choose Visual Studio Code Plugin for Web Client.
After installation, you can find all installation scripts under SAP Business One SDK installation
path\Tools\WebClientVSCodePlugin.
Please note that the plugin is not yet released through the NPM repository and VS Code market.
• You have already installed node.js and made sure that its version is 16.20.2 or higher.
• You have already installed VS Code and made sure that its version is compatible with 1.85.0.
• You have installed PowerShell if you are working on Windows.
• You have an active internet connection and can access GitHub because, during the installation, some NPM
dependencies or tools will be downloaded from the NPM and the GitHub repository.
Installing on Windows
1. Log on to the Windows system and navigate to the installer folder. If you're a normal user, you'll be
prompted to run the installer as an administrator.
2. Double-click the install.bat file to install.
Double-click the Uninstall.bat file to uninstall.
Installing on Linux
1. Copy the installer folder from Windows, logon to the Linux system as a normal user, and navigate to the
installer folder.
2. Run the following commands to install.
chmod +x ./install.sh
sudo ./install.sh
chmod +x ./uninstall.sh
sudo ./uninstall.sh
Installing on Mac
Note
If you are using VS Code on MAC, ensure that you can launch the VS Code from the command line by typing
code. To do this, follow the steps below or see here .
1. Launch VS Code.
2. Open the Command Palette ( Cmd + Shift + P ) and type shell command to find the command
Shell Command: Install 'code' command in PATH.
1. Copy the installer folder from Windows, log on to the Mac system as a normal user, and navigate to the
installer folder.
2. Run the following commands to install.
chmod +x ./install.sh
sudo ./install.sh
chmod +x ./uninstall.sh
sudo ./uninstall.sh
Note
When you execute the install command on MAC, if you run into the error "sudo: unable to
execute ./install.sh: Operation not permitted.", it is probably because the default shell type
on MAC is zsh. In this case, you can try the following command:
Next Steps
Upon running the script, the following message appears to notify you that the installation will be performed.
Press any key to continue the installation.
===========================================================================
VS Code Plugin for SAP Business One Web Client Extensions
===========================================================================
This script will install the VS Code Plugins to develop the SAP Business One
Web Client Extensions. Please make sure that the VS Code and NodeJS are already
installed. Note that other required prerequisites will also be installed.
You can press any key to continue the installation. If you want to stop, just
close this window.
Press any key to continue ...
Upon success, you can find the plugin in the extensions list.
Because some countries/regions have potential problems accessing the GitHub repository, you may
encounter the following warning messages when installing mta or mbt during the installation process.
In this case, you need to specify an NPM proxy and manually run the following command as suggested:
Once this command has run, you can run the installer again to continue the installation, or you can simply
set a proxy for NPM like below:
Context
Note
If you have already installed Visual Studio Code Plugin for Web Client, you don't need to manually perform
the following steps to setup the development environment. The VS Code Plugin automatically sets up the
development environment for you.
To manually setup the development environment, install the following tools step by step.
Procedure
Chocolatey is an open source project that provides developers and admins alike a better way to manage
Windows software. To facilitate the installation of the following essential development software, Chocolatey
has to be installed first by running the following PowerShell command in a PowerShell terminal.
Note
You can download the latest LTS version for Windows x64 from the Nodejs website, or directly install
it by running the following command as an administrator in a command line. At the time of writing this
document, the latest version is 14.16.1.
You can download the latest stable version for Windows x64 from the Visual Studio Code website, or
directly install it by running the following command as an administrator in a command line.
4. Install the following tools to build a deployment-ready multi-target application archive (MTA).
The minimum requirement for the make version on Windows is 4.3, which can be checked by the
following command:
make --version
• MTA Tool
This tool is used to add MTA modules and is responsible for exploring and validating descriptor file
mta.yaml. Open a Node.js command prompt, then install the mta by running the following npm
command:
Context
Note
If you have already installed Visual Studio Code Plugin for Web Client, you don't need to manually perform
the following steps to setup the development environment. The VS Code Plugin automatically sets up the
development environment for you.
On Linux, as most steps are similar as the steps on Windows, this document will mainly focus on the
differences among the steps. Besides, there are many Linux distributions, so this document takes SUSE 15
as a typical example to illustrate how to manually setup the development environment.
Logon to the Linux system as a normal user without root privilege, then follow the below steps to finish the
environment setup.
You can download the latest binaries of the LTS version for Linux x64 from the Nodejs website, copy the
binaries to the appropriate bin and lib path.
Alternatively, simply download the source code, compile it and install it with the following command:
./configure
make
sudo make install
Run the following script to install the key and repository for VS code.
Then update the package cache and install the package using:
As for how to install VS code on other Linux distributions, please see https://code.visualstudio.com/docs/
setup/linux .
3. Install the following tools to build a deployment-ready multitarget application archive (MTA).
• GNU Make
By default, make is preinstalled with the OS. If not, run the following command to install it:
• MTA Tool
Open a terminal, install the mta locally by running the following npm command:
Context
Note
If you have already installed Visual Studio Code Plugin for Web Client, you don't need to manually perform
the following steps to setup the development environment. The VS Code Plugin automatically sets up the
development environment for you.
On MAC, as most steps are similar as the steps on Linux, this document mainly focus on the differences among
the steps, and takes macOS Big Sur 11.3.1 as an example to illustrate how to manually setup the development
environment.
Logon to the MAC system as a normal user without root privilege, follow the below steps to finish the
environment setup.
Procedure
You can download the latest Nodejs package for MAC from the Nodejs website and install it on your MAC
system with the default installation options.
2. Install Visual Studio Code
You can download the latest Visual Studio Code for MAC version , and follow the instructions in the
official installation guide to install it.
3. Install the following tools to build a deployment-ready multitarget application archive (MTA).
• GNU Make
By default, make is preinstalled with the macOS. If not, run the following command to install it:
Related Information
Introduction
SAP Fiori is the UX of the Intelligent Enterprise that changes the way you work and provides a set of
tools to facilitate the app creation process. For more information, please see: https://www.sap.com/products/
fiori.html . This tutorial will take a Hello World SAP UI5 app, a basic and an advanced Fiori worklist app, as
examples and walk you through the steps of creating the Fiori apps. You can directly access the Fiori apps as
standalone ones or access the Fiori apps in the Web client.
Prerequisites
Before developing the Fiori app on the Web client, please make sure that the Web client and Fiori App extension
development environment is already prepared.
Related Information
Context
To start the Fiori app development, the following additional tools need to be installed step-by-step.
Procedure
npm install -g yo
3. Open extensions in the left panel, install the SAP Fiori tools - Extension Pack. You can also install
other relevant Fiori extensions if you like.
MTA stands for Multi-Target Application, which is a package comprised of multiple libraries, and application
and resource modules. These have been created using different technologies and deployed to different
runtimes, but have a common life-cycle. You can bundle different modules together, describe them along with
their inter-dependencies and package them in an MTA. For more information, see MTA Documentation .
The file mta.yaml is the development descriptor for MTA, and is the prerequisite for the Fiori app
development. As a result, it needs to be created first in the following way:
_schema-version: "3.2"
ID: ext-hello-world
version: 0.0.1
provider: SAP
parameters:
deploy_mode: b1-webclient
Note
The name of the mta.yaml is case-sensitive. Please ensure its name is in lower case letters.
Note
The freestyle SAP UI5 templates are removed from the SAP Fiori generator as of version 1.12.2. Therefore,
this document for creating freestyle SAP UI5 extensions are deprecated.
If you want to continue to use the removed templates, please install an older version of SAP Fiori app tools
prior to version 1.12.2. For example, use the following command to install 1.12.1:
If you encounter the error: "Failed to load 'sap/insights/library.js", please refer to SAP Note 3500401 .
This tutorial will walk you through the basic steps of creating a "Hello World" application with SAP UI5 style for
the Web client by using the SAP Fiori tools in Visual Studio Code.
Related Information
Procedure
1. Launch Visual Studio Code, click Ctrl + Shift + P to open the Command Palette, and enter Fiori:
Open Application Generator to open the Template Wizard.
2. Select SAPUI5 freestyle in the Application Type field and choose SAPUI5 Application as the floorplan.
3. In Data Source and Service Selection, select None as the data service and choose Next.
Note
As the mta.yaml exists in the project folder, make sure the radio button of option Add deployment
configuration to MTA project is selected as Yes.
Note
7. Choose Finish to finish the whole process. Wait for a while for the project to be created.
8. Open a terminal in VS code, navigate to the hello-world folder and type the following command to install
and run this application.
npm install
npm start
After you create the SAP UI5 app, there is only a simple Title displayed in the initial page, which is of little
practical use. Therefore, you need to customize the app for wider usage.
Related Information
Procedure
<mvc:View
controllerName="sapb1.helloworld.controller.HelloWorld"
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true"
xmlns="sap.m"
>
<Shell id="shell">
<App id="app">
<pages>
<Page id="page" title="{i18n>title}">
<content>
2. To interact with the controls, add response logic for the UI events.
1. Open the file hello-world\webapp\controller\HelloWorld.controller.js.
2. Implement the onInit function and add the implementation for onShowHello.
3. Import two libraries sap/m/MessageToast and sap/ui/model/json/JSONModel.
4. Specify the function parameters for these libraries respectively.
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast",
"sap/ui/model/json/JSONModel"
],
/**
* @param {typeof sap.ui.core.mvc.Controller} Controller
* @param {typeof sap.m.MessageToast} MessageToast
* @param {typeof sap.ui.model.json.JSONModel} JSONModel
*/
function (Controller, MessageToast, JSONModel) {
"use strict";
return Controller.extend("sapb1.helloworld.controller.HelloWorld", {
onInit: function () {
// set data model on view
var oData = {
recipient: {
name: "World"
}
};
var oModel = new JSONModel(oData);
this.getView().setModel(oModel);
},
onShowHello: function () {
MessageToast.show("Hello World");
}
});
});
title=Hello World
appTitle=HelloWorld
appDescription=This is a Web Client extension created by Fioir app
4. Run this application again, and the UI is displayed in the following page.
This UI would be automatically refreshed if the app is never stopped, as the Fiori tools would monitor
the code change and apply the change to the UI instantly.
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
1. Navigate to the folder hello-world\webapp under your project, create the extension configuration file
WebClientExtension.json, and add the tile information by specifying the tile fields with a meaningful
value.
{
"tiles": [
{
"text": "HelloWorld",
"subtitle": "Web Client Fiori Application Extension",
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, you must specify a valid SAP Icon. You can explore the SAP Icon library from here
and select one according to your own preferences.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
The KPI service must return a single numeric value. You could refer to the return value of OData
specification of $count.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
2. Start the package process by typing the following command in a terminal, and make sure that you are in
the path of the mta.yaml file location.
mbt build
Upon success, in the mta_archives folder, the .mtar file would be generated.
The mtar naming convention is <ID>_<version>.mtar. The ID and version can be found in
mta.yaml.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Related Information
Procedure
1. Log in to the Web client, click the Extensions tab, find the extension and open it.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
Note
The freestyle SAP UI5 templates are removed from the SAP Fiori generator as of version 1.12.2. Therefore,
this document for creating freestyle SAP UI5 extensions are deprecated.
If you want to continue to use the removed templates, please install an older version of SAP Fiori app tools
prior to version 1.12.2. For example, use the following command to install 1.12.1:
If you encounter the error: "Failed to load 'sap/insights/library.js", please refer to SAP Note 3500401 .
This tutorial takes the business object Business Partners as an example to illustrate the basics of how to create
the default Fiori worklist app, and how to access the object pages in the Web client.
Related Information
Procedure
1. Launch Visual Studio Code, click Ctrl + Shift + P to open the Command Palette, and enter Fiori:
Open Application Generator to open the Template Wizard.
2. Select SAPUI5 freestyle in the Application Type field and choose SAP Fiori Worklist Application as the
floorplan.
3. In Data Source and Service Selection, select OData as the data service, enter the credentials of your local
Service Layer and click the Login icon.
OData service URL For this field, enter the Service Layer address in the following format:
https://<hostname>:<https-port>/b1s/v2/
By default, the Service Layer uses port 50000 and provides HTTPS service. For the HTTPS,
please ensure your Service Layer has a trusted certificate. Otherwise, some error messages
would be displayed, indicating the connection fails due to security issues.
A workaround is to enter a Service Layer address starting with HTTP instead of HTTPS, and
choose a HTTP port (e.g. 50001) as the port number:
http://<hostname>:<http-port>/b1s/v2/
Service username The Fiori app uses basic authentication to logon to the Service Layer, and this authentication
only allows you to enter a user name and password. However, the Service Layer needs the
third parameter to specify the CompanyDB. Thus, UserName and CompanyDB are combined
together in a JSON format like below as the Service username for basic authentication.
Service password Enter the password for the SAP Business One user.
As the Fiori app works with OData V2/V4 and the Service Layer provides OData V3/V4, we should
choose OData V4 to match each other. For legacy reasons, the Service Layer takes /b1s/v2 as an
OData V4 endpoint. Please do not be confused by /b1s/v2.
4. In Entity Selection, to customize the main entity attributes, you can select an entity (for example,
BusinessPartners) and select the properties according to your own specific requirement in the following
way.
Field Description
Object ID Corresponding to the title property of the ObjectIdentifier control in SAP UI5.
The ObjectIdentifier is a display control that enables the user to easily identify a specific
object. The ObjectIdentifier title is the key identifier of the object and additional text and icons
can be used to further distinguish it from other objects.
Object number Corresponding to the number property of the ObjectNumber control in SAP UI5.
The ObjectNumber control displays number and number unit properties for an object. The
number can be displayed using semantic colors to provide additional meaning about the
object to the user.
Object unit of meas- Corresponding to the unit property of ObjectNumber control in SAP UI5.
ure
Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used.
Under the scene, the Application Wizard will generate the following worklist xml view for this step:
<semantic:content>
<Table
id="table"
width="auto"
items="{
path: '/BusinessPartners',
sorter: {
path: 'CardName',
descending: false
}
}"
noDataText="{worklistView>/tableNoDataText}"
growing="true"
growingScrollToLoad="true"
updateFinished=".onUpdateFinished">
<headerToolbar>
<Toolbar>
<Title id="tableHeader" text="{worklistView>/
worklistTableTitle}"/>
<ToolbarSpacer />
<SearchField
id="searchField"
tooltip="{i18n>worklistSearchTooltip}"
search=".onSearch"
width="auto">
</SearchField>
</Toolbar>
</headerToolbar>
<columns>
<Column id="nameColumn">
<Text text="{i18n>tableNameColumnTitle}"
id="nameColumnTitle"/>
</Column>
<Column id="unitNumberColumn" hAlign="End">
<Text text="{i18n>tableUnitNumberColumnTitle}"
id="unitNumberColumnTitle"/>
</Column>
</columns>
<items>
<ColumnListItem
type="Navigation"
press=".onPress">
<cells>
<ObjectIdentifier
title="{CardName}"/>
<ObjectNumber
number="{
path: 'GroupCode',
formatter: '.formatter.numberUnit'
}"
unit="{DebitorAccount}"/>
</cells>
</ColumnListItem>
</items>
</Table>
</semantic:content>
Note
As the mta.yaml exists in the project folder, make sure the radio button of option Add deployment
configuration to MTA project is selected as Yes.
Note
8. Open a terminal in VS code, type the following command to install and run this application.
npm install
npm start
Note
Basic authentication is used to logon to the Service Layer. CompanyDB, combined with UserName in a
JSON format string, is used as the user name for authentication.
12. From the debug window/terminal, you can check the following requests to the Service Layer.
GET /b1s/v2/BusinessPartners('c2')?
$select=CardCode,CardName,DebitorAccount,GroupCode
GET /b1s/v2/$metadata
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
Procedure
1. Navigate to the webapp folder under your project, create the extension configuration file
WebClientExtension.json, and add the tile information by specifying the tile fields with a meaningful
value.
{
"tiles": [
{
"text": "fiori-servicelayer-app",
"subtitle": "Web Client Fiori Application Extension",
"icon": "sap-icon://customize"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
}
]
}
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, you must specify a valid SAP Icon. You can explore the SAP Icon library from here
and select one according to your own preferences.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
The KPI service must return a single numeric value. You could refer to the return value of OData
specification of $count.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
mbt build
Note
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Related Information
Procedure
1. Log in to the Web client, click the Extensions tab, find the extension and open it.
Note
In the Web Client context, the worklist page in this step would be displayed directly, without requesting
logon credentials.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
Note
The freestyle SAP UI5 templates are removed from the SAP Fiori generator as of version 1.12.2. Therefore,
this document for creating freestyle SAP UI5 extensions are deprecated.
If you want to continue to use the removed templates, please install an older version of SAP Fiori app tools
prior to version 1.12.2. For example, use the following command to install 1.12.1:
If you encounter the error: "Failed to load 'sap/insights/library.js", please refer to SAP Note 3500401 .
This tutorial takes the business object Service Call as an example to illustrate how to extend the default Fiori
Worklist app and how to access the object pages in the Web client.
Prerequisites
You know how to setup the development environment and the basics of VS code, Node JS.
Make sure you are familiar with the Fiori Tools in VS code and know how to create a basic Fiori application.
Context
The application will show a list view of all service calls and a detailed view of a specific service call.
Procedure
1. Launch Visual Studio Code, click Ctrl + Shift + P to open the Command Palette, and enter Fiori:
Open Application Generator to open the Template Wizard.
2. Select SAPUI5 freestyle in the Application Type field and choose SAP Fiori Worklist Application as the
floorplan.
Field Description
OData service URL For this field, enter the Service Layer address in the following format:
https://<hostname>:<https-port>/b1s/v2/
By default, the Service Layer uses port 50000 and provides HTTPS service. For the HTTPS,
please ensure your Service Layer has a trusted certificate. Otherwise, some error messages
would be displayed, indicating the connection fails due to security issues.
A workaround is to enter a Service Layer address starting with HTTP instead of HTTPS, and
choose a HTTP port (e.g. 50001) as the port number:
http://<hostname>:<http-port>/b1s/v2/
Service username The Fiori app uses basic authentication to logon to the Service Layer, and this authentication
only allows you to enter a user name and password. However, the Service Layer needs the
third parameter to specify the CompanyDB. Thus, UserName and CompanyDB are combined
together in a JSON format like below as the Service username for basic authentication.
Service password Enter the password for the SAP Business One user.
As the Fiori app works with OData V2/V4 and the Service Layer provides OData V3/V4, we should
choose OData V4 to match each other. For legacy reasons, theService Layer takes /b1s/v2 as an OData
V4 endpoint. Please do not be confused by /b1s/v2.
4. In Entity Selection, select ServiceCalls in Object Collection, use ServiceCallID in Object collection
key, choose Subject in Object ID and enter None in Object unit of measure.
Note
Field Description
Object ID Corresponding to the title property of the ObjectIdentifier control in SAP UI5.
The ObjectIdentifier is a display control that enables the user to easily identify a specific
object. The ObjectIdentifier title is the key identifier of the object and additional text and icons
can be used to further distinguish it from other objects.
Object number Corresponding to the number property of the ObjectNumber control in SAP UI5.
The ObjectNumber control displays number and number unit properties for an object. The
number can be displayed using semantic colors to provide additional meaning about the
object to the user.
Object unit of meas- Corresponding to the unit property of ObjectNumber control in SAP UI5.
ure
Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used.
6. Choose Finish and wait for the project to be created. After that, open a terminal and enter the following
commands to start the project:
npm install
npm start
7. Click the service-call-app tile to show the default worklist view and object view.
Procedure
1. Open Worklist.view.xml, go to <columns></columns> , and add the following column between the
two existing columns.
<Column id="customerCodeColumn">
<Text text="{i18n>tableCustomerCodeColumnTitle}" id="customerCodeTitle"/>
</Column>
2. Go to <cells></cells>, add the corresponding cell for this column between the two existing cells.
<Text text="{CustomerCode}"/>
Make sure the cell and the column match each other in order.
tableCustomerCodeColumnTitle=BP Code
<Column id="customerNameColumn">
<Text text="{i18n>tableCustomerNameColumnTitle}"
id="customerNameTitle"/>
</Column>
<Column id="itemCodeColumn">
<Text text="{i18n>tableItemCodeColumnTitle}" id="itemCodeTitle"/>
</Column>
<Column id="descriptionColumn">
<Text text="{i18n>tableDescriptionColumnTitle}" id="descriptionTitle"/>
</Column>
<Text text="{CustomerName}"/>
<Text text="{ItemCode}"/>
<Text text="{Description}"/>
• Changes to i18n/i18n.properties
tableCustomerNameColumnTitle=BP Name
tableItemCodeColumnTitle=Item Code
tableDescriptionColumnTitle=Description
6. To unify the naming convention, modify the translated text for the two existing columns in i18n/
i18n.properties by removing the brackets and renaming ServiceCallsPlural to ServiceCalls,
<ServiceCalls> to ServiceCalls.
#original
tableNameColumnTitle=<Subject>
#changed
tableNameColumnTitle=Subject
tableUnitNumberColumnTitle=Status
Save the changes and re-run the project. The view is updated as below:
Context
To display the Status field in a meaningful manner, follow the below steps to format it.
Procedure
1. Open Worklist.view.xml, go to <cells></cells>, and change the Status field by adding two
formatters.
<ObjectNumber
number="{ path:'Status',formatter: '.formatter.valueFormat'
}"
unit="{}"
state="{path: 'Status',formatter: '.formatter.stateFormat'}"
/>
sap.ui.define([
"sap/ui/core/library"
] , function (coreLibrary) {
"use strict";
// shortcut for sap.ui.core.ValueState
var ValueState = coreLibrary.ValueState;
return {
...
/**
* Converts the status from an integer to a string
*/
valueFormat : function (status) {
if(status == -1){
return "Closed";
}else if(status == -2){
return "Pending";
}else if(status == -3){
return "Open";
}
return "Undefined"
},
/**
* Defines a value state based on the status
*/
stateFormat: function(status) {
if(status == -1){
return ValueState.Error;
}else if(status == -2){
return ValueState.Warning;
}else if(status == -3){
return ValueState.Success;
}
return ValueState.Error;
}
};
});
Procedure
<semantic:titleHeading>
<Title text="{CustomerCode} - {CustomerName}" />
</semantic:titleHeading>
Note
The ObjectAttribute with text CustomerCode represents a link and is clickable. It therefore has an
event handler upon pressing, and you can find the corresponding implementation for this handler in the
next section.
3. Import the layout namespace sap.ui.layout by editing <mvc:View>, as this layout is referenced in
semantic:headerContent.
xmlns:layout="sap.ui.layout"
4. Save the changes and re-run the application. Upon success, the view is as below.
When you press the business partner link, an error occurs. You should add the handler for this link.
Related Information
Procedure
sap.ui.define([
"./BaseController",
"sap/ui/model/json/JSONModel",
"sap/ui/core/routing/History",
'sap/m/library',
"../model/formatter"
], function (BaseController, JSONModel, History, library, formatter) {
"use strict";
Note
Below is the API to get the relative URL for a specific Business Partner Object.
GET /extn/objectsDetailView?objName=BusinessPartners&value=<CardCode>
Note
Call the API to get the relative URL for a specific Items object.
GET /extn/objectsDetailView?objName=Items&value=<ItemCode>
Related Information
Working with APIs That Generate Web Client Views URLs [page 257]
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
{
"tiles": [
{
"text": "Service Call App",
"subtitle": "fiori app based on servicelayer",
"icon": "sap-icon://add-contact"
"icon": "sap-icon://add-customize"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
}
]
}
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, you must specify a valid SAP Icon. You can explore the SAP Icon library from here
and select one according to your own preferences.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
mbt build
Note
The mtar naming convention is <ID>_<version>.mtar. The ID and version can be found in
mtar.yaml.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Related Information
Procedure
1. Log in to the Web client, click the Extensions tab, find the extension and open it.
In the Web client, the worklist page in this step would be displayed directly, without requesting logon
credentials.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
Introduction
Mashups are used to integrate data from the Web client with data provided by an online Web service or
application from partners. This tutorial will walk you through the basic steps of creating a URL Mashup app and
accessing it in the Web client.
Prerequisites
Before developing the URL Mashup app on the Web client, please make sure that the Web client extension
development environment is already prepared.
Related Information
Procedure
1. Go to your workspace folder and create a new project folder. In our example we will use urlLink.
2. Under the project folder urlLink, create the extension configuration file WebClientExtension.json,
and add the tile information by specifying the tile fields with a meaningful value.
{
"tiles": [
{
"text": "Text1",
"subtitle": "Subtile1",
"url": "https://sap.com",
"linkmethod": "NewWindow",
"icon": "sap-icon://add-process"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
},
{
"text": "Text2",
"subtitle": "Subtile2",
"url": "https://www.bing.com/",
"linkmethod": "ExistingWindow",
"icon": "sap-icon://task"
"size": "1x2",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
},
{
"converter": "kpiNumber",
"endpoint": "https://mylocalKPIservice/KPInumber"
}
]
}
}
]
}
You can change the modifiable fields below according to their specific business scenario.
Field Description
subtitle This field is used to specify the short sub-title text below
the title.
icon This field is used to specify a valid SAP Icon. You can
explore the SAP Icon library from here and select one
according to your own preference.
size This field is used to specify the dimension of the tile. The
supported dimensions are 1x1 and 1x2. By default, the
dimension is 1x1.
dynamicContent This field is used to display a numeric KPI value on the tile.
You should configure the endpoints of the KPI service.
Note
The KPI service must return a single numeric value.
You could refer to the return value of OData specifica-
tion of $count.
Of all the supported parameters, url is mandatory while other fields are suggested to be assigned with a
proper value. Otherwise, default tiles would be created for this app and displayed in the UI, which is less
informational and therefore not recommended.
Note
For security purposes, keep in mind that the URL must start with https, otherwise the app would suffer
a loading failure in the Web client.
Because some websites might apply the same origin policy, they are probably not accessible from the
Web client if opened in the existing window mode. To resolve this potential issue, the pages from the url
must be allowed to be served in an iFrame, via X-Frame-Options and/or Content-Security-Policy
http response headers.
Go to your workspace folder, create a mta.yaml file with a URL Mashup module. The module type should be
url-mashup. The module path should be the URL Mashup project path from the root of your workspace folder.
_schema-version: "3.2"
ID: ext-urlMashUp
version: 0.0.1
provider: SAP
modules:
- name: myLink
type: url-mashup
path: urlLink
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
1. Start the package process by typing the following command in a terminal, and make sure that you are in
the path of the mta.yaml file location.
mbt build
2. Upon success, a folder naming with mta_archives is generated. Find the mtar archive in this folder.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Related Information
Log in to the Web client, click the Extensions tab, find the extension and open it.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
Introduction
This tutorial will walk you through the basic steps of creating an Angular app and accessing this app in the Web
client.
Prerequisites
Before developing the angular app on the Web client, please make sure that the Web client extension
development environment is already prepared.
Related Information
Context
An assumption that you are familiar with the Angular app development and that you already know the Angular
fundamentals. For more information about Angular, please see https://angular.io/ .
There are many ways to create an Angular app. In this document, the Angular CLI, as a command-line interface
tool, is used to walk you through the basic steps of creating an Angular app. For more information, please see
https://angular.io/cli .
Procedure
1. Open a terminal, install the CLI using the npm package manager:
This command will create a directory called my-app inside the current folder.
3. Navigate to the app folder and run this command to check if it works.
cd my-app
ng serve
Upon success, a browser window pops up to show the app home page. By default, the app runs at this
endpoint.
http://localhost:4200
If the browser window does not show up, you need to manually open it and visit the above endpoint.
4. Build the app.
Note
To configure the app to be served from a different path, add a build parameter --base-href=./. This
will make sure all the asset paths are relative to the index.html. You will then be able to move the
app from http://mywebsite.com to http://mywebsite.com/relativepath without having to
rebuild it.
5. Open this project in VS code; the folder structure looks like below:
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
_schema-version: "3.2"
ID: ext-angular-app
version: 0.0.1
provider: SAP
modules:
- name: my-angular-app
type: single-page-app
2. Navigate to the dist/my-app folder under your project, create the extension configuration file
WebClientExtension.json, and add the tile information by specifying the tile fields with a meaningful
value.
{
"tiles": [
{
"text": "angular-app-webclient",
"icon": "sap-icon://customize",
"url": "index.html",
"subtitle": "Web Client Angular Application Extension"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
}
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, only sap icons are supported. For more icons, please see https://ui5.sap.com/test-
resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons
The entry point to load an Angular app is index.html and it needs to be specified in the url field in
WebClientExtension.json.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
The KPI service must return a single numeric value. You could refer to the return value of OData
specification of $count.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
3. In a command line terminal, run the following command to build the package.
mbt build
The mtar naming convention is <ID>_<version>.mtar. The ID and version can be found in
mta.yaml.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Procedure
1. Log in to the Web client, click the Extensions tab, find the extension and open it.
Context
Considering it is a common requirement to access the Service Layer in the extension, in the Web client context,
it is designed to allow customers to interact with the Service Layer without logging on to the Service Layer.
Inside the Angular app, follow the steps below to manipulate resources from the Service Layer.
Procedure
2. Open my-app/src/app/app.component.html, add a button styled span with some description text to
trigger this function between Resources and Next Steps.
3. Repeat the build, package and deployment process, you will find the updated Angular app in the Web client.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
Introduction
This tutorial will walk you through the basic steps of creating a React app and accessing it in the Web client.
Before developing the React app on the Web client, please make sure that the Web client extension
development environment is already prepared.
Related Information
Context
An assumption that you are familiar with the React app development and you already know the React
fundamentals. There are many ways to create a React app. In this document, the create-react-app tool is
Procedure
create-react-app my-app
This command will create a directory called my-app inside the current folder.
3. Navigate to the app folder and run this command to check if it works.
cd my-app/
npm start
Upon success, a browser window pops up to show the app home page. By default, the app runs at this
endpoint.
http://localhost:3000
4. Configure the app to be served from a different path.
By default, the index.html references the assets in an absolute path. This means that if this app is
deployed into another web server it would probably not work, as the absolute path would change and, as a
result, the assets would not be found.
"homepage": "."
This will make sure all the asset paths are relative to the index.html. You will then be able to move
the app from http://mywebsite.com to http://mywebsite.com/relativepath without having to
rebuild it.
5. Build the app.
cd my-app/
npm run build
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
_schema-version: "3.2"
ID: ext-react-app
version: 0.0.1
provider: SAP
modules:
- name: my-react-app
type: single-page-app
2. Navigate to the build folder under your project, create the extension configuration file
WebClientExtension.json, and add the tile information by specifying the tile fields with a meaningful
value.
{
"tiles": [
{
"text": "react-app-webclient",
"icon": "sap-icon://customize",
"url": "index.html",
"subtitle": "Web Client React Application Extension"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
}
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, you must specify a valid SAP Icon. You can explore the SAP Icon library from here
and select one according to your own preferences.
The entry point to load a React app is index.html and it needs to be specified in the url field in the
WebClientExtension.json.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
The KPI service must return a single numeric value. You could refer to the return value of OData
specification of $count.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
3. Start the package process by typing the following command in a terminal, making sure that you are in the
path of the mta.yaml file location.
mbt build
The mtar naming convention is <ID>_<version>.mtar. The ID and version can be found in
mta.yaml.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Procedure
1. Log in to the Web client, click the Extensions tab, find the extension and open it.
Context
Considering it is a common requirement to access the Service Layer in the extension, in the Web client context,
it is designed to allow customers to interact with the Service Layer without logging on to the Service Layer.
Inside the React app, follow the below steps to manipulate resources from the Service Layer.
Procedure
function accessServiceLayer(){
fetch("/b1s/v1/BusinessPartners?$select=CardCode, CardName&$top=1")
.then(res => res.json())
.then(
(result) => {
alert("Response from Service Layer:\n" + JSON.stringify(result));
},
(error) => {
alert(error);
}
)
}
<div>
<button className="App-button" onClick={accessServiceLayer}>Access
ServiceLayer</button>
</div>
.App-button{
color: white;
font-size: 18px;
display:inline-block;
background-color: transparent;
margin: 25px;
padding:10px
}
4. Combine Step 1 and Step 2, the code snippet of the entire App.js is as below:
5. Repeat the build, package and deployment process, you will find the updated react app in the Web client.
Press the Access ServiceLayer button, and upon success, a Business Partner is returned from the Service
Layer.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
Introduction
This tutorial will walk you through the basic steps of creating a Vue app and accessing it in the Web client.
Prerequisites
Before developing the vue app on the Web client, please make sure the Web client extension development
environment is already prepared.
Related Information
Context
An assumption that you are familiar with the Vue app development and you already know the Vue
fundamentals. For more information about Vue, please see https://vuejs.org/ .
There are many ways to create a Vue app. In this document, the Vue command line tool is used to walk you
through the basic steps of creating one Vue app. For more information, please see https://cli.vuejs.org/guide/
creating-a-project.html#vue-create .
Procedure
This command will create a directory called my-app inside the current folder.
3. Navigate to the app folder and run this command to check if it works.
cd my-app/
npm run serve
Upon success, a browser window pops up to show the app home page. By default, the app runs at this
endpoint.
http://localhost:8080/
4. Configure the app to be served from a different path.
By default, the index.html references the assets in an absolute path. This means that if this app is
deployed into another web server it would probably not work, as the absolute path would change and, as a
result, the assets would not be found.
module.exports = {
// options...
publicPath:'./'
}
This will make sure all the asset paths are relative to the index.html. You will then be able to move
the app from http://mywebsite.com to http://mywebsite.com/relativepath without having to
rebuild it.
For more information about Vue app deployment instructions, see https://cli.vuejs.org/guide/
deployment.html .
5. Build the app.
Context
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
You can also perform the following steps to manually package your application.
Procedure
_schema-version: "3.2"
ID: ext-vue-app
version: 0.0.1
provider: SAP
modules:
- name: my-vue-app
type: single-page-app
path: dist
parameters:
deploy_mode: b1-webclient
2. Navigate to the folder dist under your project, create the extension configuration file
WebClientExtension.json, and add the tile information by specifying the tile fields with a meaningful
value.
{
"tiles": [
{
"text": "vue-app-webclient",
"icon": "sap-icon://customize",
"url": "index.html",
"subtitle": "Web Client Vue Application Extension"
"size": "1x1",
"dynamicContent": {
"repositories": [
{
"converter": "kpiNumber",
"endpoint": "/b1s/v2/PurchaseOrders/$count"
}
]
}
}
]
}
Without this file, a default tile would be created for this app and displayed in the UI, which is less
informative and therefore not recommended.
Note
For the icon field, only sap icons are supported. For more icons, please see https://ui5.sap.com/test-
resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons
The entry point to load an Vue app is index.html and it needs to be specified in the url field in the
WebClientExtension.json.
Note
As of FP 2111, you can configure the tile with a numeric KPI value. You can enable the property
“dynamicContent” and configure the endpoints of the KPI service.
The KPI service must return a single numeric value. You could refer to the return value of OData
specification of $count.
In addition to Service Layer $count services, you can also use a local customized KPI service, which
should allow access from the webclient domain if it's Cross-Origin resource.
mbt build
The mtar naming convention is <ID>_<version>.mtar. The ID and version can be found in
mta.yaml.
4. (Optional) The package process can also be accomplished by the VS Code Multi-Target Application tool.
The prerequisite is that it is already installed and the path environment is correctly configured in the
Environment Setting section. There are two ways to invoke the package command.
• Click Ctrl + Shift + P , input MTA and open Build MTA to trigger the packaging process.
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Procedure
1. Log on to the Web client, click the Extensions tab, find the extension and open it.
Context
Considering it is a common requirement to access the Service Layer in the extension, in the Web client context,
it is designed to allow customers to interact with the Service Layer without logging on to the Service Layer.
Inside the Vue app, follow the below steps to retrieve resources from the Service Layer.
Procedure
export default {
name: 'HelloWorld',
props: {
msg: String
},
methods:{
accessServiceLayer: function(){
fetch("/b1s/v1/BusinessPartners?$select=CardCode, CardName&$top=1")
.then(res => res.json())
.then(
(result) => {
alert("Response from Service Layer:\n" + JSON.stringify(result));
},
(error) => {
alert(error);
}
)
}
}
}
3. Check the code in the red rectangle, the HelloWorld.vue looks like below:
Press the Access ServiceLayer button, and upon success, a Business Partner is returned from the
Service Layer.
To have a better understanding of this app, the source code and the mtar package is also provided in the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
Introduction
This tutorial will walk you through the basic steps of creating a Blazor app, and how to access this app in the
Web client. The Blazor app is composed of reusable web UI components built using C#, HTML, and CSS. With
Blazor, developers can build client and server code with C#. They can also share code and libraries with the
front-end client code and back-end logic. Using C# for all code simplifies sharing data between the front end
and back end, and the code reuse can accelerate development and maintenance.
Prerequisites
Before developing the Blazor app on the Web client, please make sure:
Related Information
An assumption that you are familiar with the Blazor app development and you already know the fundamentals
of Blazor. For more details about Blazor, see here .
This document will use Visual Studio 2019 and Visual Studio 2022 respectively to demonstrate how to create a
Blazor app. Please note that there are slight differences in the creation steps between the two versions of Visual
Studio.
Related Information
Procedure
1. Open Visual Studio 2019 and get started with Create a new project.
3. Configure your new project as below. Let's stick to the default configuration.
4. Select .NET 5.0 and Blazor WebAssembly App, leaving the remaining options as they are. Choose Create.
7. In the left panel, click Fetch data; the application loads local weather forecast data.
In the meantime, in the Output window, you can check the relevant log and the destination location for
publishing.
BlazorApp1 ->
C:\Users\administrator\source\repos\BlazorApp1\BlazorApp1\obj\Release\net5.0\b
rowser-wasm\PubTmp\Out\
Web App was published successfully file:///C:/Users/administrator/source/
repos/BlazorApp1/BlazorApp1/bin/Release/net5.0/browser-wasm/publish/
In the subfolder wwwroot, open index.html and search for the href tag shown below:
To enable the app to be served from a relative path in a web server, change the href tag as follows:
Procedure
1. Open Visual Studio 2022 and get started with Create a new project.
4. In the Framework field, select .NET 6.0, leaving the remaining options as they are, and choose Create.
7. In the left panel, click Fetch data; the application loads local weather forecast data.
BlazorApp1 ->
C:\Users\administrator\source\repos\BlazorApp1\BlazorApp1\obj\Release\net6.0\b
rowser-wasm\PubTmp\Out\
Web App was published successfully file:///C:/Users/administrator/source/
repos/BlazorApp1/BlazorApp1/bin/Release/net6.0/browser-wasm/publish/
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
In the subfolder wwwroot, open index.html and search for the href tag shown below:
To enable the app to be served from a relative path in a web server, change the href tag as follows:
Note
We strongly recommend that you package your application by using the VS Code Wizard for SAP Business
One Web Client Extensions. For more information, see Packaging Your Apps Using VS Code Wizard for SAP
Business One Web Client Extensions [page 115].
Follow the deployment steps to deploy this mtar archive into the Web client by Extension Manager.
Related Information
Procedure
1. Log on to the Web client, click the Extensions tab, find the extension and then open it.
Context
It is a common requirement to access Service Layer in the extension, in the Web client context, so it is designed
to allow customers to interact with Service Layer without logging into the Service Layer.
Inside the Blazor app, follow the steps below to access resources from Service Layer.
Procedure
1. To add a navigation item, in the current project, open the file NavMenu.razor in the Shared folder.
Navigate to the div with class @NavMenuCssClass and add the following content.
2. To handle the JSON format responses from Service Layer, we need to install a JSON library
Newtonsoft.Json. Click the Tools menu, select NuGet Package Manager, click Package Manager Console,
and add the Newtonsoft.Json NuGet package to this project by typing the following command in the
console.
@using System;
@using System.Text;
@using Newtonsoft.Json;
@using Newtonsoft.Json.Linq;
@using System.Net
4. To create a UI page for this functionality, in the Pages folder, create a file ServiceLayer.razor. In this
file, add the UI part and the relevant C#code for this UI.
Here we only show some code snippets regarding the CRUD operations.
As shown above, the HttpClient is injected as Http, which can be used to interact with Service Layer.
5. Repeat the steps to publish, package and deploy this app.
6. The final result is as below. You can do some CURD operations for some typical business objects.
Context
A Blazor app can invoke JavaScript (JS) functions from .NET methods and .NET methods from JS functions.
These scenarios are called JavaScript interoperability (JS interop). For more details, please check out the
official Blazor website. This document will simply illustrate how to invoke JavaScript from the C# method to get
a Business Partner list.
Procedure
1. In your current project, create a JavaScript file jsExample.js with the following code in the folder
wwwroot\scripts. The JavaScript file retrieves some properties of Business Partner from Service Layer.
3. To create a UI page for this functionality, in the Pages folder, create a file InvokeJavaScript.razor,
which will include some HTML and C# code to implement the interactive behavior for the UI. For the entire
code , please check the source code.
4. To add a descriptive button to trigger the retrieve Business Partner list operation, add the following HTML
code. The text on this button is bound to a variable _buttonText, indicating the status of this button.
<div class="card">
<div class="card-header">
JavaScript Interop
</div>
<div class="card-body">
<h5 class="card-title">Get Business Partners</h5>
<p class="card-text">This component demonstrates fetching data from
Service Layer by invoking JavaScript from C#.</p>
<input type="button" class="btn btn-primary"
@onclick="GetBusinessPartners" @bind="_buttonText" />
</div>
</div>
To display the Business Partner properties, add a table in the following HTML code. As the table is only
rendered when the response data is available, we need a variable _bpResponse to conditionally control it.
5. To manage the JavaScript module, inject the JS runtime by adding the following code at the top of the file.
@implements IAsyncDisposable
@inject IJSRuntime JS
@code {
public class BusinessPartner
{
public string CardCode { get; set; }
public string CardName { get; set; }
public string CardType { get; set; }
public string Currency { get; set; }
public int GroupCode { get; set; }
}
public class BPResponse
{
public BusinessPartner[] value { get; set; }
}
// code continue ...
}
7. Define the bind variable for the UI and the variable for JavaScript module.
@code {
// following preceding code ...
private IJSObjectReference module;
private BusinessPartner[] _bpList;
private string _buttonText = "Click Me !!!";
private BPResponse _bpResponse = null;
// code continue ...
}
@code {
// following preceding code ...
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
module = await JS.InvokeAsync<IJSObjectReference>("import", "./
scripts/jsExample.js");
}
}
// code continue ...
}
9. Invoke the method in JavaScript to get Business Partner list, and update relevant variables accordingly.
@code {
// following preceding code ...
private async Task GetBusinessPartners()
{
_buttonText = "Sending...";
_bpResponse = null;
ValueTask<BPResponse> getBPTask =
module.InvokeAsync<BPResponse>("JSGetBP");
_bpResponse = await getBPTask;
_buttonText = "Click Me !!!";
}
// code continue ...
}
@code {
// following preceding code ...
async ValueTask IAsyncDisposable.DisposeAsync()
{
11. Repeat the steps to publish, package and deploy this app.
12. The final result is as below. You can click the button to get the list.
To have a better understanding of this app, the source code and the mtar package are provided under the
following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which you can deploy directly in the
Extension Manager.
The VS Code Wizard for SAP Business One Web Client Extensions is based on yeoman-ui, which is a graphical
user interface for running Yeoman generators, and runs as a Visual Studio Code extension , aiming to provide
a template wizard for customers and partners to create or package the extensions for SAP Business One Web
Client.
Installing VS Code Wizard for SAP Business One Web Client Extensions [page 116]
Running VS Code Wizard for SAP Business One Web Client Extensions [page 118]
Checking the Log [page 123]
Prerequisites
As the wizard is running on top of NodeJS and Visual Studio Code, you need to install them beforehand, along
with the following dependencies:
• GNU Make
• Cloud MTA Build Tool
For more information on how to install the above software, please see Development Environment Setup [page
7].
• Yeoman Generator
npm install -g yo
• Application Wizard
This is a VS Code extension from SAP.
Open VS Code, search it in the extension marketplace and install it.
Installing VS Code Wizard for SAP Business One Web Client Extensions
Once the dependencies are installed, please perform the following steps to install this tool or generator:
Note
This tool is not yet published to the official NPM repo. If you want to install this tool using the standard NPM
approach, please wait until further notice.
Procedure
2. In the menu bar, choose View Command Palette... , and enter Open Template Wizard.
3. Select the generator for SAP Business One Web Client Extensions and choose Start.
4. On the Application Information page, provide the basic information of your application and choose Next.
Field Description
Application Version (Mandatory) Use semantic versioning in the format <major ver-
sion>.<minor version>.<patch version>.
Application Provider (Mandatory) The name of the organization that provides your applica-
tion.
5. On the Module Type page, select your module type and choose Next. By default, the URL Mashup App is
selected.
URL Mashup App An entry point to embed and integrate external web serv-
ices or applications.
Fiori App A new user experience (UX) for SAP software and applica-
tions.
Blazor App A free and open-source web framework that enables de-
velopers to create web apps using C# and HTML.
6. In the Module Attributes page, set up the attributes of your module and choose Next.
Field Description
Module Build (Mandatory for non URL Mashup Apps) For URL Mashup apps, this field is not needed and there-
fore not displayed.
7. In the Tile Settings page, set up a tile for your module and choose Next.
Field Description
Title Text (Mandatory) The text to describe the title of the tile.
Dimension (Mandatory) The supported dimensions are 1x1 and 1x2. By default, the
dimension is 1x1.
Tile Link Method (Mandatory) The supported methods are Existing Window and New
Window. By default, it is Existing Window. For Fiori apps,
New Window is not supported.
Tile Link (Mandatory) This field is specific for URL Mashup apps and invisible for
other apps. It should be a valid URL. For security reasons,
the tile link should start with https.
Index HTML Page (Mandatory) This field is invisible for URL Mashup apps and specific for
other apps. The value of this filed is index.html for most
cases.
Dynamic Content This field enables you to display a numeric KPI value on
the tile. The default value of Support dynamic content? is
No. If you choose Yes, you should configure the endpoints
of the KPI service. If tile dimension is selected as "1x1",
it allows only one endpoint. If "1x2" is selected, two end-
points are allowed.
Note
The KPI service must return a single numeric
value. You could refer to the return value of OData
specification of $count. For example, /b1s/v2/
PurchaseOrders/$count.
Tile Icon (Mandatory) This field is only visible when the decoration selected is an
Icon, and the default value is sap-icon://customize.
You can explore all available icons in the Icon Explorer .
Local Image for Tile (Mandatory) This field is only visible when the decoration selected is a
Local Image. The image type must be PNG, JPG, JPEG
or BMP.
Online Image for Tile (Mandatory) This field is only visible when the decoration selected is an
Online Image. The image type must be PNG, JPG, JPEG
or BMP, and the image URL must start with https.
8. On the Application Summary page, check the application basics, module information, tile details and then
choose Finish.
If you choose the option to package your application, the wizard will automatedly package the application
once it is created successfully.
For the development or trouble shooting purpose, you might need to check the log to figure out how the tool is
running.
To achieve this, in VS code, select View Output Application Wizard.Generators , and you can find the
detailed log messages.
You can also search for the file Application Wizard.Generators.log in folder %userprofile%
\AppData\Roaming\Code\logs\.
Introduction
This topic introduces a Web App to demonstrate how to leverage OpenID Connect (OIDC) and use the single
sign-on (SSO) scenario from the Web client to partner's extensions.
Functionalities
This Web App is based on the Node.js web app and is designed with the following functionalities:
Related Information
Compared to the Node.js web app, this app has some minor changes in the following files:
• login.html
Add a hidden field companyID when submitting the login request.
<form action="/login">
<input type="text" name="companyID" style="display: none;" />
<input type="submit" value="Sign in" class="btn btn-gray1" />
Set the field value by parsing the window.location.search on the loading page.
window.onload = function () {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams) {
const companyID = urlParams.get("companyID");
if (companyID) {
let companyIDEle = document.getElementsByName("companyID")[0];
companyIDEle.value = companyID;
}
}
};
• server.js
Before starting the authentication flow, set the company ID in the state URL.
• choose_company.js
Get the company ID hint from the return_to parameter.
(async () => {
try{
if (companyIDHint) {
if (await chooseCompany({ companyID: companyIDHint })) {
return;
}
}
...
}catch(e){
alert('Choose company error.')
console.log(e);
}
})();
• home.html
Add a Web client section with two buttons and only show it in the Web client context.
• home.js
Accordingly, add the press handler button, by which the Web client View API will be invoked.
To have a better understanding of this app, you can download and unzip this file to get the source code.
Related Information
Context
With the URL of the Web App, you can now open the VS Code Wizard for SAP Business One Web Client
Extensions to create one URL Mashup app for SAP Business One, Web client in the following steps.
Procedure
1. From menu View, click Command Palette... and select Open Template Wizard.
2. Select SAP Business One Web Client Extensions and click Start.
3. For Application Type, select the Tile Extension App and choose Next.
4. For Application Information, enter some basic information about your application (like below), and choose
Next.
Attributes Values
Attributes Values
There are two tiles, one for the existing window and the other for the new window.
Attributes Values
What is the link for the tile* (See the note below)
Note
For the tile link, passing system built-in query placeholders enclosed with curly brakets is permitted. In
the runtime, when the URL Mashup app is opened in the Web client, placeholders will be replaced by
real parameter values.
In this way, the Web client is able to pass its context information (for example, the current company
ID) to the URL Mashup app, so that the extension app can read the context information for further
processing. For example, with the company ID, the extension app will know which company is chosen in
the Web client and therefore skip the step where a company is chosen, once the SSO is finished.
In this case, assuming that the Web App is running on the endpoint https://localhost:8000, we
can specify the tile link as follows:
https://localhost:8000?companyID={b1-companyID}&language={b1-
language}&theme={b1-theme}
Results
You can properly update this app's configurations in the .env file and start the app with the following
command:
npm install
npm start
Related Information
Running VS Code Wizard for SAP Business One Web Client Extensions [page 118]
Context
The URL Mashup app is a Web client extension and can only run in the Web client context. Make sure the
company you want to log in to is assigned with the URL Mashup app in the SAP Business One Extension
Manager.
Procedure
1. Log in to the company in the Web client and then navigate to the Extensions tab, where you will find a tile
for your app.
2. Click the tile, in this case, A partner's app tile, and the app will be opened in the current window.
If the Web client session has timed out, you need to manually log in again.
Related Information
Google Chrome is phasing out support for third-party cookies . This section discusses the impact of this
change on specific scenarios and presents possible solutions.
Impact on Scenarios
A typical scenario that would be impacted by this change involves a Web Client URL mashup application
embedding a partner Web application as an iframe. If this mashup application relies on cookies for
functionality, end-users will no longer be able to access it.
Prerequisites
To mitigate this impact, it is recommended that both the Web Client and the SLD are installed under the same
root domain, which can be achieved in the following ways:
Note
Quick Workaround:
You can mark the URL mashup application open in a new tab instead of an iframe.
• Partitioned Cookies
• Storage Access API
• OAuth PKCE Flow
You can work with the technical solution for different cases of authentication:
You can download and unzip this file to get the source code.
Partitioned Cookies
In the file server.js of the sample code, please refer to the sample code change:
app.use(
session({
name: "EXTN.SESSION",
secret: process.env.SECRET,
cookie: { maxAge: timeout, sameSite: "none", secure: true, partitioned:
true }
})
);
Please refer to the sample code change. It tries to call document.requestStorageAccess() when the user
chooses the login button. If the user chooses Allow in the pop up window, the extension can read third-party
cookies.
1. static/js/readCookieScript.js
2. static/login.html
Add a script readCookieScript.js.
<head>
<meta charset="UTF-8" />
<title>Sign in</title>
<link type="text/css" href="css/index.css" rel="stylesheet" />
<script type="text/javascript" src="js/readCookieScript.js"></script>
</head>
3. static/js/login.js
Before starting the authentication flow, request access in the button click handler.
document.getElementById("loginButton").addEventListener("click", async
function () {
const companyID = document.getElementsByName("companyID")[0].value;
await requestAccess();
window.location.href = "/login?companyID=" + companyID;
});
This solution works across different web browsers. The popup windows will appear as follows:
• Google Chrome
• Microsoft Edge
• Mozilla Firefox
As of SAP Business One, Web client 10.0 FP 2405, Web Client UI API is available for you. It allows you to create
UI extensions on top of Web Client, so that you can customize UI pages to suit your individual business needs.
With the UI API framework, the dedicated Visual Studio Code plugin, and the Web Client Inspector extension,
you now have the tools to tailor the software to your exact needs and build extensions that streamline your
workflow.
Prerequisites
Note
In the production mode of SAP Business One, Web client, please turn off the Developer Mode.
Related Information
The Visual Studio Code Plugin for Web Client provides you with an all-in-one environment. You can write,
debug, preview and test your extensions directly within VS Code. Also, you can build and deploy your
extensions directly to Web Client in a few easy steps.
In this section, you will learn how to work with VS Code Plugin, and how to create, run, build, and deploy a UI
API app.
Context
Procedure
For the Select the Object Type field, if you choose UDO/UDT, you need to input the view GUID manually in
the next input box.
Note
To find an existing view's GUID, refer to Web Client Inspector [page 209].
├── .vscode
│ └── launch.json
│ └── settings.json
├── node_modules
├── SalesModule
│ └── webapp
│ ├── controller
│ │ └── SalesOrderDetail.js
│ │ └── utility.js
│ ├── i18n
│ │ └── i18n_en.properties
│ │ └── i18n.properties
│ ├── layout
│ │ └── SalesOrderDetail.layout.json
│ ├── model
│ │ └── models.js
│ └── manifest.json
├── .gitignore
├── app.json
├── gulpfile.js
├── index.js
├── mta.yaml
├── package-lock.json
├── package.json
└── README.md
File Description
launch.json A setup file for the debug server, including the Web client view URL.
SalesOrderDetail.js A controller file for the view layout to define the interactive logic.
i18n.properties The properties file for texts contains name-value pairs for each element, in-
cluding a separate file for each supported language with a suffix for the locale,
for example, i18n_de.properties for German, i18n_en.properties for English,
and so on.
models.js The utility file for the customized data model for the view.
manifest.json A descriptor file to define the resource bundles for the UIAPI app.
gulpfile.js A simple configuration file for Gulp to pack the frontend assets.
app.json An app description file to define the app modules and paths for the debug
server.
package.json The file holds various metadata relevant to a NodeJS project. For more infor-
mation, see here .
package-lock.json An automatically generated file for any NPM operations. For more information,
see here .
10. Open and edit the *.layout.json file under the module folder.
When you edit the layout file, the intelligence for auto-complete is displayed.
If more new GUID is needed, right-click the value of "guid" in the *.layout.json file and click the menu
item Generate UUID (Web Client).
To find an existing control's GUID, refer to Web Client Inspector [page 209].
11. Open and edit the manifest.json file under the module folder for the allowed list. "*" means that all APIs
are allowed.
{
"allowedExternalURLs": "*",
"allowedServiceLayerAPIs": "*"
}
Accordingly, Extension Manager is enhanced to support Service Layer API and the external URLs allowed
list for UI Extension.
• Display the list during the deployment or upload stage in the front end.
• Allow the administrator to confirm or reject the list in the front end.
• Check the data integrity of the allow-list before persisting into the database in the back end.
• Provide OData API to query the UI API extension metadata.
Context
Procedure
2. In the Settings dialog box, navigate to the Extensibility panel and enable the Developer Mode.
3. (Optional) If you want to manually change the Web client view url, go to the $
{workspace}/.vscode/launch.json file and change the attributes startUrl.
{
"SalesModule": {
"SalesOrderDetail": {
"startUrl": "<your web client sales order detail view link>"
}
}
}
4. (Optional) If you want to enable the debug server only, right-click the ${workspace}/app.json file
and choose the menu item Enable Debug Server (Web Client).
6. Open the *.controller.js file under the module folder and set a breakpoint inside
onButtonClick. Click the new button that you created and go to the VS Code debug session on
the side bar, where you can see that the breakpoint is triggered. Also, variables are retrieved on the VS
Code debug windows.
Once you open a preview session, in this chrome window, you're able to preview all modules/views
that you've created in the current project. You can set breakpoints in the JS files of all these modules.
Any changes in your JS source files would be monitored in this session. There's no need to reopen a
preview session, but remember to refresh the page for an instant preview. Once you refresh the page,
the breakpoints on the JS file will be inactive. You need to activate them by clicking the button Toggle
Activate Breakpoints on the debug window BREAKPOINTS.
3. Add modules.
Right-click the mta.yaml file and choose the menu item Add Module (Web Client). A new template wizard
opens up. Follow the steps to create a new module.
Right-click the manifest.json file under the module folder and choose the menu item Add View (Web
Client). A new template wizard opens up. Follow the steps to create a new view.
Context
Follow the below procedures to build and deploy the UI API app.
Procedure
1. Right-click the mta.yaml file and choose the menu item Build MTA (Web Client).
Upon success, a folder named mta_archives will be created. Find the mtar archive under the project
folder.
A folder named dist will also be created under the module folder. During the packaging process, gulp
is used as a task runner to build these modules. Any breakpoint set on files under the dist folder
cannot be triggered since these are deployment-ready files, which aren't for debug purposes.
2. To deploy the package, follow the Deploying Web Client Extensions on Extension Manager [page 249] topic.
Outgoing Payments in Approval Process List SAP Business One 10.0 FP 2405
Scope
Web Client UI framework is based on SAP UI5. However, the UI5 controls will not be exposed directly. Instead,
the controls exposed in Web Client are inherited from UI5 and are specifically customized for Web Client.
The exposed controls are a subset of controls used in Web Client. According to the product roadmap, the
controls will be gradually exposed in each incoming release cycle. This means that only the exposed controls
and exposed properties/events/methods will be supported. Any misusage on unexposed controls is strongly
discouraged.
Not all parts of Web Client user interfaces are allowed to be customized. We support a limited set of list view
and detailed view customization, and will support more in future releases. Please see Supported Views [page
155].
The version of JavaScript supported by the Web Client UI API conforms to ECMAScript 2017 standards, also
known as ES8. Code that utilizes functionality introduced in ECMAScript versions later than ECMAScript 2017
is not supported and may encounter errors during packaging or runtime.
Outgoing Payments in Approval Process List SAP Business One 10.0 FP 2405
4.2.2 Overlay
Web Client UI API framework makes use of an overlay mechanism to implement the UI customization on
system built-in views, or UDO/UDT views. Generally, the controls' layout in a view is from left to right and from
top to bottom. Each control has a unique GUID. Duplicate GUID in a view will result in a runtime error. To figure
out the position of UI elements, the following positional properties are used in an overlay file.
• before
To insert some new controls before an existing control by specifying its GUID.
• after
To insert some new controls after an existing control by specifying its GUID.
• on
To override or update an existing control by specifying its GUID and some properties or events.
With the GUID and the positional property, the Web Client UI API framework is able to figure out where you
want to locate the new controls or update the existing controls.
The overlay is defined in JSON format and the naming convention for an overlay file is *.layout.json. A
typical overlay content is as below:
{
"controller": "<app-provider.app-name.moduel-name.controller.controller-name>",
"overlay": {
"before": [
{
"guid": "<an-existing-control's-guid>",
"items": [
{
"guid": "<a-new-control's-guid>",
"ctrlType": "<control-type, e.g. b1.sdk.Button>",
"<propery-name>": "<property-value>",
"<event-name>": "<event-handler>"
}
]
}
],
"after": [
{
"guid": "<an-existing-control's-guid>",
"items": [
{
"guid": "<a-new-control's-guid>",
"ctrlType": "<control-type, e.g. b1.sdk.Button>",
"<propery-name>": "<property-value>",
"<event-name>": "<event-handler>"
Note
• The controller property is a reference to the JavaScript file, in which you can define some
interactive logic. Some code snippets on how to use the overlay mechanism can be found in the
following chapters.
• Any invalid property or improper positioned property in the JSON schema will probably result in a
runtime error on loading. To mitigate these errors, it is recommended to use the development tool
Visual Studio Code Plugin for Web Client [page 137], which provides a static checking according to a
predefined JSON schema for overlay files.
• In some cases, customers may want to move their UDFs from the system UDF section to their
customized section. To achieve this, the property move can be used in the overlay.
{
"controller": "<app-provider.app-name.moduel-name.controller.controller-
name>",
"overlay": {
"move": [
{
"guid": "<an-existing-UDF's-guid>",
"targetGroupGuid": "<a-group-in-a-customized-section>"
}
]
}
}
4.2.3 Namespace
Namespaces offer a way to sequester different sections of code in order to avoid conflicts and overlapping
functions. There are two distinct approaches we provide for you to use.
Controls Namespace
The global namespace b1.sdk is used to host public controls and related types for control properties. This
helps in managing all controls and properties systematically with minimal chances of conflict.
For instance, if you want to reference Button, use b1.sdk.Button. If you want to assign a value to the
buttonType property in JavaScript, use b1.sdk.ButtonType.Accept.
We also provide a namespace for separating extensions from different partners. This namespace is defined as a
combination of three attributes: provider name, app name, and module name.
This namespace is generated automatically when you run the UI API creation wizard. It is subsequently stored
in the manifest.json file.
By utilizing the namespace mechanism, we can isolate extensions from different partners and the Web Client,
helping to prevent code conflicts and smooth the operation of your application.
4.2.4 SDKEnv
It is the type of the current SDK environment and has the following functions.
open(url: string): Promise Opens an external URL or a relative View Link URL.
Note
Related Information
It is the type of the Web Client event and has the following functions. You can use it in the event handler.
For the function ActiveView, controls can be accessed by providing the GUID as follows:
For the function ActiveView, the methods below can be used for both the List View and the Detailed View:
getCustomizedData(modelName: string): Promise Returns the data of model with name modelName, which is
defined in the extension.
setCustomizedData(data: object, modelName: string): Sets the data to the model with name modelName, which is
Promise defined in the extension.
getCustomizedData(modelName: string): Promise Returns the data of model with name modelName, which is
defined in the extension.
setCustomizedData(data: object, modelName: string): Sets the data to the model with name modelName, which is
Promise defined in the extension.
4.2.4.2 showMessageBox
• For the function showMessageBox, its parameter type is an object, which is described in the TypeScript
syntax below.
// Typescript syntax
4.2.4.3 showToastMessage
4.2.4.4 open
For the function open, the external URL should be predefined in allowedExternalURLs.
await oEnv.open("https://www.google.com");
await oEnv.open("/webx/index.html#webclient-ORDR&/Objects/ORDR/List");
For the function getService, supported service APIs including Service Layer APIs, View Link APIs, and
external service APIs will be returned. Service Layer APIs and external service APIs support the methods get,
post, put, patch and delete, View Link APIs support the method get. Internally, Service Layer oData V4 is
used.
The parameter data can be either an object or a string. The parameter options should have the following
members:
mode string The mode of the request for handling cross-origin requests, for example,
"cors" (default), "no-cors", "same-origin"
getHeaders(): object Returns headers of the response (not used by external serv-
ices)
For more information about View Link APIs, please refer to Working with APIs That Generate Web Client Views
URLs [page 257].
4.2.5 Controls
A control is a core element that provides users with the means to interact with the Web Client application.
Controls are UI elements, such as buttons, input fields, or grid/table that can handle user interaction, maintain
their state, and manage any relevant data. All controls follow SAP's Fiori design guidelines, making it easy to
create a consistent user interface and user experience across all SAP applications. Each control comes with
properties, aggregation, events, and methods.
• Properties
These are the values that influence the behavior or the appearance of a control, for example, the text on a
button, the state of a checkbox (checked or unchecked), and so on.
• Aggregations
These define the relationship controls have to eachother. It means controls can have child controls. For
example, a grid control can have multiple column controls.
• Events
User interactions with controls can trigger events. For example, a button press, an input field change, and
so on.
• Methods
These are functions that are part of the control and can be used to perform actions or manipulate the
control’s data or its visual representation. They are used either to set or get properties, or to trigger events.
In the Web Client UI API framework, there is a direct relationship between properties and methods. Typically,
for each property, there are corresponding "getter" and "setter" methods, which is a common convention in
many programming languages and frameworks.
For instance, if there's a property named "value" in a control, the control will often provide the following
methods:
• getValue: This is a getter method that retrieves the current value of the property.
All "getter" and "setter" methods adhere to camel case for naming conventions. In camel case, the first word
starts with lowercase, and subsequent words within the name have their first letter capitalized. These methods
allow for interaction with the property. The getter method is used to read the property's value, while the setter
method is used to change the property's value. However, it's not always the case that every single property will
have a functional getter and a setter. Very few properties may be read-only, while most other properties are
readable and writable. For this case, calling the setter methods on read-only properties would have no effect.
Note
For the getter and setter methods, in the following chapters, we will not explicitly list them for each control.
Instead, only specific methods available for each control will be documented.
4.2.5.1 Button
A button is a control that enables users to trigger actions. For the Button UI, you can define a text, an
icon, or both. You can also specify whether the text or the icon is displayed first. You can choose from a set
of predefined ButtonTypes that offer different styling to correspond to the triggered action. You can set the
Button as enabled or disabled. An enabled Button can be pressed by clicking or tapping it, and it changes its
style to provide visual feedback to the user that it is pressed or is being hovered over with the mouse cursor. A
disabled Button appears inactive and cannot be pressed.
Properties
Events
Name Description
Methods
Usage
{
"guid": "CUSTOM_CONTROL_GUID_NEW_BUTTON1",
"ctrlType": "b1.sdk.Button",
"text": "testing...",
"icon": "sap-icon://accept",
"enabled": true,
"visible": true,
"buttonType": "Default",
"tooltip": "I am in testing..."
},
{
"guid": "CUSTOM_CONTROL_GUID_NEW_BUTTON2",
"ctrlType": "b1.sdk.Button",
"text": "Click Me!!!",
4.2.5.2 Input
An input allows the user to enter and edit text or numeric values in one line.
Properties
Events
Name Description
change
Name Type Description
suggest
Parameter Type Description
Methods
{
"guid": "pzEqzxS31NR6EfCAEiy4xF",
"ctrlType": "b1.sdk.Input",
"enabled": true,
"editable": true,
"tooltip": "it is a hint",
"visible": true,
"label": "I am in testing...",
"value": "Initial value",
"inputType": "String",
"wrapping": true,
"valueState": "Success",
"textDirection": "LTR",
"valueStateText": "Success State",
"change": {
"procName": "onInputChange"
}
}
4.2.5.3 StaticText
Properties
Note
• For maxLines, the multi-line overflow indicator depends on the browser line clamping support. For
such browsers, this will be shown as an ellipsis. For other browsers, the overflow will be hidden.
• For renderWhitespace, it specifies how whitespace and tabs inside the control are handled. If true,
whitespace will be preserved by the browser. Depending on the wrapping property, text will either only
wrap on line breaks or wrap when necessary, and on line breaks.
• For wrappingType, it takes effect only when the wrapping property is set to true.
No events.
Methods
Usage
{
"guid": "sBp9dFHsiWUMmQE3wAeF5Z",
"ctrlType": "b1.sdk.StaticText",
"text": "testing...",
"wrapping": false,
"visible": true,
"tooltip": "I am in testing..."
}
4.2.5.4 CheckBox
It is a control that allows the user to set a boolean value, such as true/false or yes/no for an item.
Events
Name Description
Methods
Usage
{
"guid": "tbmGK6QJaacC7EkYUWUt8K",
4.2.5.5 ComboBox
This control is a drop-down list for selecting and filtering values. The control represents a drop-down menu with
a list of the available options and a text input field to narrow down the options.
Properties
Events
Name Description
loadItems Fired when the user opens the dropdown list to load data
Methods
getSelectedText
getSelectedText() : string
getItems
getItems() : b1.sdk.Item[]
Usage
{
"guid": "1PFitf7cF8uH6Sq5iPfXLk",
"ctrlType": "b1.sdk.ComboBox",
"label": "Static ComboBox",
"enabled": true,
"visible": true,
"tooltip": "ComboBox tooltip",
"selectedKey": "Y",
"items": [
{
"key": "Y",
"text": "Yes",
"additionalText": "Yes !!!",
"enabled": true
},
{
"key": "N",
"text": "No",
"additionalText": "No !!!",
"enabled": true
}
],
"change": {
"procName": "onChange"
}
4.2.5.6 Section
A section is a top-level information container which is generally used in an object page layoutto aggregate
subsections containing second-level information.
Properties
Events
No events.
Methods
Usage
{
"guid": "2uYDkRidQceMnh26HSuU61",
"ctrlType": "b1.sdk.Section",
"text": "Section 4",
"subSections": [
{
"guid": "15Tvy2ADMLsq7TJdJjEQDq",
"ctrlType": "b1.sdk.SubSection",
"text": "SubSection 4.1",
"groups": [
{
"guid": "5mWFpvxL7BKRc2Vmm7PMwv",
"ctrlType": "b1.sdk.Group",
"text": "Group 4.1.1",
"items": [
{
"guid": "vB2cRy8RMqNRJTrnZZHQih",
"label": "Test Label",
"ctrlType": "b1.sdk.StaticText",
"text": "This is a test description."
}
]
}
]
},
{
4.2.5.7 Grid
This control provides a comprehensive set of features for displaying and dealing with vast amounts of data.
Events
Name Description
rowSelectionChange Fired when the row selection of the grid has been changed
paste Fired when the user pastes contents from the clipboard to
the table
Methods
getSize
getEditable
getSelectionMode
clearSelection
getSelectedIndices
Zero-based indices of selected items, wrapped in an array. An empty array means "no selection".
getAllSelectedIndices
The actual selected items indices in data, not the indices on the UI (maybe the data is sorted / filtered).
setSelectedIndex
Zero-based index of selected item. Index value for no selection is -1. When multi-selection is enabled, and
multiple items are selected, the method returns the lead selected item. Sets the zero-based index of the
currently selected item. This method removes any previous selections. When the given index is invalid, the call
is ignored.
When called with a value of null or undefined, the default value of the property will be restored.
addSelectionInterval
removeSelectionInterval
Removes the given selection interval from the selection. In case of single selection, only iIndexTo is removed
from the selection.
getRowData
getFilteredIndices
ready
setFilter
resetSort
removeRows
Column
getColumns
Usage
{
"guid": "2g9uibjwCxiqPpFrz8NiwY",
"ctrlType": "b1.sdk.Grid",
"title": "Grid Testing",
"visibleRowCount": 20,
"selectionMode": "multiple",
"columnHeaderHeight": 20,
"columnHeaderVisible": true,
"enableSelectAll": true,
"firstVisibleRow": 0,
"rowHeight": 20,
"selectionBehavior": "Row",
Data binding is the process used to bind UI elements to data sources, so as to keep the data in sync and allow
data editing on the UI. The UI uses data binding to bind controls to the model that holds the application data in
JSON format, so that the controls are updated automatically whenever application data changes. Data binding
is also used the other way round, when changes in the control cause an update in the underlying application
data, for example, data entered by the user, which means a two-way binding mechanism.
Related Information
With property binding, you can initialize the properties of a control automatically and update them based on
the data of the model. Once you have defined the property binding, the property is updated automatically every
time the property value of the bound model is changed, and vice versa.
• Define the controls and bind property to the data model with the following binding syntax. Please note that
"@@" is reserved as prefix for partner's data model.
"items": [
{
"guid": "pfKjesz1qTQaNiHm3NL7xM",
Aggregation binding, also known as list binding, is used to automatically create child controls according to
model data. It will automatically create as many child controls as needed to display the data in the model using
the template control approaches.
• Define a control ComboBox and bind property items to the data model with the following binding syntax.
"items": [
{
"guid": "3CGkbnLNeq3168HhtrTa9t",
"ctrlType": "b1.sdk.ComboBox",
"label": "Dynamic ComboBox",
"tooltip": "ComboBox tooltip",
"items": {
"path": "@@data3>/comboBoxData",
"template": {
"ctrlType": "b1.sdk.Item",
"key": "{@@data3>key}",
"text": "{@@data3>text}"
}
}
}]
Expression binding, an enhancement of the SAP UI5 binding syntax, allows you to display a value on the
screen that has been calculated from values found in some model objects. In this way, simple formatting or
calculations can be inserted directly into the data binding string. For the binding syntax, it is exactly the same
as UI5. For more information, please see Expression Binding .
• Define a control StaticText and bind property value to the data model with the expression binding
syntax.
"items": [
{
"guid": "ukXMU1SCgGaSrJuMLbk6MF",
"ctrlType": "b1.sdk.StaticText",
"value": "{= ${@@data2>/unitPrice} * ${@@data2>/quantity}}",
"label": "Total",
"tooltip": "Calculated by expression: unitPrice * quantity"
}
]
"Resource Model Binding" or "i18n binding" is a technique used for the internationalization of apps, making
your application more accessible to users worldwide with minimal extra coding effort. The advantage of this
technique is that it decouples content from code, and simplifies the introduction of updates or the addition of
new languages to your app.
Resource model binding works by linking app content variables (also known as keys) to values in the
properties files, named "i18n.properties". Each language variant has its own i18n.properties file. For example,
i18n_en.properties for English, i18n_fr.properties for French, and so on.
Each i18n.properties file contains key-value pairs. The keys are identifiers used in your application code, where
the values are the associated text strings translated to the specific language.
For Web Client UI API apps, the properties files and the model name are specified in the manifest.json as
below:
For example, in the default or English properties file, we might have: buttonText=Get Company
Information.
Once you have set up the i18n.properties files, you can use the notation {i18n>key} in the overlay file to bind
such properties to control attributes in your applicationas follows:
{
"guid": "gJshBkE4qMBcAac7gbYgUn",
"ctrlType": "b1.sdk.Button",
"text": "{@i18n>buttonText}"
}
Web Client UI API framework will handle the rest, selecting the correct i18n.properties file based on the
language setting of your user's device and displaying the correct value on the button.
4.2.6.5 Formatter
Formatter is a utility that facilitates data manipulation during the data binding process between the Model and
the View in Web Client. It is used to transform source data from the Model into a format that can be easily
consumed by UI controls in the view.
The formatter functions are instrumental in customizing raw data according to specific requirements without
altering the original data in the Model. For example, when a UI control requires data in a specific format or data
type, such as an Integer, the Formatter can be used to transform the raw data into the required format during
the binding process. Thus, it provides a clean and efficient method for data manipulation and ensures the
Model's purity, which is essential in the MVC (Model View Controller) paradigm. Overall, Formatter is a robust
and flexible tool that enhances data handling capabilities, thereby enabling the creation of more dynamic and
responsive applications.
For example, if you want to rate a raw price by a formatter, you can define such a formatter in file formatter/
InputFormatter.
define([], function () {
"use strict";
return {
valueFormat: function (price) {
if (price <= 10) {
return "Low";
} else if (price <= 20) {
return "Reasonable";
} else {
return "High";
}
}
};
});
{
"guid": "rhsirpA4TUGem87I98Xibg",
"ctrlType": "b1.sdk.Input",
"label": "PriceRating",
"value": "{path: '@@data2>/unitPrice',
formatter:'.inputFormatter.valueFormat'}"
}
Each event flow is generated by a UI operation or calling UI API, and then dispatched to the relevant event
handler with parameters. The event handler can then parse the event parameters and handle the event
appropriately.
Event Trigger
Event Parameters
When an event occurs, some parameters can be passed along with it to dispatch more information on the event
itself.
• Built-in parameters
These parameters are for internal usage. For example, sCtrlGuid and sViewGuid.
• Event-specific parameters
These parameters are for individual events. For example, for the change event on an input control, it has
value and oldValue.
In the event handler, you would find the event has two more parameters: comment and firedByUIAPI.
Event Handler
For all events, regardless of whether the event is fired by pressing a button or triggered by leaving an input
focus, they have a unified event handler as below.
• For oInst, it is an instance of the type SDKEnv, from which you can find some information of the running
context.
• For oEvent, it is an instance of Event, from which you can get the event details by calling its functions (for
example, getParameters).
Besides the event handler, each event has a corresponding pre-event handler and a post-event handler, which
can be defined as follows:
{
"guid": "tSnECbffy5gmfjiFHSBfkg",
"ctrlType": "b1.sdk.Button",
"text": "Test",
"press": {
"before": "beforeButtonPress",
"procName": "onButtonPress",
"after": "afterButtonPress"
}
}
For the pre-event handler beforeButtonPress, you can do some customizations before the event is
dispatched to the onButtonPress. For example, you have the chance to change the event parameters or
even prevent the event from dispatching. For the post-event handler afterButtonPress, you can add your
business logic after the event occurs.
onInit (oInst, oEvent) Called when a view is instantiated and its controls (if availa-
ble) have already been created; it is used to modify the view
before it is displayed to bind the event handlers and carry
out other one-time initializations.
onDataLoad (oInst, oEvent) Called when data is loaded for the view, it is used to modify
the data. Note that it is asynchronously triggered after onI-
nit.
onExit (oInst, oEvent) Called when the view is destroyed, it is used to free resour-
ces and finalize activities.
4.2.8 Types
4.2.8.1 int
JavaScript primitive values of type number and that don’t have a fractional part. To keep the implementation
efficient, the constraint is not enforced. Declaring a property as type int is rather for information purposes.
The corresponding object expects any given value to be an integer value. The default value of the type is the
number 0. Please refer to UI5 Property Types for details.
4.2.8.2 Enumerations
4.2.8.2.1 b1.sdk.ButtonType
Name Description
4.2.8.2.2 b1.sdk.ValueState
Name Description
4.2.8.2.3 b1.sdk.InputType
Name Description
Unit Float format, with a rounding accuracy setting for the unit
4.2.8.2.4 b1.sdk.TextDirection
Name Description
4.2.8.2.5 b1.sdk.TextAlign
4.2.8.2.6 b1.sdk.WrappingType
Available wrapping types for text controls that can be wrapped which enable you to display the text as
hyphenated.
Name Description
Normal Normal text wrapping will be used. Words won't break based
on hyphenation.
4.2.8.2.7 b1.sdk.MessageBoxAction
Name Description
Name Description
4.2.8.2.9 b1.sdk.Grid.SelectionMode
Name Description
4.2.8.2.10 b1.sdk.Grid.SelectionBehavior
Name Description
RowOnly Rows can only be selected on the row (and the selector is
hidden)
4.2.8.2.11 b1.sdk.Grid.ModelFilterOperator
Name Description
BT FilterOperator between
EQ FilterOperator equals
4.2.8.2.12 b1.sdk.HorizontalAlign
Name Description
4.2.8.3 Aggregations
Related Information
4.2.8.3.1 b1.sdk.Item
Properties
4.2.8.3.2 b1.sdk.SubSection
Subsection is a second-level information container, which is generally used in an object page layout.
Properties
No events.
Methods
No methods.
Usage
{
"guid": "2uYDkRidQceMnh26HSuU61",
"ctrlType": "Section",
"text": "Section 1",
"subSection": [
{
"guid": "15Tvy2ADMLsq7TJdJjEQDq",
"ctrlType": "SubSection",
"text": "SubSection 21",
"group": [
{
"guid": "5mWFpvxL7BKRc2Vmm7PMwv",
"ctrlType": "Group",
"text": "Group 2",
"items": [
{
"guid": "vB2cRy8RMqNRJTrnZZHQih",
"label": "Test Label 2",
"ctrlType": "Input"
}
]
}
]
},
{
"guid": "sBp9dFHsiWUMmQE3wAeF5Z",
"ctrlType": "SubSection",
"text": "SubSection 22",
"group": [
{
"guid": "emC5fRi184o9eg62oHJ8QC",
"ctrlType": "Group",
"text": "Group 21",
"items": [
{
"guid": "eUdC8srWcJeGkd3VjajTcD",
"label": "Test Label 21",
"ctrlType": "Input"
}
]
},
{
"guid": "23QcpyC9EorFa3oRWaiKBN",
"ctrlType": "Group",
"text": "Group 212",
4.2.8.3.3 b1.sdk.Group
This control arranges labels and fields (like input fields) into groups and rows. There are different ways to
visualize forms for different screen sizes.
Properties
Events
No events.
Methods
No methods.
Usage
{
"guid": "xbSQCJQoYJaUwUZiAptEaL",
"ctrlType": "Section",
"text": "Section 0",
"subSection": [
{
"guid": "dQpP9ZBpmgLmSCCAaPvgLK",
"ctrlType": "SubSection",
"group": [
{
"guid": "2zJCz7wECRUTAZNa6QBKLE",
"ctrlType": "Group",
"text": "Group 0",
"width": 12,
"items": [
{
"guid": "wDtK6EcdnJED8i86bC6xJk",
"label": "Test Label 01",
4.2.8.3.4 b1.sdk.Row
Methods
getIndex
Usage
{
"overlay": {
"after": [
{
"guid": "isgTCvtiWLcMRPAaD5HW29",
"items": [
]
}
]
}
}
Note
The property items is a list of the exposed controls with a generic type Control. For example,
b1.sdk.StaticText is a concrete type of Control.
Properties
Events
No events.
Methods
No methods.
{
"guid": "2g9uibjwCxiqPpFrz8NiwY",
"ctrlType": "b1.sdk.Grid",
"rowsData": "{@@demo>/rows}",
"title": "A customer defined grid.",
"columns": [
{
"ctrlType": "b1.sdk.Column",
"guid": "k12qZkmVovquw6fXLmRxqz",
"text": "Id",
"defaultVisible": true,
"template": {
"ctrlType": "b1.sdk.Input",
"guid": "dcmfTcU59HCwny9WxkWMZy",
"editable": true,
"value": "{@@demo>id}"
}
}
]
}
4.2.8.4 Parameters
SDKEnv
The first parameter is the type of the current SDK environment. For more information, please see SDKEnv
[page 159].
Event
It is the type of the Web Client event and has the following functions. You can use it in the event handler.
For the function preventDefault, please refer to the sample layout and code below. A function is created to
handle a button press before the event triggered by the Add & View button within a Sales Quotation detailed
view. To intercept system behaviors before their execution, the before attribute in the JSON layout is utilized.
Within the event function, the content of the Customer Reference No. field is validated; if it is empty, the default
system behavior is prevented by invoking the preventDefault function.
{
"controller": "SAPB1.SalesAssistApp.SalesAssist.controller.QutAssist",
"overlay": {
"on": [
{
"guid": "49H8VADnVmWRK4aFa5TkYy",
"press": {
"before": "onAddnViewButtonClick"
}
}
]
}
}
4.2.9 Security
You can build the Web Client UI API application using Web Client UI APIs in a well-designed sandbox,
which creates a restricted JavaScript context to execute partner's code in an isolated environment for each
extension. For instance, access to DOM object, window objects, cookies and session storage is restricted, and
external URLs not included in the allowlist cannot be reached. By integrating with Service Layer APIs, View Link
APIs and external URLs, you can enhance the list and detailed views of Web Client with exposed controls and
events.
It is highly recommended to configure the allowlist for Service Layer APIs and external URLs for each UI API
application module. This approach provides a finer granularity control over the capabilities of the extensions.
Note:
Note
To configure the allowlist for external URLs and Service Layer APIs, please open and edit the
manifest.json file under the module folder.
{
"allowedExternalURLs": "*",
"allowedServiceLayerAPIs": "*"
}
Example
{
"allowedServiceLayerAPIs": [
{
"api": "BusinessPartners",
"authorization": "full",
"description": "full authorization on business partners"
},
{
"api": "Items",
"authorization": "readOnly",
"description": "readOnly authorization on items"
},
{
"api": "CompanyService_GetCompanyInfo",
"authorization": "full",
"description": "full authorization to get company info from company
service"
}
],
"allowedExternalURLs": [
{
"endpoint": "https://services.odata.org",
"description": "public odata service"
},
{
"endpoint": "http://api.weatherapi.com",
"description": "free weather api"
}
]
}
If you are configuring the allowlist as an empty array, no APIs are allowed.
{
"allowedExternalURLs": [],
"allowedServiceLayerAPIs": []
}
To better understand how to use UI API to develop extensions, some samples are prepared for demonstration
purposes.
Quick Startup
Like a startup project, follow the VS Code plugin guide to create one simple UI API app, which shows a button
in the Sales Order detailed view to get the current company information from the Service Layer. For more
information, please see Visual Studio Code Plugin for Web Client [page 137].
For the code details, you can download the sample from here.
Further Development
Based on the startup app, further development can be performed with the following functionalities in the Sales
Order detailed view.
For the code details, you can download the sample from here.
UDF Sample
Based on the startup app, a user-defined field (UDF) sample is prepared with the following functionalities in the
Sales Quotation detailed view.
• How to create sections in the Sales Quotations detailed view to show UDF.
• How to do the data bindings with UDF and interact with Service Layer
• How to override the UDF control's properties
• How to move UDF from one section to another
For the code details, you can download the sample from here.
The UDF sample is based on the demo database (for example, SBODemoUS) and assumes the referenced
UDF already existed in the database. You can get the UDF details from the Service Layer. For example, to
get the UDF details for the Sales Order detailed view, you can use the following request:
Grid Sample
Based on the startup app, a Grid sample is prepared with the following functionalities in the Sales Order
detailed view.
For the code details, you can download the sample from here.
Based on the startup app, a Sales Assist App sample is prepared with the following functionalities in the
Business Partner detailed view and the Sales Quotation detailed view.
For the code details, you can download the sample from here.
Web Client Inspector is a standard Chrome or Edge extension that helps app developers to inspect, analyze and
debug extensions/plugs of SAP Business One, Web client.
The key feature of the inspector is to quickly locate the individual Web Client app UI controls and display the
control information in the browser development mode.
Procedure
1. The Web Client Inspector installer is provided in the SAP Business One installation/upgrade package. You
can get the installer from Upgrade CD\Packages.x64\SDK. Run setup.exe and choose Web Client
Inspector.
After installation, you can find all installation scripts under SAP Business One SDK installation
path\Tools\WebClientInspector.
2. In Chrome, open the URL: chrome://extensions/. Alternatively, you can access edge://
extensions/ when in Edge. The extensions page is also reachable via the browser's menu.
3. Check the Developer mode setting and then choose Load unpacked.
4. From the newly opened window, select the folder in which the zip file was unpacked.
5. Restart Chrome or Edge. When Chrome or Edge restarts, you need to confirm that the devtools extension
will not be disabled.
Context
Once installed, the Web Client Inspector is available in Chrome or Edge DevTools (by choosing F12). It becomes
active when the Web client app is loaded.
Procedure
1. Open the Web client application and log in via Chrome or Edge.
2. Open the Sales Order Detail View.
3. Open Developer Tools.
For the supported controls and views, please check the lists below.
Related Information
This section shows you how to carry out the following tasks:
• How to set up a connection between Service Layer and SAP Business Technology Platform (BTP) by
creating a destination
• How to create a Fiori freestyle project based on this destination using SAP Business Application studio
• How to deploy the Fiori app to BTP
• How to create a URL-mashup app based on the Fiori app
• How to run it in Web Client
The Service Layer used in this document is of version SAP Business One 10.0 FP 2111, and the OData used is of
version 4 to establish the connection.
Note
Make sure that the Service Layer is running in the public internet, so that it is accessible from BTP.
You can also refer to the video How to develop a Fiori application on BTP and deploy it on Web Client for SAP
Business One , which is valid for Fiori app versions prior to 1.12.1 and contains the main idea in this online
help section.
Procedure
1. Logon to the BTP Cockpit with your BTP account. In this document, the BTP trial account is used.
The Authentication is Basic Authentication, and you also need to specify some additional properties in the
following table:
HTML5.DynamicDestination true
WebIDEEnabled true
WebIDESystem Gateway
WebIDEUsage odata_gen
Choose Check Connection to verify if the connection is OK. Upon success, the following dialog pops up:
Procedure
Procedure
3. In the Floorplan Selection step, select SAPUI5 freestyle as the Application Type, choose SAPUI5 Application
and then choose Next.
For the System field, select B1ServiceLayer, which is the destination name configured in the Connectivity
field.
For the Service Path field, enter /b1s/v2, which is the relative path for the Service Layer OData V4
protocol.
5. Configure the project attributes in the following way and choose Next.
7. Navigate to the project location and open the newly created project.
Context
You can create a worklist app by following the worklist application template wizard. The following are some key
screenshots and steps:
Procedure
4. Configure the data source and service selection as follows and then choose Next.
For the System field, select B1ServiceLayer, which is the destination name configured in the Connectivity
field.
For the Service Path field, enter /b1s/v2, which is the relative path for the Service Layer OData V4
protocol.
5. Fill out the entity selection information and choose Next.
For the Add FLP configuration field, select Yes. The application will be launched from the Fiori launchpad.
7. Configure the deployment settings and choose Next.
Make sure you have subscribed to the launchpad service. You can check it in the Instances and
Subscriptions under your subaccount.
10. After the project is generated, open webapp/manifest.json, navigate to the models and add the
following entries:
"groupId": "$direct"
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "sapb1.app3.i18n.i18n"
}
},
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"groupId": "$direct",
"earlyRequests": true
}
}
},
The purpose of this change is to ensure the request sending to the service layer is using the http method
GET, instead of a POST via OData $batch.
<script
id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceroots='{
"sapb1.employee": "./"
}'
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="allow"
></script>
data-sap-ui-frameOptions="trusted"
data-sap-ui-frameOptions="allow"
This step is mandatory because one of our demonstration purposes is to embed the Fiori app as an iframe
inside Web Client.
12. To run the project, click Preview Application from the dropdown list, and select the the first npm script
start fiori run.
Context
Procedure
1. To begin building, in the project explorer, right click the mta.yaml, then in the context menu, select Build
MTA Project.
https://<YourCloudFoundryOrganization>.launchpad.cfapps.sap.hana.ondemand.com/
f45d7531-58f2-4f04-ad2c-f7934d367316.sapb1-employee.sapb1employee-0.0.1/
index.html
Context
Using the URL of the Fiori app, let's open the VS Code to create one URL-mashup app for SAP Business One
Web Client.
Prerequisite
• You have already installed the SAP Business One Web Client Extensions for VS Code.
• You have already installed the SAP Business One Server Tools.
1. From the View menu, click Command Palette... and select Open Template Wizard.
2. Select SAP Business One Web Client Extensions, and click Start.
3. For the Application Type, select Tile Extension App and choose Next.
4. For the Application Information, provide basic information about your application like below, and choose
Next.
Attributes Value
Attributes Value
There are two tiles, one is for the existing window while the other is for a new window.
7. For the Tile Settings, specify the attributes in the following table:
Tile Setting 1
Attributes Value
What is the link for the tile <The URL of your Fiori app>
Tile Setting 2
Attributes Value
What is the link for the tile <The URL of your Fiori app>
Context
By default, it is not allowed to logon to the Fiori App in an iframe from Web Client from the security perspective.
To allow this, follow the below steps to trust Web Client domains.
Procedure
1. Logon to the SAP BTP Cockpit, and navigate to the Security Settings .
This will allow the Web Client to embed the login page of the SAP Authorization and Trust Management
service. For more information, see the documentation.
Context
The URL-mashup app is a Web Client extension and can only run in the Web Client context. Make sure that you
have assigned the URL-mashup app to the login company in the Extension Manager.
1. Log on to the company in Web Client and navigate to the Extensions tab, where you will find there are two
tiles for the apps.
2. Click on the MyEmployee1 tile.Your app will be opened in the current window.
Context
To enable extensions on the Web client, you need to deploy the mtar archive into the Web client by SAP
Business One Extension Manager.
The SAP Business One Extension Manager is a component in Server Tools for SAP Business One. To install
SAP Business One Extension Manager, you should install SAP Business One Server, and select Server Tools
Landscape Management Extension Manager .
You can access SAP Business One Extension Manager directly from a Web browser on the machine
on which the System Landscape Directory (SLD) service is running using the following URL: https://
<hostname>:<port>/ExtensionManager.
Procedure
Related Information
To import your mtar archive and assign the extension to a company, perform the following steps:
1. In the SAP Business One Extension Manager window, on the Extensions tab, choose the Import button.
The Extension Import Wizard window appears.
2. Choose the Browse button to select the mtar package and choose Upload.
Upon success, the basic information of the extension appears. Choose Next to optionally specify the value
of the shared parameters.
The startup mode values, such as Manual, Automatic or Mandatory, only affect SAP Business One
client extensions. For the Web client, they are all equivalent to "enabled", which decides whether you
can use this extension in the currrent company.
6. To check the assigned extensions in a company, in the SAP Business One Extension Manager window,
choose the Company Assignment tab. From Company List, select the company and check whether the
extension is available. If the extension is not available, you can use the Extension Assignment wizard to
assign it to a company.
Note
You can use one of the following two ways to assign an extension to a company:
You can completely configure the Web client extensions using the SAP Business One Cloud Control Center.
3. Go to Incoming folder, create a new subfolder and copy the mtar file on file system.
You are able to use APIs to generate URLs for the following views:
Related Information
Generating Web Client Object Views URLs with APIs [page 257]
Generating Web Client Analytics Views URLs with APIs [page 268]
You can work with the following APIs to get the URL of the list view of an object:
/extn/api/Variants?objName={objName}&objType={objType}
/extn/api/objectsListView?
objName={objName}&objType={objType}&variantGUID={variantGUID}
You can work with the following APIs to get the URL of the detailed view of an object:
1. Getting the URL of the object's detailed view for a specific record by object name, object type and object
key value:
/extn/api/objectsDetailView?objName={objName}&objType={objType}&value={value}
extn/api/objectsDetailView?objName=Configuration&value={value}
Three kinds of object types are defined in the Web client: SYSTEM (system objects in SAP Business One), UDO
(user-defined objects) and UDT (user-defined tables) .
var objectType = {
SYSTEM: 'System', //system object type
UDO: 'UDO',
UDT: 'UDT'
}
All system objects in the Web client are supported, and their names are used as parameters in the Web client
views APIs.
var systemObjectName = {
ACTIVITIES: 'Activities',
APPROVALREQUESTS: 'ApprovalRequests',
BUSINESSPARTNERS: 'BusinessPartners',
CREDITNOTES: 'CreditNotes',
DELIVERYNOTES: 'DeliveryNotes',
DRAFTS: 'Drafts',
INVOICES: 'Invoices',
ITEMS: 'Items',
ORDERS: 'Orders',
PURCHASECREDITNOTES: 'PurchaseCreditNotes',
PURCHASEDELIVERYNOTES: 'PurchaseDeliveryNotes',
PURCHASEINVOICES: 'PurchaseInvoices',
PURCHASEORDERS: 'PurchaseOrders',
PURCHASEQUOTATIONS: 'PurchaseQuotations',
PURCHASERETURNS: 'PurchaseReturns',
QUOTATIONS: 'Quotations',
RESERVEINVOICES: 'ReserveInvoices',
RETURNS: 'Returns',
OPPORTUNITIES: 'Opportunities',
INCOMINGPAYMENTS: 'IncomingPayments',
TIMESHEETS: 'TimeSheets',
SOLUTIONSKNOWLEDGEBASE: 'SolutionsKnowledgeBase',
SERVICECALL: 'ServiceCall',
BUSINESSPARTNERCATALOGNUMBERS: 'BusinessPartnerCatalogNumbers',
OUTGOINGPAYMENTS: 'OutgoingPayments',
USERQUERIES: 'UserQueries',
Related Information
Getting Variant List by Object Name and Object Type [page 259]
Getting URL of Object's List View by Object Name, Object Type and Variant GUID [page 260]
Getting URL of a Specific Record's Detailed View by Object Name, Object Type and Object Key Value [page 261]
Getting URL of a Configuration Object's Detailed View by Object Key Value [page 263]
API
/extn/api/Variants?objName={objName}&objType={objType}
Method
GET
Parameters
Response
Content-Type: application/json
API
/extn/api/objectsListView?
objName={objName}&objType={objType}&variantGUID={variantGUID}
Method
GET
Parameters
Content-Type: text/html
/webx/index.html#webclient-OCRD&/Objects/OCRD/List?
s=~(status~(version~1~userFilter~'CardType*20EQ*20*27L*27~filterBarLayout~'*7bvis
ibleItems*3a*5bCardCode*2cCardType*2cGroupCode*5d*7d~selectedColumns~(~(p~'CardCo
de)~(p~'CardName)~(p~'CardType)~(p~'GroupCode)~(p~'Balance)~(p~'Currency)~(p~'Cel
lular)~(p~'E_Mail)~(p~'IntrntSite)~(p~'CntctPrsn))~groupBy~(~)~sortBy~(~(key~'Car
dCode~dir~'Ascending)))~variant~(selectedKey~'2f224d16-f138-474c-
b5c1-5599c72e29c2~dirtyFlag~false))&r=yZjhyz8t
Using Sales Order as example, choose one variant GUID, get the sales order instance lists link for this variant.
You can access the link in the Web client as below:
API
/extn/api/objectsDetailView?objName={objName}&objType={objType}&value={value}
Method
GET
Parameters
Different objects have different key values and we have two kinds of object: documents and master
data, for example, (documents) Sales Order's key is DocEntry in 'ORDR', (master data) Items' key is
ItemCode in 'OITM'.
Response
Content-Type: text/html
/webx/index.html#webclient-ORDR&/Objects/ORDR/Detail?r=l08SPA6Z&id=ORDR%252C1217
Uses Sales Order as example, choose one object instance 1217, get the sales order instance detail link.
Note
Alternatively, with an existing Document Number (for example, 1204), the corresponding Internal Number
can be retrieved by invoking the Service Layer API like blow:
Upon Success, the Service Layer returns the DocEntry, which is the alias for Internal Number.
{
"value": [
{
"@odata.etag": "W/\"356A192B7913B04C54574D18C28D46E6395428AB\"",
"DocEntry": 1217
}
]
}
API
/extn/api/objectsDetailView?objName=Configuration&value={value}
Method
GET
Parameters
"InventorySettings"
Response
Content-Type: text/html
/webx/index.html#webclient-Config&/Objects/Config/Simple?
subViewId=InventorySettings.detailView
For a better understanding of how to use the APIs, an example is provided for you. The source code and the
mtar package are also provided in the following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which can be deployed directly to the
Extension Manager and displayed in the Web client as below:
To invoke this API, input the values of the two required fields:
• BO Type
• BO Name
Click the GetVariantList button, upon success the response is shown in the text area control.
To invoke this API, besides the the two required fields, input the value of the third field: Variant GUID.
You can get the value of this field from the response of the first API.
Click the GetListViewURL button, upon success the response is shown in the text area control.
To invoke this API, besides the the two required field, input the value of the third field: BO Value.
You can get the BO value from Service Layer or other data sources. For Orders, this field is equivalent to
DocEntry.
Click the GetDetailViewURL button, upon success the response is shown in the text area control.
You can work with the following APIs to get the URL of the analytics views:
/extn/api/analyticsViews?analyticsType={analyticsType}
2. Getting the specific analytics view variants list by view code and analytics type.
/extn/api/analyticsViewVariants?
viewCode={viewCode}&analyticsType={analyticsType}
3. Getting the URL of the specific analytics view by view code, analytics type and variant GUID.
/extn/api/analyticsView?
viewCode={viewCode}&analyticsType={analyticsType}&variantGUID={variantGUID}
API
/extn/api/analyticsViews?analyticsType={analyticsType}
Method
GET
Parameters
Response
Content-Type: application/json
Note
The response might be different according to user authorization and database type.
API
/extn/api/analyticsViewVariants?viewCode={viewCode}&analyticsType={analyticsType}
Method
GET
Parameters
Response
Content-Type: application/json
[{"Guid":"6a080479-16dc-470e-b3b4-d4a57f26effd","Name":"Standard"},
{"Guid":"a2dfa8a2-24bb-4a48-b711-002a8d453b31","Name":"1st Quarter Only"}]
The above response use Sales Analysis by Rows Overview as an example, and the variant name list can be seen
in the Web client as below:
API
/extn/api/analyticsView?
viewCode={viewCode}&analyticsType={analyticsType}&variantGUID={variantGUID}
Method
GET
Parameters
Response
Content-Type: text/html
Using Sales Analysis by Rows Overview as example, choose one variant GUID, get the link for this variant. You
can access the link in the Web client as below:
For a better understanding of how to use the APIs, an example is provided for you. The source code and the
mtar package are also provided in the following links respectively.
• You can download and unzip this file to get the source code.
• You can download and unzip this file to get the mtar package, which can be deployed directly to the
Extension Manager and displayed in the Web client as below:
To invoke this API, input the value of the required field Analytics viewType.
Click the GetanalyticsViews button, upon success you get the view codes, and the response is shown in the text
area control.
To invoke this API, besides the Analytics viewType field, input the value of the field Analytics viewCode.
You can get the value of this field from the response of the first API.
Click the GetViewVariants button, upon success you get the view variants, and the response is shown in the text
area control.
To invoke this API, besides the the two required fields, input the value of the third field Variant GUID.
You can get the value of this field from the response of the second API.
Click the GetanalyticsView button, upon success you get the view URL, and the response is shown in the text
area control.
Background
As of SAP Business One 10.0 FP 2305, the Web client introduces the Content Security Policy (CSP) to
further enhance its security. For existing or upgraded companies, there is no impact. But for newly created
companies, this feature will be enabled and possibly cause some compatibility issues for the Web client
extensibility. To address this situation, this guide is provided to illustrate how to adjust the CSP settings to
handle various potential CSP issues.
Symptom
As a customer or partner, when opening an extension in the existing window mode, the symptom is that
the extension content is blocked or not displayed. In that case, you can go to the browser's Developer Tools
(also known as Development Mode) and check the errors on the Console tab, where you will find some error
messages relevant to CSP violation.
More details will be explained in the following topics. For information on how to enable the development mode,
please see Browser Development Mode [page 281].
The following CSP is applied to newly created companies by default. When issues arise, adjustment can be
manually made in the General Settings of the Web client.
Related Information
How to adjust the CSP settings depends on the specific issues encountered by a given type of extension and
how the extension is programmed. Below are some typical issues and solutions for the sample apps provided in
the guide. If partners develop their own app based on the sample apps, please take the following as a reference
and go to the CSP Generic Approach [page 281] topic to address possible CSP issues.
Issues
If you are using an Angular app as your extension, you could possibly run into the following issues on the
Console tab in the browser development mode.
Solutions
Related Information
Issues
If you are using a React app as your extension, you could possibly run into the following issues on the Console
tab in the browser development mode console.
Solutions
Issues
If you are using a Blazor app as your extension, you could possibly run into the following issues on the Console
tab in the browser development mode.
Solutions
Related Information
Issues
If you are using a URL mashup app as your extension, you could possibly run into the following issues on the
Console tab in the browser development mode.
Solutions
Find the frame-src directive and append your app url to the directive, for example www.bing.com.
Alternatively, you can use an asterisk * in your url to make it more generic, like below.
Related Information
Issues
If you are using a Fiori app as your extension, you could possibly run into the before-mentioned issues, or other
CSP issues, on the Console tab of the browser development mode. Whether you encounter issues or not will
depend on how you program with your extension. If your frontend code follows the CSP specifications or some
best practices, you will have no CSP issues.
Solutions
Follow the CSP Generic Approach [page 281] to address possible CSP issues.
Issues
If you are using a Vue app as your extension, you could possibly run into the before-mentioned issues, or other
CSP issues, on the Console tab of the browser development mode. Whether you encounter issues or not will
depend on how you program with your extension. If your frontend code follows the CSP specifications or some
best practices, you will have no CSP issues. For example, the Vue sample provided in this guide encountered no
CSP issues.
Solutions
Follow the CSP Generic Approach [page 281] to address possible CSP issues.
8.2 Appendix
The Content Security Policy (CSP) is a security feature implemented by modern web browsers to prevent
cross-site scripting (XSS) and other code injection attacks. It allows web developers to define a set of rules that
specify which content sources are allowed to be loaded by the browsers.
To address potential CSP issues in the Web client extension, follow the steps below:
1. Determine your content sources. Identify the sources of content that your website should load, such as
images, scripts, styles, fonts, etc. Keep in mind that you should only allow trustworthy sources to minimize
the risks of security breaches.
2. Create a CSP policy. Based on the allowed content sources, create a CSP policy string. The policy string
will consist of one or more directives, each specifying the types of content and their respective sources. For
example, a simple CSP policy string might look like this:
Note
Creating a secure and effective CSP policy may require a thorough understanding of your website's
content and dependencies. It is crucial to test your policy thoroughly and be prepared to make
adjustments if new content sources are introduced.
To access the browser's Developer Tools (also known as Development Mode), follow the steps for the most
popular web browsers:
• Google Chrome
• Press the F12 key or Ctrl + Shift + I (on Mac, press Cmd + Option + I ).
• Alternatively, click the three vertical dots in the top-right corner of the browser, and then go to More
tools Developer tools .
Once you’ve accessed the Developer Tools, you'll be able to explore various features like the Elements (DOM)
panel, Console, Network, Application, and more. These tools help you debug, analyze, and optimize your
websites for better performance and user experience.
Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:
• Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:
• The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
• SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.
• Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering an SAP-hosted Web site. By using
such links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.
Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.
Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities,
genders, and abilities.
SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.