Create Flexible UI using UI Switch in SDK

SAP SAP Business ByDesign SDK

1. Create an Extension business object

Click here to know more about XBO creation.

2. Create UI Switch

From Add New Item, Choose UI Switch and create it.

3. Enhance the screen for XBO

3.1 Select the section group where the field is located. The section group should have a stable anchor for the dynamic properties to support.

3.2 Go to Extensibility Explorer and select the action “Adjust Properties”.

3.3 Assign a UI switch that was created in the solution (UISwitchMaterial).

UI Switch – Equal to

Visible NoneNo UI Changes
TrueField to be Displayed
FalseThe field will not be mandatory
MandatoryNoneThe field will be hidden
TrueThe field will be mandatory
FalseThe field will not be Read-only
Read OnlyNoneNo UI Changes
TrueField to be Read Only
FalseField will not be Read-only

UI Switch – Not Equal to

The field will be hiddenNoneNo UI Changes
TrueField to be Displayed
FalseThe field will not be mandatory
MandatoryNoneThe field will be hidden
TrueThe field will be mandatory
FalseThe field will not be Read-only
Read OnlyNoneNo UI Changes
TrueField to be Read Only
FalseField will not be Read-only

4. Assign the UI switch to Business Role

Click on the business role and navigate to the business role OIF screen and navigate to the tab UI switches.

Click Add Row and select UI switch from the value selector (UISwitchMaterial)

5. Assign the business role to the Business user

Navigate to Application and User Management -> Business users ->Edit Access Rights ->Business Role Assignment and check the Assigned to User check box.

6. Testing

6.1 The Dummy UI field will be visible for the user who has a BUS_ANA business role.

6.2 The Dummy UI field will not be visible for the user who has not been assigned a BUS_ANA business role.

If you like to add your views to this article, kindly leave them in the comments section, and please don’t forget to like and subscribe!