Skip to Content
Author's profile photo Thomas Schneider

How to Dynamically Set the Properties of Contols in SAP UIs (“Flexible UI”)

For custom UIs (created on top of custom or SAP business objects), you can dynamically set the properties of many UI controls using direct binding (of the property) to a BO element or frontend scripting.
The following table shows dynamic properties in custom UIs (from: SAP Business ByDesign Studio Application Development, see the book or the documentation on the UI designer for further details).
Dynamic Property (Custom UI) Description
Enabled / Visible The property “Visible” defines if a field or button is shown at all, the property “Enabled” defines if it is enabled or not (grayed out). 
Mandatory An input field is mandatory, indicated by a red star in the input field.
ReadOnly An input field is read-only in the current context. This property is normally set dynamically. If you want to set this property permanently to true, you should use a static text instead.
Background
colour
Background color of the field
Explanation Explanation and tool tip are called on-screen help because the show directly up on screen areas, fields, buttons, etc.
Label Label beside the field or on the button
Tool Tip Tool Tip

Dynamic properties allow, for example, to show or hide a control based on the status of business object. The same functionality is available inside custom embedded components that are added to SAP UIs. However, until version 1302, it was not possible to influence the UI properties of controls in SAP UIs or the properties of extension fields that were added directly to a SAP UI (and not via custom embedded component).  This gap is closed now in 1305.

As of version 1305, it is now possible to dynamically set the following properties for UI controls of an SAP UI:

Property (SAP UI)
Enabled / Visible
Mandatory
ReadOnly

You can set the properties in the Extensibility Explorer of the UI Designer using the Button “Adjust Properties” (after selecting an appropriate stable anchor). You can dynamically set the properties based on a so-called UI switch (attached to a user role, see documentation for details), or based on a BO element of type indicator.

If you are interested in the topic in more detail, please check out the latest documentation (http://help.sap.com/studio_cloud) and search for “flexible ui”.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Deepak Singhal
      Deepak Singhal

      Hi Thomas,

      Could u please help me out in changing Background Color of a button.. I am setting the Background color property from UI designer but its not working.

      Thanks

      Deepak

      Author's profile photo Pradeep Kumar N
      Pradeep Kumar N

      Hi Deepak,

      May be this helps: http://scn.sap.com/thread/3918692