With variant creation provided by SAP Fiori tools, developers can create variants for applications or individual tables, which can be distributed together with the application. The variants are stored as SAPUI5 flexibility changes in the project's webapp/changes
folder and packaged with the application during the build step.
Variants store view settings, such as filter settings or control parameters. On the UI, these variants are referred to as views.
The feature is delivered with the @sap/ux-ui5-tooling
node module and its preview feature. Developer variant creation is supported from the SAPUI5 version 1.90 (OData V2 based applications) and 1.84 (OData V4 based applications). @sap/ux-ui5-tooling
only supports ABAP service-based projects.
To create development variants for your Fiori project with SAP Fiori tools perform the following steps:
-
Execute
start-variants-management
from the Preview Application context menu.If the script is not present, configure the feature:
- Open the Command Palette ([CMD/CTRL] + [Shift] + [P] ).
- Execute the Fiori: Add Configuration for Variants Creation command.
-
After the script is executed, a new browser tab appears. It displays the preview of the application switched to the UI adaptation mode.
-
For more information on creating developer variants, see Creating and Adapting Views.
Visibility and role assignment are not supported for developer variants.
-
Click Save & Exit to save the changes.
-
For each new variant, one or multiple SAPUI5 change files are created in the
webapp/changes
folder of your project. You can open each file and replace static texts of your application with translatable text, such as{i18n>textKey}
and maintain the text in the correspondingi18n
file of your project.
For more technical information, see
@sap/ux-ui5-tooling
.