Responsive Table

The responsive table contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

Responsive table
Responsive table

Usage

Use the responsive table if:

  • You need a table to display a moderate amount of data. When your data is of average complexity, the responsive table can handle up to 200 items. However, more complex data lowers the limit, and less complex data raises it. Note that the limit is not on the number of items in the database or in the filtered results, but the volume of data loaded at any point. Factors that influence the exact limit include:
    • The number of loaded rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on the page)
    • The browser used

    For loading large amounts of complex data, use a grid table instead, as it can handle higher volumes more efficiently.

  • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
  • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
  • Selecting one or more items is a main use case and details are needed to choose the correct item.
  • Line items are independent of each other and no operation across columns is needed.
  • You want a single implementation for all devices. As its name suggests, the table is responsive and adjusts its appearance to the screen size so you can use it on all devices. However, make sure you adapt the responsive table design to offer the best solution for the tasks performed on mobile devices. Sometimes, a solution without a table is more useful and usable.

Do not use the responsive table if:

  • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
  • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You expect users to work with large amounts of complex data. Use the analytical table or grid table instead; they are optimized for those cases.
    Note that the analytical table and the grid table are not fully responsive, but available only for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. In contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that the analytical table isn’t fully responsive and is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need an overview of a large amount of data. In this case, use a chart.
  • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
  • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
Don't
Don't use a responsive table as a form
Don't use a responsive table as a form

See the table overview to decide which SAP Fiori table is most suitable for your needs.

Responsiveness

The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

  • Block: Label/value pairs are listed one below the other.
  • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
  • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

In all layouts, you can show the labels next to or above (recommended) the corresponding data.

The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

Information
The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
Responsive table displayed on a smartphone (size S)
Responsive table displayed on a smartphone (size S)
Responsive table displayed on a tablet (size M)
Responsive table displayed on a tablet (size M)
Responsive table displayed in compact mode on a desktop computer (size L)
Responsive table displayed in compact mode on a desktop computer (size L)

The responsive behavior is optional. If it is not used, the responsive table minimizes all visible columns until they are no longer readable. The priority level assigned to columns also impacts the display of the responsive table. For more information on the priority levels, see: Smart Table

There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

  • Let more than one column stay in the tabular layout
  • Move more than one column into the pop-in area at once

In both modes, the responsive table ensures that at least one column always remains in the table layout.

Auto Pop-In Mode

The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in area. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in area first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

In auto pop-in mode, all other pop-in-related column settings are ignored.

Manual Pop-In Mode

The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

  • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
  • Move to the pop-in area (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
  • Hide

By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

For the smallest screen width, keep the following information in the table layout:

  • The identifier of the line item
  • The key attribute

Example for Block Layout

A typical responsive table.

A typical responsive table
A typical responsive table

Hide the information column for a width smaller than 570 px.

Hiding the information column
Hiding the information column

Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the vendor column to the pop-in area
Moving the vendor column to the pop-in area

Move the column “limit” to the pop-in area for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the limit column to the pop-in area
Moving the limit column to the pop-in area

Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the price column to the pop-in area
Moving the price column to the pop-in area

If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

Pop-in area: Moving the data below the labels
Pop-in area: Moving the data below the labels

Example for GridLarge Layout

A more complex responsive table.

A more complex responsive table (full screen without pop-in content)
A more complex responsive table (full screen without pop-in content)

In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

GridLarge layout - 'Average Stay' column moves to the pop-in area
GridLarge layout - 'Average Stay' column moves to the pop-in area

If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in content wraps.

GridLarge layout - 'Description' column moves to the pop-in area
GridLarge layout - 'Description' column moves to the pop-in area

If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

GridLarge layout - 'Details' column moves to the pop-in area
GridLarge layout - 'Details' column moves to the pop-in area

Layout

The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

The column header shows the label for each column. In addition, it allows the user to resize the column.

The collection of items, or rows, occupies the main part of the responsive table.

You can add aggregation information (such as totals) on the table footer.

A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

Schematic visualization of the responsive table
Schematic visualization of the responsive table

Components

The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
You can use the table footer to display additional static information relating to the table content.
The More button loads more items to the front end if not all items have yet been loaded.
Components of the responsive table
Components of the responsive table

Behavior and Interaction

The responsive table is quite flexible with regard to its content.

Table Level

Scroll

The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

If the table works in “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

Same table, different number of items
Same table, different number of items

When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

Information
The “sticky” feature comes with some limitations:

  • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
  • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
  • If focus is set to a fixed column header, the table is automatically scrolled to top.

Sticky table title and sticky column header
Sticky table title and sticky column header

Merge Duplicates

To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

Do not use the merge feature:

  • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
  • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
Supplier column merges duplicates in consecutive rows
Supplier column merges duplicates in consecutive rows
Merged columns with multiselection
Merged columns with multiselection

Select

A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

  • None: Items cannot be selected (sap.m.ListMode.None).
    Note: Line items can still use the sap.m.ListType “navigation”, which allows click handling for specific line items. Only use this option if the click triggers navigation to a corresponding details page.
  • Single select master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
  • Single select left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
  • Multi select: Users can select one or more items using the checkboxes on the left of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).
    Another multi select variant is to not provide a Select All option, but just a Clear All check box in the same place (property: multiSelectMode, value: ClearAll).

Keyboard: If the focus is on a row, the space bar selects the corresponding item.

Responsive table without selectable items
Responsive table without selectable items
Single select master
Single select master
SIngle select left, with radio buttons. Use only if row clicks are used for something else.
SIngle select left, with radio buttons. Use only if row clicks are used for something else.
Multi select with 'Select All' checkbox
Multi select with 'Select All' checkbox
Multi select with 'Clear All' button
Multi select with 'Clear All' button

Group

When items are grouped, a group header is displayed. The group header is not interactive.

Group headers
Group headers

Show Aggregations

Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

Don’t show aggregations in “growing” mode. In “growing” mode it isn’t clear which values are being aggregated; only the items currently loaded in the front end, or all items.

Table footer displays aggregated total
Table footer displays aggregated total

Load Items

When the responsive table fits the general requirements for your use case, always consider ways to reduce the amount of data loaded in the responsive table with, for example, filters, graphics, aggregation of information, and navigation. Keep in mind you should use it only to display moderate amounts of data, including factors like number of items and content complexity.

To show more than 100 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The “growing” mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. You decide whether the user triggers the request by scrolling (preferred) or by clicking the More button.

If you use the More button, show the number of items already loaded and the total number items below the More text, if possible.

Do not show aggregations in “growing” mode. Also, do not display an item count on the table toolbar if “growing” mode is used. Use the count on the More button instead.

Guidelines
If you expect users to work with large amounts of data, use the grid table because it is optimized for handling large data sets.

The growing mode will only help to reduce the amount of data loaded at once but the limits to the overall amount of data still apply.

Load on scroll
Load on scroll

Column Header Level

The column header provides the label for the corresponding column. It also handles the functionality for resizing columns.

Resizing Columns

If you implement column resizing, users can resize the columns as follows:

  • Mouse interaction: The user drags the separator line between two columns. Double-clicking the line optimizes the column width based on the length of the currently visible data and the label of the column header.
  • Touch interaction: As for mouse interaction, but with a larger target touch area.
  • Keyboard interaction: When the focus is on the column header, Shift+Right increases the width of the focused column. Shift+Left decreases the width.

When a column is resized, the other columns can keep their original width or adapt their width. This depends on the column width settings:

  • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and the columns that follow are moved accordingly. The width of all the other columns is not affected. If the visible columns don’t use the full width of the table control, empty space is added. If the visible columns exceed the width of the table control, one or more columns move to the pop-in area.
  • If all column widths are set as a percentage or as “auto”, resizing one column might also result in automatic resizing of some or all other columns. The position of the resized column might also be affected. This ensures that the full table width is used and no white space is added.
Developer Hint
To enable resizable columns, implement the plugin:
sap.m.plugins.ColumnResizer.
Resizing a column
Resizing a column

Line Item Level

Delete Single Item Rows

To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

Do not use this mode if deleting multiple lines at once is the preferred use case.

Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

Responsive table in 'Delete' mode
Responsive table in 'Delete' mode

Highlight an Item

To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

Highlighted item
Highlighted item

Navigate

To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

If no navigation is possible, set sap.m.ListType to “inactive”.

“Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

Navigation indicator
Navigation indicator

Indicate Navigated Item

When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

Navigated item
Navigated item

Edit Line Items

To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

Edit button
Edit button

Click an Item

Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

Active element
Active element

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Responsive table with a context menu
Responsive table with a context menu

Cell Level

Showing Information

In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

Several lines of text within one cell
Several lines of text within one cell

Add Controls

Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

Controls inside cells
Controls inside cells
Any control can be placed inside cells
Any control can be placed inside cells

A cell can contain more than one control and more than one data point.

With the View Settings dialog, users can sort, filter, and group by each of these data points.

Several controls per cell
Several controls per cell

You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

Different controls per column
Different controls per column

Guidelines

Responsiveness

In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

  • The values are text-only (no input fields, icons, images, micro charts, and so on)
  • The available space is at least the double the width of size S.

This avoids truncation or “over-wrapping” of the labels and content.

If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

Information
The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534)

The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

Remove the item count in the table title if there are zero items. Do not use an item count together with “growing” mode.

If possible, keep the title bar sticky (sap.m.Table, property: sticky).

Table title with item count
Table title with item count

Selection

For single selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for list-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

In multiple selection mode:

  • Prefer Select All over Clear All
  • Use Clear All only for tables with a large number of items (more than recommended above), where loading all items to select them would harm performance.
  • To avoid confusion, don’t show checkboxes in the first data column in the default delivery.
  • Make sure that the Select All checkbox (de)selects all items the user can reach by scrolling. This is only possible if all items are rendered.
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
Don't
Single selection left - Don't show radio buttons in the first column in the default delivery
Single selection left - Don't show radio buttons in the first column in the default delivery
Don't
Multiple selection - Don't show checkboxes in the first column in the default delivery
Multiple selection - Don't show checkboxes in the first column in the default delivery
Do
Use the selection mode
Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
Do
Use the selection mode
Use the selection mode "single select master" in all other single selection cases
Developer Hint
Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

Loading Data

To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Table in busy state while loading data
Table in busy state while loading data

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors
Table containing errors

Columns – Best Practices

Minimize the number of columns:

  • On a smartphone, use only one or two columns, depending on the content.
  • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

If the responsive table does not fit into the width provided:

  • Hide columns to reduce the width of the table.
  • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

At the smallest size, keep the following information in the table layout:

  • The column that identifies the line item.
  • The column that contains the key attribute.

If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with empty space.

Optimize the column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize the column width for typical content.

When defining the column width, consider the implications when a column is resized:

  • If you define the column width in pixels or rem, resizing a column only affects the width of that particular column.
    • If the table isn’t wide enough to show all the columns after a column has been resized, one or more of follow-on columns move into the pop-in area.
    • If the columns don’t use up the available space, white space appears to the right of the last column (property: fixedLayout, value: strict).
    • If only one column remains, and the width of this column exceeds the width of the table itself, the width of the column is reduced to the width of the table.
  • If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text wraps more when the browser window size is reduced. This ensures that all columns together make use of the full table width.
  • If you define the column width as “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.
  • Be cautious of mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when columns are resized. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

Don't
Do not distribute just a few columns across the full width
Do not distribute just a few columns across the full width
Do
Use a fixed column width instead
Use a fixed column width instead

Column Headers – Best Practices

Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

To keep the column headers readable, wrap or truncate the texts as follows:

  • If columns are not resizable, use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.
  • If columns are resizable, use controls that truncate.

Keep column headers sticky.

Do
Wrap column headers if columns are not resizable
Wrap column headers if columns are not resizable
Do
Truncate column headers if columns are resizable
Truncate column headers if columns are resizable

Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

Accepted: Link as column header text (rarely used)
Accepted: Link as column header text (rarely used)
Accepted if responsiveness is taken into account: Text plus search field
Accepted if responsiveness is taken into account: Text plus search field

If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

For text and ID fields, use a generic label (for example, Employee for Name and ID).

If none of these are possible, separate the labels with “/” (for example, Name / Status).

For boolean values, such as checkboxes, find a descriptive text for the column header.

Horizontal Content Alignment

For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

Exception: Secondary information in a column always follows the alignment of the main information.

Left-Align

Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-align text
Left-align text

Left-align: Status information

Left-align status information
Left-align status information

Right-Align

Right-align: Dates and times (to ensure comparability for most formats and locales)

Right-align dates
Right-align dates

Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

Right-align numbers
Right-align numbers

Center-Align

Center-align: Icons, images, and avatars

Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

Align buttons with the content hierarchically

Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

Vertical Content Alignment

Top-align where possible to facilitate reading the content on one line.

Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

Do
Use top-alignment where possible
Use top-alignment where possible
Don't
Don't use top alignment if it doesn't make sense
Don't use top alignment if it doesn't make sense

Content Formatting

The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

If the table width is small, do not hide this column or move it to the pop-in area.

Object identifier
Object identifier

Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

This minimizes the line height.

For items with a small line height, place the ID in brackets after the corresponding string
For items with a small line height, place the ID in brackets after the corresponding string
If displayed as a link, use the whole text as the link
If displayed as a link, use the whole text as the link

Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

For items with a large line height, place the ID below the corresponding string
For items with a large line height, place the ID below the corresponding string
Is displayed as a link, use only the first line as the link
Is displayed as a link, use only the first line as the link

If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

Several key identifiers
Several key identifiers

For status information, use semantic colors on the foreground elements.

For status information on text: If the status is actionable, add a transparent icon button next to the text.

Semantic colors on text
Semantic colors on text

Avoid truncation. Use controls that wrap the text and support hyphenation.

For example, use text.

Do
Wrap text
Wrap text
Don't
Don't truncate text
Don't truncate text

For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

Interactive controls – Inline
Interactive controls – Inline

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

  • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
  • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
  • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
For short numbers, add the item number to the description
For short numbers, add the item number to the description

Flag and Favorite

Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

Item marked as a favorite
Item marked as a favorite

Empty Tables

Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).

Remove the item count in the table title if there are zero items.

Provide meaningful instructions
Provide meaningful instructions

Displaying Boolean Values

If a column contains Boolean values, such as “Yes” or “No”, show a read-only checkbox next to the texts.

The supplementary checkbox makes it easier for users to see at a glance which items are “true” (checked) and which are “false” (unchecked).

 

Developer Hint

Use sap.m.checkbox with the Horizon theme and set the editable property to “false” to get the read-only variant. Add the checkbox next to the existing text value. The text itself should remain unchanged.

Avoid showing only text for Boolean values
Avoid showing only text for Boolean values
Boolean values with read-only checkboxes for easier scanning
Boolean values with read-only checkboxes for easier scanning

Item States

To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

An unread item
An unread item

To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

A modified item
A modified item

To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight). A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

A locked item
A locked item

To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

Item in draft state
Item in draft state

Show only one state at any one time.

Highlight Items

To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.m.ListItemBase, property: highlight)

Highlighted items using status colors
Highlighted items using status colors
Highlighted items using industry-specific (indication) colors
Highlighted items using industry-specific (indication) colors

Numbers and Units

If the following conditions all apply, show the unit of measurement in the column header:

  • The unit of measurement is the same for all rows
  • A single cell contains only one amount with the unit of measurement
  • The column header does not scroll away

In all other cases, show the unit of measurement together with the corresponding amount within the row.

Show the unit of measurement in the same column as the corresponding amount.

For numbers with units, show the correct formatting by using the object number control.

Object number
Object number

For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
Exception: If all numbers are of equal importance, emphasize none of them.

If the table width is narrow, do not hide this column or move it to the pop-in area.
Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

Object number (emphasized)
Object number (emphasized)

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Currently, there is no keyboard support for drag and drop.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop targets in between items
Drop targets in between items

Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

Example:
A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

Don't
Don't combine rearranging items with grouping, unless you know exactly what you're doing.
Don't combine rearranging items with grouping, unless you know exactly what you're doing.

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the whole table or per row.

Actions

To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
  • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
Do
Inline actions
Inline actions
Don't
Don't combine unrelated inline actions
Don't combine unrelated inline actions

The following actions on single items must always be in-line:

Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

Delete button
Delete button

Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

Navigation indicator
Navigation indicator

Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

Edit button
Edit button

From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

Edit and navigation cannot be combined.

To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

For information on enabling and disabling actions, see Enabling/Disabling Actions.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the table toolbar or at page level
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Add button in table toolbar
Add button in table toolbar
New item as first row in edit mode
New item as first row in edit mode
Saved new item, still highlighted, still the first item
Saved new item, still highlighted, still the first item

Editable Content

For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

All SAPUI5 controls can be used.

If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

For mass editing items:

  • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
  • Provide an Edit button.
  • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

For details, see mass editing.

View Settings: Sort, Filter, Group

Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

  • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
  • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

Several triggers for the different view settings (sort, filter, group)
Several triggers for the different view settings (sort, filter, group)

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

For each data point, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

Keep the infobar sticky (sap.m.Table, property: sticky).

Developer Hint
To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
Filtered table
Filtered table

Group

To display the current group state, group headers are shown.

On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

[Label of the grouped column]: [Grouping Value]

Do not use several values on the group header.

Grouped table
Grouped table

If there is no grouping value, show the following text:
[Label of the grouped column]: (Not Available)

This is the case if you have a group of items that don’t have a value for the grouped column.

Grouped table, with missing grouping value
Grouped table, with missing grouping value

Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

Personalization: Add, Remove, Rearrange Columns

To enable users to add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

If all columns are hidden, the table shows a corresponding “no data” text.

View settings and table personalization icons
View settings and table personalization icons

Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

Tables in Object Pages

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Paste

The browser paste function can be used to paste data from the clipboard to the table if the focus is on an editable control within the table. The browser paste is triggered with the Ctrl + V keyboard shortcut, the table toolbar action, or actions in either the browser context menu or the table generic context menu.

The pasting of a new row or cell follows the responsive table inline creation paradigm, where new items are created at the bottom of the table. The same happens when the data is pasted and a row is unselected or focused.

Note

Pasting via the browser context menu is unavailable if the table has its own context menu because table context menu takes precedence over the browser context menu.

Paste (Overwrite)

Pasting overwrites data present in the table only when a cell with data is selected prior to pasting. When a single cell is selected, all the data in the clipboard is pasted into the table, extending from that cell. The paste will overwrite the data contained in those additional cells, too.

Note

If a user has selected multiple cells to overwrite, but the focus is placed outside of the selection, pasting will follow the guidelines for inline creation as above. This can happen, for example, when the user uses the arrow keys on the keyboard to move the focus.

Clipboard Selection behaviour

If the clipboard has larger data set than the range selected for the paste, only the cells contained within the selection are updated.

On the other hand, if the clipboard has a dataset too small to fill all the cells selected for the paste, the pasted data updates only the selected cells for which there is data.

Read-Only

The paste action does not update read-only cells, even if there is data in the clipboard corresponding to those cells. Instead, it updates only the surrounding write cells.

Example

If the clipboard contains a range of four columns, and that data is pasted into a table, where column 2 is read-only, only the cells in column 1, 3, and 4 are updated.

Properties

sap.m.Table

The following additional properties are available for the responsive table:

  • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
  • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
  • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
  • The property: inset adds a margin on all sides of the responsive table.
  • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
    • A separate toolbar
    • variantManagement
    • headerToolbar aggregation
  • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
  • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
  • The property: width defines the width of the whole table.
  • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
  • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
  • The property: modeAnimationOn does not have any effect. Do not use it.
  • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
  • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
  • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
  • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
  • The property: visible shows the table (“true”) or hides it (“false”).
  • The property: tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.m.Column

The following additional properties are available for sap.m.Column:

  • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
  • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
  • The property: visible shows or hides the column.
  • The property: tooltip does not have an effect. Do not use it.

sap.m.ColumnListItem

The following additional properties are available for sap.m.ColumnListItem:

  • The property: selected allows an item to be selected programmatically.
  • The property: counter does not have any effect. Do not use it.
  • Do not use the property: busy.
  • Do not use the property: busyIndicatorDelay.
  • The property: visible shows or hides the item.
  • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Grid Table

A grid table contains a set of data that is structured in rows and columns. It allows users to scroll in both directions and is optimized for handling large numbers of rows and columns.

Usage

Use the grid table if:

  • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need a table to display large amounts of complex data. The grid table can handle higher volumes more efficiently than the responsive table.

The responsive table can handle around 200 items when data is of average complexity — more items when data is less complex and fewer when data is more complex. If your scenario exceeds these data limits, use the grid table. Factors that influence the exact limit include:

    • The number of loaded rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on the page)
    • The browser used
  • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult.
  • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.
  • Your use case is for tasks performed on a desktop or tablet device. The grid table is not fully responsive.

Do not use the grid table if:

  • You expect users to work with moderate amounts of data. Note that this is about the data actually loaded — not the items in the database or the filtered results — which includes the number of items as well as the complexity of the data displayed. In these cases, consider the responsive table.

Additional use cases where you might need the responsive table include:

    • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
    • Selecting one or several items is the main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. However, make sure you adapt the responsive table design to offer the best solution for the tasks performed on mobile devices. Sometimes, a solution without a table is more useful and usable.
  • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
  • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
  • You need an overview of a large amount of data. In this case, use charts.
  • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
  • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

Responsiveness

A grid table is not fully responsive, but available for only desktops and tablets, and it supports touch interactions. For mobile use cases, you need to:​

  • Create a new Fiori application with reduced complexity, not an exact match of the desktop application.
  • With the new application, address the most important use cases for users in a mobile context. The responsive controls (responsive tablelist or tree,) or a relevant control for your use case (for example a chart or the category navigation pattern) may suffice.

Or, you could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

Grid table shown on a desktop
Grid table shown on a desktop
Grid table shown on a tablet
Grid table shown on a tablet

Layout

  1. Select All – The Select All checkbox selects or deselects all items.
  2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
  3. Selector cells – The selector cells allow the user to select one or more items.
  4. Items – The collection of items, or rows, occupies the main part of the grid table.
Schematic visualization of the grid table
Schematic visualization of the grid table

Components

A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

Behavior and Interaction

A grid table is quite restricted in terms of its content.

Table Level

Scroll

A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

You can add any number of line items to the grid table, which uses “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

The grid table is optimized to allow faster scrolling within the first 1000 items.

Scrollbar
Scrollbar

Select

Selection Mode

Selection for a grid table depends on the chosen selection mode. The following options are available:

No selection: Items cannot be selected. (property: selectionMode = None)

A non-selection grid table
A non-selection grid table

Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

A single-selection grid table
A single-selection grid table

Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

For multiple selection, you can choose between two variants.

  • Multi-toggle mode (property: selectionMode = MultiToggle)
  • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

These variants behave differently when the user selects more items than are currently loaded in the front end.

Multi-toggle

In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

Multi-selection plug-in

If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

  • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
  • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
    • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
    • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
  • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

A multiselection grid table
A multiselection grid table
Using the multi-selection plug-in with a limit
Using the multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

Compact, Cozy, and Condensed

Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

For more information on cozy and compact modes, see content density.

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
  • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

After resizing a column, the adaptation of the column widths depends on how the column width is set:

  • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
    If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
  • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

Column header
Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Fewer columns than space available
Fewer columns than space available

Column Header Menu

For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

  • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
  • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
  • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

For each column, the menu can be replaced by an app-specific menu.

Column header menu
Column header menu

Sort

The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

Note that the filter may return zero results, in which case, the table might be empty.

General recommendations for filtering:

  • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
  • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
Free text filter in column header menu
Free text filter in column header menu

Freeze Columns

The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

Freeze setting in column header menu
Freeze setting in column header menu

Line Item Level

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

Line item
Line item

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Grid table with a context menu
Grid table with a context menu

Cell Level

A cell provides one data point and can contain one of the following controls:

We recommend against using other controls to prevent issues with alignment, condensed mode, screen reader support, and keyboard support.

Cell
Cell

Guidelines

Data Density vs. Complexity

The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

Only show tables with a lot of data as a last resort. Try the following instead:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Try to minimize the number of columns, especially if there is a large number of rows.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area.

Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534).

The item count in the table title includes all the visible items that a user can reach by scrolling.

Remove the item count in the table title if there are zero items.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

Selection

Single Selection

For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

Multiple Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

  • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
Don't
Do not add checkboxes to the first data column in the default delivery
Do not add checkboxes to the first data column in the default delivery
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Loading Data

To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Grid table in busy state while loading data
Grid table in busy state while loading data

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors and warnings
Table containing errors and warnings

Columns – Best Practices

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

Maintain a constant column width and avoid adjusting it automatically when the content changes.

Always keep to one line of text. Do not wrap.

Don't
Don't truncate the initial visible content in the default delivery
Don't truncate the initial visible content in the default delivery
Don't
Never wrap texts
Never wrap texts

Column Headers – Best Practices

For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

Content Alignment

For alignment of cell content, follow the guidelines below.

Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-alignment of text
Left-alignment of text

Right-align numbers (except IDs).

This ensures comparability of numbers and amounts.

Right-alignment of numbers
Right-alignment of numbers

Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

For aligning to the decimal point, use the sap.ui.uinified.Currency control.

Alignment to decimal point
Alignment to decimal point

Right-align dates and times.

This ensures comparability for most formats and locales.

Right-alignment of dates
Right-alignment of dates

Left-align status information.

Left-align status information
Left-align status information

Center-align icons.

Left-align micro charts.

XS micro charts in condensed mode
XS micro charts in condensed mode

Content Formatting

Locale Settings

Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

Key Identifier

Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

Emphasized link
Emphasized link

For strings with IDs, use one of the following options:

  • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
  • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
Text and ID in two columns – Allows users to sort and filter both separately
Text and ID in two columns – Allows users to sort and filter both separately
If displayed as a link, use only the text as the link, not the ID
If displayed as a link, use only the text as the link, not the ID
Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

Truncation

Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

Optimize column width for typical content, not all content
Optimize column width for typical content, not all content

Number of Links

Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

Emphasized links, links, subtle links, and text
Emphasized links, links, subtle links, and text

Missing Value

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

In terms of numbering items:

  • If the item number is more like an ID with regard to its description, use ID formatting as described above.
  • In all other cases, use a separate column for the item number.
Add a separate column for the item number
Add a separate column for the item number

Status

For status information, use semantic colors on the foreground elements.

For status information on text, use an object status.

Semantic colors on text
Semantic colors on text

Micro Charts

Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

Micro charts in a grid table
Micro charts in a grid table

Empty Tables

Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
Provide meaningful instructions
Provide meaningful instructions

Invalid State

To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

Grid table with invalid data
Grid table with invalid data

Item States

To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

In the default delivery, add a column directly behind the key identifier.

A modified item
A modified item

To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

A locked item
A locked item

To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

Item in draft state
Item in draft state

Show only one state at a time.

Numbers and Units

Show the unit of measurement in one of the following ways:

Number and Unit in Same Cell

The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

For amounts, use a currency control to display the concatenated string.

Number and unit of measurement in one cell
Number and unit of measurement in one cell

Number and Unit in Separate Columns

The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

Number and unit of measurement in two columns
Number and unit of measurement in two columns

Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

Drag and Drop

If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop targets in between items
Drop targets in between items

Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

Don't
Do not combine rearranging items with sorting
Do not combine rearranging items with sorting

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

Context Menu

Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Actions

Multiple Items

To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

Single Item

To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

To trigger navigation on line item level, choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
  • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Use the RowActions column only for one or both of the following actions:

  • Navigate to details page ( )
  • Delete ( )

The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

Navigate to details page
Navigate to details page

Single Cell

To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the table toolbar or at page level.
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Editable Content

For editable content, only use the following controls, and only one control per cell:

Only these controls are optimized for all viewing modes of the grid table.

If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

For mass editing items:

  • Provide multiselection.
  • Provide an Edit button.
  • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

For more information, see Mass Editing.

Interactive controls – In line
Interactive controls – In line

View Settings

There are several ways to show Sort and/or Filter settings:

  • Column header menu: In all cases, show the corresponding settings in the column header menu.
  • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
  • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
  • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

Trigger the dialogs in one of the following ways:

  • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
  • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

Use only the view settings you really need.

Column header menu with view settings
Column header menu with view settings
Table toolbar with triggers for view settings dialog
Table toolbar with triggers for view settings dialog
Table toolbar with trigger for table personalization dialog
Table toolbar with trigger for table personalization dialog

Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

Column, sorted ascending
Column, sorted ascending
Column, sorted descending
Column, sorted descending

The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

Column, filtered
Column, filtered

Personalization

Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

Add, Remove, and Rearrange Columns

To add, remove, or rearrange columns, use one of the following:

  • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
  • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

Resize Columns

Resizing columns works differently on touch and non-touch devices.

  • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
  • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

Freeze Columns

To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

Frozen column
Frozen column

Highlight Items

To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.Table, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Tables in Object Pages

In the object page, you can use a responsive table or grid table and offer navigation to a list report with the table types mentioned above. In the object page, we advise using the analytical and tree tables  in tab mode.

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Paste

The browser paste function can be used to paste data from the clipboard to the table if the focus is on an editable control within the table. The browser paste is triggered with the Ctrl + V keyboard shortcut, the table toolbar action, or actions in either the browser context menu or the table generic context menu.

The pasting of a new row or cell follows the grid table inline creation paradigm, where new items are created at the bottom of the table. The same happens when the data is pasted and a cell is unselected or focused.

Note

Pasting via the browser context menu is unavailable if the table has its own context menu because table context menu takes precedence over the browser context menu.

Paste (Overwrite)

Pasting overwrites data present in the table only when a cell with data is selected prior to pasting. When a single cell is selected, all the data in the clipboard is pasted into the table, extending from that cell. The paste will overwrite the data contained in those additional cells, too.

Note

If a user has selected multiple cells to overwrite, but the focus is placed outside of the selection, pasting will follow the guidelines for inline creation as above. This can happen, for example, when the user uses the arrow keys on the keyboard to move the focus.

Clipboard Selection Behaviour

If the clipboard has larger data set than the range selected for the paste, only the cells contained within the selection are updated.

On the other hand, if the clipboard has a dataset too small to fill all the cells selected for the paste, the pasted data updates only the selected cells for which there is data.

Read-Only

The paste action does not update read-only cells, even if there is data in the clipboard corresponding to those cells, but does update surrounding write cells.

Example

If the clipboard contains a range of four columns, and that data is pasted into a table, where column 2 is read-only, only the cells in column 1, 3, and 4 are updated.

Properties

sap.ui.table.Table

The following additional properties are available for the grid table:

  • The property: width defines the width of the grid table.
  • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
  • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
  • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
  • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
  • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
  • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
  • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
  • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
  • The property: editable does not have a visible effect. Do not use it.
  • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
  • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
  • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
  • The property: footer adds a short text at the bottom of the table.
  • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: Tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.ui.table.Column

The following additional properties are available for the column:

  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
  • The property: Tooltip does not have an effect. Do not use it.

 

sap.ui.table.Column

The following additional properties are available for the column:

  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
  • The property: Tooltip does not have an effect. Do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Tree Table

A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

Usage

Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Responsiveness

A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. For smartphones, you need to take an adaptive approach by offering an additional UI.

Possible solutions are as follows:

  • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
  • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
  • Use filtering instead of a tree structure.

You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

Tree table shown on a desktop
Tree table shown on a desktop
Tree table shown on a tablet
Tree table shown on a tablet

Types

Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

For more information on cozy and compact modes, see content density.

Compact Mode

Tree table – Compact mode
Tree table – Compact mode

Condensed Mode

Tree table – Condensed mode
Tree table – Condensed mode

Components

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Resizing columns works in the following ways:

  • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
  • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

After resizing a column, the adaptation of the column widths depends on how the column width is set:

  • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
    If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
  • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

Tree table – Column header
Tree table – Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Fewer columns than space available
Fewer columns than space available

Line Item

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

Tree table – Line item
Tree table – Line item

In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

Tree Column

The first colum (tree column) provides the hierarchical structure.

Tree table – Tree column
Tree table – Tree column

Expand/Collapse Button

The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

Tree table – Collapse
Tree table – Collapse
Tree table – Expand
Tree table – Expand

Container Node

A container node is a line item that contains child elements.

Tree table – Container node
Tree table – Container node

Leaf Node

A leaf node is a line item that does not contain child elements.

Tree table – Leaf node
Tree table – Leaf node

Cell

Each cell provides one data point. It can contain one of the following controls to display the data point:

While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

Tree table – Cell
Tree table – Cell

Tree Cell

A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

Tree table – Tree cell
Tree table – Tree cell

Column Header Menu

For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
For all other columns, only the free text filter is available.

Tree table – Tree column header menu
Tree table – Tree column header menu

Selection Cells

For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

Tree table – Selection cells
Tree table – Selection cells

Select All

For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

Tree table – Select all
Tree table – Select all

Scrollbar

The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

The tree table is optimized to allow faster scrolling within the first 1000 items.

Tree table – Vertical scrollbar
Tree table – Vertical scrollbar

Behavior and Interaction

Selection

The tree provides the following possibilities:

No selection: Items cannot be selected. (property: selectionMode = None)

Tree table – No selection
Tree table – No selection

Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

Tree table – Single selection
Tree table – Single selection

Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

For multiple selection, you can choose between two variants.

  • Multi-toggle mode (property: selectionMode = MultiToggle)
  • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

These variants behave differently when the user selects more items than are currently loaded in the front end.

Multi-toggle

In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

Multi-selection plug-in

If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

  • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
  • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
    • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
    • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
  • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

Tree table – Multiple selection
Tree table – Multiple selection
Multi-selection plug-in with a limit
Multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop

Column Header Menu

Sort

The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

Tree table – Filter
Tree table – Filter

Freeze Columns

The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

Tree table – Freeze
Tree table – Freeze

Column Handling

Show/Hide Columns

Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

Rearrange Columns

The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

Resize Columns

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
  • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Tree table with context menu
Tree table with context menu

Cell Content

The tree is traditional in that each cell can contain only one data point in one single line.

Apart from plain read-only text, cells can contain the following:

While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

Guidelines

Filtering

What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

  • Remove all leaves that don’t fit the filter criteria
  • Remove empty nodes

Where nodes need to be filtered, keep the following in mind:

  • A node may or may not fit the filter criteria.
  • A node can contain items (nodes and/or leaves) that fit the filter criteria.

Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

Developer Hint
The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

Sorting

First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

Loading Data

To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

Initital Display

Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

Errors and Warnings

To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
  • For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
  • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Empty Table

Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

Remove the item count in the table title if there are zero items.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

Show new items as the first item of the tree table or node:

  • If nothing is selected, add the new item to the root.
  • If a single node is selected, add the new item to the selected node.
  • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

Disable Create or Add if more than one item is selected.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the tree toolbar or at page level.
    • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Columns

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

Alignment of Cell Content

Align column headers according to their cell content:

  • Texts are left-aligned.
  • Numbers (except for IDs), dates, and times are right-aligned.
  • Icons are centered.
  • Micro charts are left-aligned.

In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

  • The Tunisian dinar has three digits.
  • The Japanese yen has no digits.

In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

For more information, see currency.

Formatting Cell Content

  • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
  • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
    • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
    • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
  • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
  • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

Tree vs. Table

Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

Do
Example of an acceptable use of tree tables
Example of an acceptable use of tree tables
Do
A clear parent-child relationship
A clear parent-child relationship

When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

Don't
Avoid unnecessary depth in the hierarchy
Avoid unnecessary depth in the hierarchy
Do
Favor breadth over depth in the hierarchy
Favor breadth over depth in the hierarchy

You can use the following methods to reduce hierarchy levels:

  • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
  • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
  • Container nodes at the top level can usually be replaced by tabs or value pickers.
  • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
  • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

Design Concepts

The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

  • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
  • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Navigation

To trigger navigation on line item level, choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
  • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
    Do not use the RowActions column for actions other than navigation and deletion.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Examples of Incorrect and Correct Usage

When you use trees:

  • Choose breadth over depth.
  • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
  • Try to minimize the number of columns, especially if there is a large number of rows.
  • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
  • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
Don't
Avoid truncating the initial visible content in the default delivery
Avoid truncating the initial visible content in the default delivery
Don't
Never wrap texts
Never wrap texts
  • Maintain a fixed layout, except when the user wants to change it.
  • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
  • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
Do
Acceptable: repeat entries to optimize finding items
Acceptable: repeat entries to optimize finding items
  • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
  • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
  • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

Empty Tree Tables

Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

Examples:

  • If a tree table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the tree table with data.
  • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    No filters set. To start, enter your search and filter settings and run the search.
  • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
    No items found. Check the search and filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
  • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).

Highlight Items

To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within a tree table, use the following options:

  • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
  • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
  • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop target on an item
Drop target on an item

Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

Moving items from one node to another can be combined with sorting without any issues.

Don't
Do not combine rearranging items on the same level with sorting
Do not combine rearranging items on the same level with sorting

Visible Alternatives to Drag and Drop

Depending on the functionality you need, use one or more of the following alternatives:

  • To move items up or down within a node:
    Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
    Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
    Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
    Do not combine the option to move items up and down with sorting.
  • To move items to another node:
    Use Copy and Paste buttons on the toolbar.
    Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
  • To change the level of an item:
    In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Tables in Object Pages

In the object page, you can use a  responsive table or grid table and offer navigation to a list report with the previously mentioned table types. We advise you to use the analytical and tree tables in tab mode.

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Smart Table

Intro

The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

When to Use

Use the smart table if:

  • You use an OData service for your app (OData version 2 only).
  • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
  • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

Do not use the smart table if:

  • You use a different technology to OData version 2. Use the corresponding table control directly.
  • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
  • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
  • You have very complex data. Did you check the chart?
  • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
  • You need to layout different controls in a table-like grid. Use a flexible grid instead.
  • You need to layout different input fields with labels. Use a form, simple form, or smart form.

Components

The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

The components of a smart table
The components of a smart table

Table Toolbar

Toolbar with all features provided by the smart table out-of-the-box
Toolbar with all features provided by the smart table out-of-the-box

The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

  1. Title
  2. Item counter
  3. Variant management
  4. Show Details / Hide Details
  5. View Settings
  6. Export to Spreadsheet
  7. Maximize / Minimize

In addition, you can add app-specific actions.

Title

Displaying a title is optional (property: header).

Guidelines

  • Add a title whenever the title is not indicated in the surrounding area.
  • If you don’t display a title, ensure that you still provide a table title for screen reader users.

Developer Hint
If there is no title title, support screen reader users as follows: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

Item Counter

The item counter is optional and only available if you show a title (property: showRowCount).

Guidelines
Show the item counter together with the table title, unless:

Variant Management

Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

Guidelines
Use variant management only if really needed.

Show Details / Hide Details

The Show Details / Hide Details button is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, enableAutoColumnWidth, showDetailsButton, annotation: UI.Importance).

You can define which priority levels cause the columns to be hidden (property: detailsButtonSettings). The button only appears if there are columns that belong in the pop-in area. Columns disappear from right to left but columns with the priority “High”, are never hidden. They are shown in the pop-in area if they do not fit on the current screen size

Details hidden
Details hidden
Details shown
Details shown

View Settings

View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

Guidelines
Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

Sort and Filter

Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

  • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
  • The current filter state is displayed as follows:
    • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
    • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

Guidelines

  • Do not turn off the info bar (property: useInfoBar).
  • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
    PresentationVariant).
  • If the smart table is used together with a filter bar (property:
    smartFilterId), do not offer filtering for the smart table itself.

Developer Hint
The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

Group

Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

The following text is usually shown on the group header:
[Label of the grouped column]: [Grouping value]

Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

Guidelines
In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

Column Settings

Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

Guidelines
If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
Developer Hint
Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

Export to Spreadsheet

Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

Guidelines

  • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
    • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
    • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
  • If you offer the Export to Spreadsheet button, use the front-end export.
  • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

Warning
With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

Apply the following size restrictions as a rule-of-thumb:

  • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
  • For the back-end export, do not export more than 100,000 table cells.

For larger tables, consider using custom-built, specialized export solutions instead.

Maximize / Minimize

Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

Guidelines

App-Specific Actions

App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

Developer Hint

Infobar

Infobar with filter information
Infobar with filter information

The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

Guidelines

Table

Responsive table within a smart table
Responsive table within a smart table

The table is generated automatically. The sections below describe the behavior and different possibilities:

Table

The table provides the following features:

Guidelines

  • The analytical table, tree table and grid table are not fully responsive. They are available only for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
    • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
    • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

Developer Hint
To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
Developer Hint

  • The property tableBindingPath defines the path from which the data is fetched.
  • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

Developer Hint
To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

Column Visibility

  • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
Developer Hint
If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

Use this option if:

  • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
  • The values of a column are needed to perform calculations, but only the results are shown on the UI.

You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

Developer Hint
Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
  • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
Guidelines

  • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
  • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

  • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
    For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
Developer Hint
If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

Column Layout

  • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
    The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
    If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
Guidelines
Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
Developer Hint
For the responsive table, enableAutoColumnWidth also applies the following changes:

  • The smart table property demandPopin is set to true.
  • The responsive table property fixedLayout is set to Strict.
  • The responsive table property contextualWidth is set to Auto.
  • Column resizing is enabled for all columns (including custom columns).
  • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

In this case, the properties above must not be managed by the app.

Responsive table with automatically calculated column widths, resizing, and remaining space
Responsive table with automatically calculated column widths, resizing, and remaining space
  • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
    You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
Developer Hint
To add or override columns (“custom columns”):

  • Use an XML view to define the underlying table with just the columns to be added/overridden.
  • To override columns, provide the column key of the column you want to exchange.
  • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

Column Headers

  • You can specify a column header text for each column (annotation: sap:label).
  • SAP S/4HANA Only:
    Tooltips are available by default for smart table column headers.
    In smart tables, texts that exceed the column width always truncate (see Column Layout). The tooltip allows users to read the full column header text without resizing.
Guidelines
Provide a column header text for each column. (annotation: sap:label).
  • The column headers contain the following settings:
    • Sort AscendingSort Descending
    • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
    • Group (only analytical table, only on dimension columns)
    • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
      If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
    • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
Guidelines
Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
Developer Hint
To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
Column header menu for a dimension column of an analytical table within a smart table
Column header menu for a dimension column of an analytical table within a smart table
Column header menu for a measure column of an analytical table within a smart table
Column header menu for a measure column of an analytical table within a smart table

Content

The smart table offers the following options for creating columns automatically:

  1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
  2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
    • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
    • Use of value help for input fields
Developer Hint
From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

  • For read-only tables, use the controls provided by the smart table.
  • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
  • For more complex editing cases, use smart fields.
  • For switching between read-only and edit modes:
    • In read-only mode, use the controls provided by the smart table.
    • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

In cases where the controls are rendered by the smart table, the following controls are used:

Read-only Edit Annotations / Edm type Comment
Static text Text Input field Edm.String
Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
Status information Object status or Icon Input field Criticality, CriticalityType,
CriticalityRepresentationType
Do not use editable status information.
Key identifier Object identifier (responsive table)
Text
(all other tables)
Input field for the ID SemanticKey,
Common.EditableFieldFor
Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
Times Text Time picker Edm.Time
Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
Email Link Input field IsEmailAddress Opens the system application for writing emails.
Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

Guidelines
For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

Behavior and Interaction

The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

Empty Tables

If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

  • If a table is initially empty:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
    (property: initialNoDataText, value: $NO_FILTERBAR)
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
    (property: initialNoDataText, value: $FILTERBAR)
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.
    (aggregation: noData, changeable at runtime)
  • If the user has hidden all of the columns in the personalization settings, the following text is shown:
    Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
    This text cannot be changed.
Guidelines

  • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
  • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
  • Avoid displaying a table without any items, especially when the app is initially loaded.

An empty smart table
An empty smart table

Errors and Warnings

To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

For details on displaying errors, warnings, and other messages, see Message Handling.

Table containing warnings
Table containing warnings
Table containing errors and warnings
Table containing errors and warnings
Guidelines
To show that an item contains an error,

Developer Hint
Binding-related messages are shown automatically.

Responsiveness

The smart table acts exactly like the embedded controls. For details see:

  • Toolbar Overview
  • Infobar
  • Responsive Table via auto pop-in mode
    (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
    You can use the UI.Importance annotation to influence the priority of each column.
    You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
  • Grid Table, Tree Table, Analytical Table are not fully responsive. They are available only for desktops and tablets. For smartphones, you need to take an adaptive approach by offering an additional UI.
Guidelines
If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

  • The column that identifies the line item.
  • The column that contains the key attribute.

Developer Hint

  • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
  • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

Examples

Responsive table within a smart table
Responsive table within a smart table
Grid table within a smart table
Grid table within a smart table

Top Tips

  • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
  • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
  • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
  • If the page has a filter bar, don’t offer filtering for the table.
  • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

Properties

The following properties are available for sap.ui.comp.smarttable.SmartTable:

  • The property: toolbarStyleClass is deprecated. Do not use it.
  • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

Related Links

Elements and Controls

Implementation

Analytical Table (ALV)

An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

Usage

Use the analytical table (ALV) if:

  • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

Do not use the analytical table (ALV) if:

  • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
    • You need to provide a total sum for one column. You can also add totals to the responsive table.
    • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices.
  • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
  • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
  • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
  • You need an overview of a large amount of data. In this case, use charts.
  • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
  • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

Responsiveness

The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. If you use an analytical table, you need to take an adaptive approach by offering an additional UI for smartphones.

You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

Analytical table (ALV) shown on a desktop
Analytical table (ALV) shown on a desktop
Analytical table (ALV) shown on a tablet
Analytical table (ALV) shown on a tablet

Components

An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

Behavior and Interaction

An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

Table Level

Scroll

An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

You can add any number of line items to the analytical table, which is known as “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

The analytical table is optimized to allow faster scrolling within the first 1000 items.

Scroll bar
Scroll bar

Select

Selection for an analytical table depends on the chosen selection mode. The following options are available:

No selection: Items cannot be selected. (property: selectionMode = None)

Analytical table without item selection
Analytical table without item selection

Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

Analytical table with single selection
Analytical table with single selection
  • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

Analytical table with multiple selection
Analytical table with multiple selection
Using the multi-selection plug-in with a limit
Using the multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

Compact, Cozy, and Condensed

Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

For more information on cozy and compact modes, see content density.

 

 

 

 

Analytical table in compact mode
Analytical table in compact mode
Analytical table in condensed mode - More items on the same screen real estate
Analytical table in condensed mode - More items on the same screen real estate

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
  • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

  • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
    If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
  • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

Column header
Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Columns do not use up the available space
Columns do not use up the available space

Column Header Menu

For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

  • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
  • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
  • Group
  • Totals
  • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

For each column, the menu can be replaced by an app-specific menu.

Column header menu
Column header menu

Sort

The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

Note that the filter may return zero results, in which case, the table might be empty.

General recommendations for filtering:

  • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
  • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
Free text filter in column header menu
Free text filter in column header menu

Group

The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

One group collects all items with the same value within the corresponding column.

Group setting in column header menu
Group setting in column header menu

If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

Group headers and the corresponding columns are shown – The relevant data is duplicated
Group headers and the corresponding columns are shown – The relevant data is duplicated
Group headers shown, the corresponding column hidden – No duplicates
Group headers shown, the corresponding column hidden – No duplicates

Aggregation

The column header menu can provide the option to show or hide aggregation totals for this column.

Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

The overall aggregation is shown in a row at the bottom of the analytical table when the column contains values for a single unit of measure.

Overall aggregation for a single unit of measure
Overall aggregation for a single unit of measure

When the column contains values for more than one unit of measure, a Show Details link is displayed in a row at the bottom of the table, for example, when the column contains multiple currencies.

The Show Details link opens a popover that lists the totals for each unit of measure.

Overall aggregation for multiple units of measure via the 'Show Details' link
Overall aggregation for multiple units of measure via the 'Show Details' link

Freeze Columns

The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

Freeze setting in column header menu
Freeze setting in column header menu

Line Item Level

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height.

(sap.ui.table.AnalyticalTable, property: rowHeight)

Line item
Line item

Drag and Drop

One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Cell Level

A cell provides one data point.

It can contain one of the following controls to display this data point:

While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

Cell
Cell

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Analytical table with context menu
Analytical table with context menu

Guidelines

Data Density vs. Complexity

The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Try to minimize the number of columns, especially if there is a large number of rows.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area.

Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534).

The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

Remove the item count in the table title if there are zero items.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

Selection

Single Selection

For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

Multiple Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
  • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
Don't
Do not add checkboxes to the first column
Do not add checkboxes to the first column
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Loading Data

To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors and warnings
Table containing errors and warnings

Columns – Best Practices

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

Maintain a constant column width and avoid adjusting it automatically when the content changes.

Always keep to one line of text. Do not wrap.

Don't
Don't truncate the initial visible content In the default delivery
Don't truncate the initial visible content In the default delivery
Don't
Never wrap texts
Never wrap texts

Column Headers – Best Practices

For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

Content Alignment

For alignment of cell content, follow the guidelines below.

Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-alignment of text
Left-alignment of text

Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

Right-alignment of numbers
Right-alignment of numbers

Right-align amounts with currencies to the cell and align their respective decimal points.

This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

For aligning to the decimal point, use the sap.ui.uinified.Currency control.

Alignment to the decimal point
Alignment to the decimal point

Right-align dates and times.

This ensures comparability for most formats and locales.

Right-alignment of dates
Right-alignment of dates

Left-align status information.

Left-align status information
Left-align status information

Center-align icons.

Left-align micro charts.

XS micro charts in condensed mode
XS micro charts in condensed mode

Content Formatting

Key Identifier

Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

Emphasized link
Emphasized link

For strings with IDs, use one of the following:

  • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
  • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
Text and ID in two columns – Allows sorting, filtering, and grouping for both
Text and ID in two columns – Allows sorting, filtering, and grouping for both
If displayed as a link, use only the string as the link, not the ID
If displayed as a link, use only the string as the link, not the ID
Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
If displayed as a link, use the whole text as the link
If displayed as a link, use the whole text as the link

Truncation

Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

Optimize column width for typical content, not all content
Optimize column width for typical content, not all content

Number of Links

Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

Emphasized links, links, subtle links, and text
Emphasized links, links, subtle links, and text

Missing Value

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

In terms of numbering items:

  • If the item number is more like an ID with regard to its description, use ID formatting as described above.
  • In all other cases, use a separate column for the item number.
Add a separate column for the item number
Add a separate column for the item number

Status

For status information, use semantic colors on the foreground elements.

For status information on text, use an object status.

Semantic colors on text
Semantic colors on text

Micro Charts

Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

Micro charts in an analytical table
Micro charts in an analytical table

Empty Tables

Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
Provide meaningful instructions
Provide meaningful instructions

Invalid State

To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

Analytical table with invalid data
Analytical table with invalid data

Item States

To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

In the default delivery, add a column directly behind the key identifier.

A modified item
A modified item

To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

A locked item
A locked item

To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

Item in draft state
Item in draft state

Show only one state at a time.

Numbers and Units

Show the unit of measurement in one of the following ways:

The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

For amounts, use a currency control to display the concatenated string.

Number and unit of measurement in one cell
Number and unit of measurement in one cell

The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

Number and unit of measurement in two columns
Number and unit of measurement in two columns

If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

Example:
A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

Don't
Do not use drag and drop for rearranging items in the analytical table
Do not use drag and drop for rearranging items in the analytical table

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Actions

Multiple Items

To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

Single Item

To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

Single Cell

To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

To trigger navigation on line item level choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
  • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Use the RowActions column only for one or both of the following actions:

  • Navigate to details page ( )
  • Delete ( )

The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

Navigate to details page
Navigate to details page

Single Cell

For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

Add Items

To let users add items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
  3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
    • Inline creation: After Save is triggered on the table toolbar or at page level.
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

If draft handling is used, new items are not saved at table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Editable Content

For editable content, only use the following controls, and only one control per cell:

Only these controls are optimized for all viewing modes of the analytical table.

If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

For mass editing items:

  • Provide multiselection.
  • Provide an Edit button.
  • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

This is similar to mass editing in the split-screen layout floorplan.

Warning
Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
Interactive controls – Inline
Interactive controls – Inline

View Settings

There are several ways to show Sort, Filter, and/or Group settings:

  • Column header menu: In all cases, show the corresponding settings in the column header menu.
  • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
  • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
  • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

Trigger the dialogs in one of the following ways:

  • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
  • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

 

Column header menu with view settings
Column header menu with view settings
Table toolbar with triggers for view settings dialog
Table toolbar with triggers for view settings dialog
Table toolbar with trigger for table personalization dialog
Table toolbar with trigger for table personalization dialog

Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

Column, sorted ascending
Column, sorted ascending
Column, sorted descending
Column, sorted descending

The descending sort order must always be the exact reverse of the ascending sort order.

For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

Column, filtered
Column, filtered

Group

To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

[Label of the grouped column]: [Grouping value]

If there is no grouping value, show the following text:
[Label of the grouped column]: (Not Available)

This is the case if you have a group of items that don’t have a value for the grouped column.

 

Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

Group headers, several levels
Group headers, several levels

On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

The group header menu provides several options:

  • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
  • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
  • Ungroup All: The columns are shown again.
  • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
  • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
  • Collapse Level: Collapses all groups on the corresponding grouping level.
  • Collapse All: All groups are collapsed.
Group header menu
Group header menu
Group header on touch devices
Group header on touch devices

In general:

  • Offer grouping on objects and attributes.
  • Do not offer grouping on measures.
  • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
  • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

Aggregate

To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

If items are grouped, an intermediate sum is shown:

  • At the bottom of each group if the group is expanded.
  • In the group header if the group is collapsed.

(sap.ui.table.AnalyticalColumn, property: summed)

When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

For example:
Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

Warning
Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
Developer Hint
To allow sorting by totals, the following conditions must be met:

  1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
  2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

In general:

  • Offer aggregation on measures, but not on objects or attributes.
  • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
  • Where appropriate, offer reasonable aggregation by default.
Aggregation and groups
Aggregation and groups

Personalization

Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

Add, Remove, and Rearrange Columns

To add, remove, or rearrange columns, use one of the following:

  • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
  • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

Resize Columns

Resizing columns works differently on touch and non-touch devices.

  • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
  • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

Freeze Columns

For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

Frozen column
Frozen column

Highlight Items

To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Tables in Object Pages

In the object page, you can use a responsive table or grid table and offer navigation to a list report with the previously mentioned tables. We advise using analytical and tree tables in tab mode.

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Properties

sap.ui.table.AnalyticalTable

The following additional properties are available for the analytical table:

  • The property: width defines the width of the analytical table.
  • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
  • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
  • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
  • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
  • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
  • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
  • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
  • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
  • The property: editable does not have a visible effect. Please do not use it.
  • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
  • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
  • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
  • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
  • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
  • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
  • The property: footer adds a short text at the bottom of the table.
  • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: Tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.ui.table.AnalyticalColumn

The following additional properties are available for the analytical column:

  • The property: leadingProperty is used for data binding.
  • The property: inResult is used for data binding.
  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
  • The property: Tooltip does not have an effect. Please do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Tree

Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the main list for a list-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

Usage

Use the tree if:

  • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
  • Selecting one or more items out of a set of hierarchically structured items is a main use case.
  • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
  • You want to have only one implementation for all devices.

Do not use the tree if:

  • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
  • Items are not structured hierarchically. Use a list instead.
  • The hierarchy turns out to have only two levels. In this case, use a grouped list.
  • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need an overview of a large amount of data. In this case, use a chart.

Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

Responsiveness

The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

Tree displaying 2 levels
Tree displaying 2 levels
Tree displaying 3 levels
Tree displaying 3 levels
Tree displaying 4 levels
Tree displaying 4 levels

Layout

The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
The collection of hierarchical items occupies the main part of the tree.

Schematic visualization of the tree
Schematic visualization of the tree

Components

The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

The standard tree item consists of:

  • A highlight indicator (optional)
  • An expand/collapse button for nodes
  • A selector in form of a checkbox or a radio button (optional)
  • An icon (optional)
  • text
  • A counter (optional)
  • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

Standard tree item
Standard tree item

Behavior and Interaction (incl. Gestures)

Tree Level

Scrolling

The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

Same tree, with different expand state
Same tree, with different expand state

When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

Information
The “sticky” feature comes with some limitations:

  • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
  • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
  • If focus is set to a sticky area, the tree is automatically scrolled to top.

Sticky title
Sticky title

Selection Modes

A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

None: Items cannot be selected (sap.m.ListMode.None).
Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

Tree without selectable items
Tree without selectable items

Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

Single selection: Only one item is selected.
Single selection: Only one item is selected.

Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).

Developer Hint
In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

Also note that Ctrl+A only (de)selects items within expanded nodes.

To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

Guidelines

  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
  • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
  • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
  • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

Multiple selection
Multiple selection

Deleting

To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

Tree in 'delete' mode
Tree in 'delete' mode

Line Item Level

Expandable and Collapsible Nodes

An Expand/Collapse button is provided automatically for each node.

Expand/collapse button
Expand/collapse button

Highlight an Item

To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

Highlighted item
Highlighted item

Navigating

To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
If no navigation is possible, set type to “inactive”.
Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

Tree items with navigation indicator
Tree items with navigation indicator
Navigation indicators can be set per item
Navigation indicators can be set per item

Indicate Navigated Item

When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

Navigated item
Navigated item

Editing Items

To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

Edit button
Edit button

Clicking an Item

Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
“Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with the “single select master” mode.

Active items
Active items

Context Menu

You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

The context menu can be triggered for the tree or per item.

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Tree - Context menu
Tree - Context menu

Drag and Drop

One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Guidelines

Tree vs. List

Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

Example of an acceptable use of trees
Example of an acceptable use of trees
Do
A clear parent-child relationship
A clear parent-child relationship

Broad vs. Deep Hierarchies

When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

Don't
Avoid unnecessary depth in the hierarchy
Avoid unnecessary depth in the hierarchy
Do
Favor breadth over depth in a hierarchy
Favor breadth over depth in a hierarchy

You can use the following methods to reduce hierarchy levels:

  • Avoid a single root node. It is usually not needed.
  • Container nodes at the top level can usually be replaced by tabs or value pickers.
  • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
  • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
Acceptable: repeat entries to optimize finding items
Acceptable: repeat entries to optimize finding items

Design Concepts

The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

  • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
  • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
  • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Design for Performance

To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

Warning
The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

The actual limits depend on your concrete scenario, including:

  • The number of rows in the table
  • The number of displayed columns
  • The complexity of the cell content (for example, simple text vs. complex charts)
  • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
  • The browser being used

Title

Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

Do not use a title if it simply repeats text that is already above the tree. For example:

  • Beverages tree is the only control on a tab labeled Beverages.
  • A section or subsection on an object page contains only one tree.

Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

If you use a title, be sure to include the following:

  • A title text for the tree.
  • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

Remove the item count in the title if there are zero items.

If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

Title
Title
Title with item count
Title with item count

Loading Data

To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Tree in busy state while loading data
Tree in busy state while loading data

Initial Display

Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

Errors and Warnings

To indicate that the tree contains items with errors or warnings, show a message strip above the tree. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Tree containing errors
Tree containing errors

Content

Content Formatting

To display object names with an ID, show the ID in parentheses after the corresponding object name.

Place the ID in brackets after the corresponding object name
Place the ID in brackets after the corresponding object name

Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

 

Examples:

  • If a tree is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the tree with data.
  • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    No filters set. To start, enter your search and filter settings and run the search.
  • If a tree is used together with a filter bar and the filter does not return results, use the following text:
    No items found. Check the search and filter settings.

Adapt the texts above if:

  • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
  • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
Provide meaningful instructions within an empty tree
Provide meaningful instructions within an empty tree

Highlighting Items

To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors.

(sap.m.ListItemBase, property: highlight)

Highlighted items
Highlighted items

Item States

To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

A modified item
A modified item

To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, add the string (Locked by [name]) to the text of the item.

A locked item
A locked item

To show that an item is in a draft state, add the string (Draft) to the text of the item.

Item in draft state
Item in draft state

Show only one state at any one time.

Actions

To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
The following actions on single items must always be in-line:

Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

Items with 'Delete' button
Items with 'Delete' button

Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

Items with navigation indicator
Items with navigation indicator

Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

Edit button
Edit button

From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

Add Items

For adding items, place an Add or Create text button on the tree toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

Show new items as the first item of the tree or node:

  • If nothing is selected, add the new item to the root.
  • If a single node is selected, add the new item to the selected node.
  • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

Disable Create or Add if more than one item is selected.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable item as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios where just a few input fields have to be filled.
  2. Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the tree.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the tree toolbar or at page level.
    • Create with dialog: A tree showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of draft handling, new items are not saved at tree level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Editing Items

To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

For mass editing:

  • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
  • Provide an Edit button on the toolbar above the tree.
  • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

For more details, see mass editing.

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

Drag and Drop

Warning
To comply with the new WCAG 2.2 standard, the control must offer an alternative to the drag and drop feature. See the visible alternatives described below.

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within a tree, use the following options:

  • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
  • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
  • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

Moving items from one node to another can be combined with sorting without any issues.

Drop targets in between items
Drop targets in between items

Visible Alternatives to Drag and Drop

Depending on the functionality you need, use one or more of the following alternatives:

  • To move items up or down within a node:
    Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
    Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
    Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
    Do not combine the option to move items up and down with sorting.
  • To move items to another node:
    Use Copy and Paste buttons on the toolbar.
    Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
  • To change the level of an item:
    In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

Filtering

What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

  • Remove all leaves that don’t fit the filter criteria
  • Remove empty nodes

If you also apply filters to nodes, keep the following in mind:

  • A node may or may not fit the filter criteria.
  • A node can contain items (nodes and/or leaves) that fit the filter criteria.

Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

Information
The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

Sorting

Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

Always sort the tree in a meaningful way when it first loads.

The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

List

In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in list-detail scenarios using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

Usage

Use the list if:

  • You want to display a homogeneous set of basic data.
  • You need to sort, group, or filter simple datasets.
  • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

Do not use the list if:

  • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
  • You work with complex hierarchies. In this case, use a tree.

Responsiveness

The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

All list item variants available in SAP Fiori already adapt to the respective screen size.

List Item Variants

The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

Object List Item

The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

All essential information about an object is usually provided when the user navigates to the item details.

For more information, see object list item.

Object list items
Object list items

Standard List Item

The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

For more information, see standard list item.

Standard list items
Standard list items

Display List Item

The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

For more information, see display list item.

Display list items
Display list items

Action List Item

The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

For more information, see action list item.

Action list item
Action list item

Feed List Item

The feed list item is mainly used in feeds and notes.

For more information, see feed list item.

Feed with feed list items
Feed with feed list items

Input List Item

The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

For more information, see input list item.

Input list item
Input list item

Components

The list control comes with the following main properties:

Header

The header text contains the title of the list. It is usually only used when the list is in the content area.

Footer

The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

Lazy Loading

Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

List with header and footer
List with header and footer

Empty List

Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

Examples:

  • If a list is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the list with data.
  • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    No filters set. To start, enter your search and filter settings and run the search.
  • If a list is used together with a filter bar and the filter does not return results, use the following text:
    No items found. Check the search and filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
  • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
Empty list
Empty list

Count

List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

Standard list items with counter
Standard list items with counter

Read/Unread

You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

By default, this indicator is switched off, and all list items are displayed in normal font.

Display list item with read and unread items
Display list item with read and unread items

Highlight Items

To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.m.ListItemBase, property: highlight)

Highlighted items using status colors
Highlighted items using status colors
Highlighted items using indication colors
Highlighted items using indication colors

Behavior and Interaction

There are several ways to interact with the list and its list items:

List Level

Scroll

The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

Information
The “sticky” feature comes with some limitations:

  • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
  • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
  • If the focus is set to a sticky area, the list is automatically scrolled to top.

Sticky title
Sticky title

Mode

The list can have several modes. The respective property (Mode) allows the following selection methods:

  • None
  • SingleSelectMaster (used to pick one item with no additional indicator, as in the list-detail scenario with the flexible column layout)
  • SingleSelectLeft (used to pick one item using a radio button on the far left)
  • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
  • Users can (de)select all items using CTRL+A. Select All (de)selects all items that the user can reach by scrolling.
  • Delete (used to delete items from the list using a delete indicator on the far right)
Guidelines

  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
  • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
  • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use this mode only if you really need two different click areas; a small one for a selection, and the rest of the item for something else.
  • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
  • If selecting / deselecting all items is important for your app, add a button with the text Select All to the toolbar. Change the button text to Deselect All if all items are selected.

Developer Hint
In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

List with explicit single selection
List with explicit single selection
List with multiple selection
List with multiple selection
List with delete mode
List with delete mode

Grouping

List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

Grouped list
Grouped list

Line Item Level

Type

The list item type defines the interaction of the list item, which is accompanied by a visual cue.

The items can be one of the following:

  • Active (click event; cursor changes to indicate that)
  • Inactive (no click event; cursor does not change)
  • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
  • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
  • Detail and active (same as “detail”, but the item itself is also clickable)

The example shows how all these types are visualized.

All list item types: inactive, detail, navigation, active, detail and active
All list item types: inactive, detail, navigation, active, detail and active

Indicate Navigated Item

When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

Navigated item
Navigated item

Swipe

You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

List with swipe action
List with swipe action

Context Menu

The context menu can be triggered for the list or per item.

It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

Context menus are opened by right-clicking (desktop), long press (mobile), the CONTEXT MENU KEY, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

List - context menu
List - context menu

Drag and Drop

One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Styles

The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

List without separators
List without separators

Guidelines

Text Length

When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

Design for Performance

To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

Warning
The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

The actual limits depend on your concrete scenario, including:

  • The number of rows in the table
  • The number of displayed columns
  • The complexity of the cell content (for example, simple text vs. complex charts)
  • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
  • The browser being used

Custom List Items

If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

When creating custom list items, take the following guidelines into account, as needed:

Radio Button

Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

Errors and Warnings

To indicate that the list contains items with errors or warnings, show a message strip above the list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
List containing errors
List containing errors

Actions

To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

The following actions on single items must always be inline:

  • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
  • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
  • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

Add Items

For adding items, place an Add or Create text button on the toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the list, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

There are three options for adding an item. In order of priority, these are:

  • Add the item inline. Create an empty, editable item as the first item of the list. Show the Save button on the toolbar of the list. This option is recommended for simple scenarios where just a few input fields have to be filled.
  • Open a dialog for items with up to 8 input fields. Save the new item at dialog level.
  • Navigate to a new page. Only use this behavior for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the list.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the list. Ignore current sort, filter and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the toolbar or at page level
    • Create with dialog: A list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of draft handling new items are not saved on list level, but rather with the entire draft.

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

Drag and Drop

Warning
To comply with the WCAG 2.2 accessibility standard, the control must offer an alternative to the drag and drop feature. Use the  Move Up and  Move Down buttons on the toolbar.

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose, provide the corresponding keyboard support, and are available for all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop targets in between items
Drop targets in between items

Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

 

Example:

A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

Don't
Do not combine rearranging items with grouping, unless you know exactly what you're doing
Do not combine rearranging items with grouping, unless you know exactly what you're doing

View Settings

  • Provide individual buttons for each of the following settings on the toolbar of the list: sort, filter, group.
  • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
  • When closed, apply the settings to the list accordingly.

Keep the following in mind:

  • Do not offer any of these features if the list is expected to have only a small number of entries (up to 20 in most cases).
  • If filtering is a main use case, do not offer filtering on the toolbar of the list. Use the filter bar instead.
  • Only use the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
  • Keep the view settings consistent. When a user reopens the app, show the list with the same sort, filter, and group settings as last defined by this user.

Sort

  • For the default sort setting, sort by the item title, which is usually the identifier of an item.
  • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
  • For each data point, provide a meaningful sort order. For example:
    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

Filter

  • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
  • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings located in the filter bar or in a select control placed in the toolbar of the list.
  • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
  • Keep the infobar sticky (sap.m.List, property: sticky).

Export to Spreadsheet

Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Analytical Table (ALV)

An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

Usage

Use the analytical table (ALV) if:

  • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

Do not use the analytical table (ALV) if:

  • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
    • You need to provide a total sum for one column. You can also add totals to the responsive table.
    • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices.
  • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
  • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
  • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
  • You need an overview of a large amount of data. In this case, use charts.
  • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
  • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

Responsiveness

The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. If you use an analytical table, you need to take an adaptive approach by offering an additional UI for smartphones.

You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

Analytical table (ALV) shown on a desktop
Analytical table (ALV) shown on a desktop
Analytical table (ALV) shown on a tablet
Analytical table (ALV) shown on a tablet

Components

An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

Behavior and Interaction

An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

Table Level

Scroll

An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

You can add any number of line items to the analytical table, which is known as “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

The analytical table is optimized to allow faster scrolling within the first 1000 items.

Scroll bar
Scroll bar

Select

Selection for an analytical table depends on the chosen selection mode. The following options are available:

No selection: Items cannot be selected. (property: selectionMode = None)

Analytical table without item selection
Analytical table without item selection

Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

Analytical table with single selection
Analytical table with single selection
  • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

Analytical table with multiple selection
Analytical table with multiple selection
Using the multi-selection plug-in with a limit
Using the multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

Compact, Cozy, and Condensed

Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

For more information on cozy and compact modes, see content density.

 

 

 

 

Analytical table in compact mode
Analytical table in compact mode
Analytical table in condensed mode - More items on the same screen real estate
Analytical table in condensed mode - More items on the same screen real estate

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
  • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

  • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
    If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
  • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

Column header
Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Columns do not use up the available space
Columns do not use up the available space

Column Header Menu

For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

  • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
  • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
  • Group
  • Totals
  • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

For each column, the menu can be replaced by an app-specific menu.

Column header menu
Column header menu

Sort

The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

Note that the filter may return zero results, in which case, the table might be empty.

General recommendations for filtering:

  • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
  • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
Free text filter in column header menu
Free text filter in column header menu

Group

The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

One group collects all items with the same value within the corresponding column.

Group setting in column header menu
Group setting in column header menu

If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

Group headers and the corresponding columns are shown – The relevant data is duplicated
Group headers and the corresponding columns are shown – The relevant data is duplicated
Group headers shown, the corresponding column hidden – No duplicates
Group headers shown, the corresponding column hidden – No duplicates

Aggregation

The column header menu can provide the option to show or hide aggregation totals for this column.

Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

The overall aggregation is shown in a row at the bottom of the analytical table when the column contains values for a single unit of measure.

Overall aggregation for a single unit of measure
Overall aggregation for a single unit of measure

When the column contains values for more than one unit of measure, a Show Details link is displayed in a row at the bottom of the table, for example, when the column contains multiple currencies.

The Show Details link opens a popover that lists the totals for each unit of measure.

Overall aggregation for multiple units of measure via the 'Show Details' link
Overall aggregation for multiple units of measure via the 'Show Details' link

Freeze Columns

The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

Freeze setting in column header menu
Freeze setting in column header menu

Line Item Level

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height.

(sap.ui.table.AnalyticalTable, property: rowHeight)

Line item
Line item

Drag and Drop

One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Cell Level

A cell provides one data point.

It can contain one of the following controls to display this data point:

While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

Cell
Cell

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Analytical table with context menu
Analytical table with context menu

Guidelines

Data Density vs. Complexity

The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Try to minimize the number of columns, especially if there is a large number of rows.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area.

Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534).

The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

Remove the item count in the table title if there are zero items.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

Selection

Single Selection

For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

Multiple Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
  • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
Don't
Do not add checkboxes to the first column
Do not add checkboxes to the first column
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Loading Data

To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors and warnings
Table containing errors and warnings

Columns – Best Practices

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

Maintain a constant column width and avoid adjusting it automatically when the content changes.

Always keep to one line of text. Do not wrap.

Don't
Don't truncate the initial visible content In the default delivery
Don't truncate the initial visible content In the default delivery
Don't
Never wrap texts
Never wrap texts

Column Headers – Best Practices

For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

Content Alignment

For alignment of cell content, follow the guidelines below.

Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-alignment of text
Left-alignment of text

Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

Right-alignment of numbers
Right-alignment of numbers

Right-align amounts with currencies to the cell and align their respective decimal points.

This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

For aligning to the decimal point, use the sap.ui.uinified.Currency control.

Alignment to the decimal point
Alignment to the decimal point

Right-align dates and times.

This ensures comparability for most formats and locales.

Right-alignment of dates
Right-alignment of dates

Left-align status information.

Left-align status information
Left-align status information

Center-align icons.

Left-align micro charts.

XS micro charts in condensed mode
XS micro charts in condensed mode

Content Formatting

Key Identifier

Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

Emphasized link
Emphasized link

For strings with IDs, use one of the following:

  • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
  • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
Text and ID in two columns – Allows sorting, filtering, and grouping for both
Text and ID in two columns – Allows sorting, filtering, and grouping for both
If displayed as a link, use only the string as the link, not the ID
If displayed as a link, use only the string as the link, not the ID
Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
If displayed as a link, use the whole text as the link
If displayed as a link, use the whole text as the link

Truncation

Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

Optimize column width for typical content, not all content
Optimize column width for typical content, not all content

Number of Links

Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

Emphasized links, links, subtle links, and text
Emphasized links, links, subtle links, and text

Missing Value

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

In terms of numbering items:

  • If the item number is more like an ID with regard to its description, use ID formatting as described above.
  • In all other cases, use a separate column for the item number.
Add a separate column for the item number
Add a separate column for the item number

Status

For status information, use semantic colors on the foreground elements.

For status information on text, use an object status.

Semantic colors on text
Semantic colors on text

Micro Charts

Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

Micro charts in an analytical table
Micro charts in an analytical table

Empty Tables

Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
Provide meaningful instructions
Provide meaningful instructions

Invalid State

To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

Analytical table with invalid data
Analytical table with invalid data

Item States

To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

In the default delivery, add a column directly behind the key identifier.

A modified item
A modified item

To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

A locked item
A locked item

To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

Item in draft state
Item in draft state

Show only one state at a time.

Numbers and Units

Show the unit of measurement in one of the following ways:

The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

For amounts, use a currency control to display the concatenated string.

Number and unit of measurement in one cell
Number and unit of measurement in one cell

The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

Number and unit of measurement in two columns
Number and unit of measurement in two columns

If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

Example:
A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

Don't
Do not use drag and drop for rearranging items in the analytical table
Do not use drag and drop for rearranging items in the analytical table

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Actions

Multiple Items

To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

Single Item

To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

Single Cell

To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

To trigger navigation on line item level choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
  • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Use the RowActions column only for one or both of the following actions:

  • Navigate to details page ( )
  • Delete ( )

The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

Navigate to details page
Navigate to details page

Single Cell

For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

Add Items

To let users add items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
  3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
    • Inline creation: After Save is triggered on the table toolbar or at page level.
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

If draft handling is used, new items are not saved at table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Editable Content

For editable content, only use the following controls, and only one control per cell:

Only these controls are optimized for all viewing modes of the analytical table.

If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

For mass editing items:

  • Provide multiselection.
  • Provide an Edit button.
  • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

This is similar to mass editing in the split-screen layout floorplan.

Warning
Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
Interactive controls – Inline
Interactive controls – Inline

View Settings

There are several ways to show Sort, Filter, and/or Group settings:

  • Column header menu: In all cases, show the corresponding settings in the column header menu.
  • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
  • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
  • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

Trigger the dialogs in one of the following ways:

  • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
  • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

 

Column header menu with view settings
Column header menu with view settings
Table toolbar with triggers for view settings dialog
Table toolbar with triggers for view settings dialog
Table toolbar with trigger for table personalization dialog
Table toolbar with trigger for table personalization dialog

Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

Column, sorted ascending
Column, sorted ascending
Column, sorted descending
Column, sorted descending

The descending sort order must always be the exact reverse of the ascending sort order.

For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

Column, filtered
Column, filtered

Group

To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

[Label of the grouped column]: [Grouping value]

If there is no grouping value, show the following text:
[Label of the grouped column]: (Not Available)

This is the case if you have a group of items that don’t have a value for the grouped column.

 

Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

Group headers, several levels
Group headers, several levels

On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

The group header menu provides several options:

  • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
  • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
  • Ungroup All: The columns are shown again.
  • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
  • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
  • Collapse Level: Collapses all groups on the corresponding grouping level.
  • Collapse All: All groups are collapsed.
Group header menu
Group header menu
Group header on touch devices
Group header on touch devices

In general:

  • Offer grouping on objects and attributes.
  • Do not offer grouping on measures.
  • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
  • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

Aggregate

To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

If items are grouped, an intermediate sum is shown:

  • At the bottom of each group if the group is expanded.
  • In the group header if the group is collapsed.

(sap.ui.table.AnalyticalColumn, property: summed)

When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

For example:
Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

Warning
Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
Developer Hint
To allow sorting by totals, the following conditions must be met:

  1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
  2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

In general:

  • Offer aggregation on measures, but not on objects or attributes.
  • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
  • Where appropriate, offer reasonable aggregation by default.
Aggregation and groups
Aggregation and groups

Personalization

Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

Add, Remove, and Rearrange Columns

To add, remove, or rearrange columns, use one of the following:

  • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
  • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

Resize Columns

Resizing columns works differently on touch and non-touch devices.

  • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
  • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

Freeze Columns

For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

Frozen column
Frozen column

Highlight Items

To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Tables in Object Pages

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Properties

sap.ui.table.AnalyticalTable

The following additional properties are available for the analytical table:

  • The property: width defines the width of the analytical table.
  • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
  • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
  • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
  • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
  • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
  • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
  • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
  • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
  • The property: editable does not have a visible effect. Please do not use it.
  • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
  • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
  • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
  • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
  • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
  • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
  • The property: footer adds a short text at the bottom of the table.
  • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: Tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.ui.table.AnalyticalColumn

The following additional properties are available for the analytical column:

  • The property: leadingProperty is used for data binding.
  • The property: inResult is used for data binding.
  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
  • The property: Tooltip does not have an effect. Please do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Smart Table

Intro

The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

When to Use

Use the smart table if:

  • You use an OData service for your app (OData version 2 only).
  • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
  • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

Do not use the smart table if:

  • You use a different technology to OData version 2. Use the corresponding table control directly.
  • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
  • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
  • You have very complex data. Did you check the chart?
  • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
  • You need to layout different controls in a table-like grid. Use a flexible grid instead.
  • You need to layout different input fields with labels. Use a form, simple form, or smart form.

Components

The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

The components of a smart table
The components of a smart table

Table Toolbar

Toolbar with all features provided by the smart table out-of-the-box
Toolbar with all features provided by the smart table out-of-the-box

The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

  1. Title
  2. Item counter
  3. Variant management
  4. Show Details / Hide Details
  5. View Settings
  6. Export to Spreadsheet
  7. Maximize / Minimize

In addition, you can add app-specific actions.

Title

Displaying a title is optional (property: header).

Guidelines

  • Add a title whenever the title is not indicated in the surrounding area.
  • If you don’t display a title, ensure that you still provide a table title for screen reader users.

Developer Hint
If there is no title title, support screen reader users as follows: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

Item Counter

The item counter is optional and only available if you show a title (property: showRowCount).

Guidelines
Show the item counter together with the table title, unless:

Variant Management

Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

Guidelines
Use variant management only if really needed.

Show Details / Hide Details

The Show Details / Hide Details button is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, enableAutoColumnWidth, showDetailsButton, annotation: UI.Importance).

You can define which priority levels cause the columns to be hidden (property: detailsButtonSettings). The button only appears if there are columns that belong in the pop-in area. Columns disappear from right to left but columns with the priority “High”, are never hidden. They are shown in the pop-in area if they do not fit on the current screen size

Details hidden
Details hidden
Details shown
Details shown

View Settings

View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

Guidelines
Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

Sort and Filter

Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

  • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
  • The current filter state is displayed as follows:
    • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
    • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

Guidelines

  • Do not turn off the info bar (property: useInfoBar).
  • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
    PresentationVariant).
  • If the smart table is used together with a filter bar (property:
    smartFilterId), do not offer filtering for the smart table itself.

Developer Hint
The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

Group

Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

The following text is usually shown on the group header:
[Label of the grouped column]: [Grouping value]

Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

Guidelines
In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

Column Settings

Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

Guidelines
If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
Developer Hint
Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

Export to Spreadsheet

Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

Guidelines

  • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
    • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
    • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
  • If you offer the Export to Spreadsheet button, use the front-end export.
  • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

Warning
With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

Apply the following size restrictions as a rule-of-thumb:

  • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
  • For the back-end export, do not export more than 100,000 table cells.

For larger tables, consider using custom-built, specialized export solutions instead.

Maximize / Minimize

Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

Guidelines
Use Maximize / Minimize only if really needed.

App-Specific Actions

App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

Developer Hint

Infobar

Infobar with filter information
Infobar with filter information

The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

Guidelines

Table

Responsive table within a smart table
Responsive table within a smart table

The table is generated automatically. The sections below describe the behavior and different possibilities:

Table

The table provides the following features:

Guidelines

  • The analytical table, tree table and grid table are not fully responsive. They are available only for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
    • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
    • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

Developer Hint
To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
Developer Hint

  • The property tableBindingPath defines the path from which the data is fetched.
  • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

Developer Hint
To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

Column Visibility

  • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
Developer Hint
If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

Use this option if:

  • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
  • The values of a column are needed to perform calculations, but only the results are shown on the UI.

You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

Developer Hint
Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
  • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
Guidelines

  • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
  • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

  • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
    For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
Developer Hint
If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

Column Layout

  • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
    The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
    If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
Guidelines
Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
Developer Hint
For the responsive table, enableAutoColumnWidth also applies the following changes:

  • The smart table property demandPopin is set to true.
  • The responsive table property fixedLayout is set to Strict.
  • The responsive table property contextualWidth is set to Auto.
  • Column resizing is enabled for all columns (including custom columns).
  • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

In this case, the properties above must not be managed by the app.

Responsive table with automatically calculated column widths, resizing, and remaining space
Responsive table with automatically calculated column widths, resizing, and remaining space
  • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
    You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
Developer Hint
To add or override columns (“custom columns”):

  • Use an XML view to define the underlying table with just the columns to be added/overridden.
  • To override columns, provide the column key of the column you want to exchange.
  • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

Column Headers

  • You can specify a column header text for each column (annotation: sap:label).
  • SAP S/4HANA Only:
    Tooltips are available by default for smart table column headers.
    In smart tables, texts that exceed the column width always truncate (see Column Layout). The tooltip allows users to read the full column header text without resizing.
Guidelines
Provide a column header text for each column. (annotation: sap:label).
  • The column headers contain the following settings:
    • Sort AscendingSort Descending
    • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
    • Group (only analytical table, only on dimension columns)
    • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
      If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
    • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
Guidelines
Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
Developer Hint
To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
Column header menu for a dimension column of an analytical table within a smart table
Column header menu for a dimension column of an analytical table within a smart table
Column header menu for a measure column of an analytical table within a smart table
Column header menu for a measure column of an analytical table within a smart table

Content

The smart table offers the following options for creating columns automatically:

  1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
  2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
    • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
    • Use of value help for input fields
Developer Hint
From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

  • For read-only tables, use the controls provided by the smart table.
  • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
  • For more complex editing cases, use smart fields.
  • For switching between read-only and edit modes:
    • In read-only mode, use the controls provided by the smart table.
    • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

In cases where the controls are rendered by the smart table, the following controls are used:

Read-only Edit Annotations / Edm type Comment
Static text Text Input field Edm.String
Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
Status information Object status or Icon Input field Criticality, CriticalityType,
CriticalityRepresentationType
Do not use editable status information.
Key identifier Object identifier (responsive table)
Text
(all other tables)
Input field for the ID SemanticKey,
Common.EditableFieldFor
Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
Times Text Time picker Edm.Time
Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
Email Link Input field IsEmailAddress Opens the system application for writing emails.
Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

Guidelines
For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

Behavior and Interaction

The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

Empty Tables

If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

  • If a table is initially empty:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
    (property: initialNoDataText, value: $NO_FILTERBAR)
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
    (property: initialNoDataText, value: $FILTERBAR)
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.
    (aggregation: noData, changeable at runtime)
  • If the user has hidden all of the columns in the personalization settings, the following text is shown:
    Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
    This text cannot be changed.
Guidelines

  • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
  • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
  • Avoid displaying a table without any items, especially when the app is initially loaded.

An empty smart table
An empty smart table

Errors and Warnings

To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

For details on displaying errors, warnings, and other messages, see Message Handling.

Table containing warnings
Table containing warnings
Table containing errors and warnings
Table containing errors and warnings
Guidelines
To show that an item contains an error,

Developer Hint
Binding-related messages are shown automatically.

Responsiveness

The smart table acts exactly like the embedded controls. For details see:

  • Toolbar Overview
  • Infobar
  • Responsive Table via auto pop-in mode
    (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
    You can use the UI.Importance annotation to influence the priority of each column.
    You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
  • Grid Table, Tree Table, Analytical Table are not fully responsive. They are available only for desktops and tablets. For smartphones, you need to take an adaptive approach by offering an additional UI.
Guidelines
If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

  • The column that identifies the line item.
  • The column that contains the key attribute.

Developer Hint

  • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
  • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

Examples

Responsive table within a smart table
Responsive table within a smart table
Grid table within a smart table
Grid table within a smart table

Top Tips

  • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
  • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
  • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
  • If the page has a filter bar, don’t offer filtering for the table.
  • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

Properties

The following properties are available for sap.ui.comp.smarttable.SmartTable:

  • The property: toolbarStyleClass is deprecated. Do not use it.
  • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

Related Links

Elements and Controls

Implementation

Tree Table

A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

Usage

Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Responsiveness

A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. For smartphones, you need to take an adaptive approach by offering an additional UI.

Possible solutions are as follows:

  • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
  • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
  • Use filtering instead of a tree structure.

You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

Tree table shown on a desktop
Tree table shown on a desktop
Tree table shown on a tablet
Tree table shown on a tablet

Types

Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

For more information on cozy and compact modes, see content density.

Compact Mode

Tree table – Compact mode
Tree table – Compact mode

Condensed Mode

Tree table – Condensed mode
Tree table – Condensed mode

Components

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Resizing columns works in the following ways:

  • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
  • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

After resizing a column, the adaptation of the column widths depends on how the column width is set:

  • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
    If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
  • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

Tree table – Column header
Tree table – Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Fewer columns than space available
Fewer columns than space available

Line Item

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

Tree table – Line item
Tree table – Line item

In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

Tree Column

The first colum (tree column) provides the hierarchical structure.

Tree table – Tree column
Tree table – Tree column

Expand/Collapse Button

The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

Tree table – Collapse
Tree table – Collapse
Tree table – Expand
Tree table – Expand

Container Node

A container node is a line item that contains child elements.

Tree table – Container node
Tree table – Container node

Leaf Node

A leaf node is a line item that does not contain child elements.

Tree table – Leaf node
Tree table – Leaf node

Cell

Each cell provides one data point. It can contain one of the following controls to display the data point:

While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

Tree table – Cell
Tree table – Cell

Tree Cell

A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

Tree table – Tree cell
Tree table – Tree cell

Column Header Menu

For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
For all other columns, only the free text filter is available.

Tree table – Tree column header menu
Tree table – Tree column header menu

Selection Cells

For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

Tree table – Selection cells
Tree table – Selection cells

Select All

For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

Tree table – Select all
Tree table – Select all

Scrollbar

The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

The tree table is optimized to allow faster scrolling within the first 1000 items.

Tree table – Vertical scrollbar
Tree table – Vertical scrollbar

Behavior and Interaction

Selection

The tree provides the following possibilities:

No selection: Items cannot be selected. (property: selectionMode = None)

Tree table – No selection
Tree table – No selection

Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

Tree table – Single selection
Tree table – Single selection

Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

For multiple selection, you can choose between two variants.

  • Multi-toggle mode (property: selectionMode = MultiToggle)
  • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

These variants behave differently when the user selects more items than are currently loaded in the front end.

Multi-toggle

In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

Multi-selection plug-in

If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

  • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
  • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
    • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
    • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
  • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

Tree table – Multiple selection
Tree table – Multiple selection
Multi-selection plug-in with a limit
Multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop

Column Header Menu

Sort

The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

Tree table – Filter
Tree table – Filter

Freeze Columns

The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

Tree table – Freeze
Tree table – Freeze

Column Handling

Show/Hide Columns

Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

Rearrange Columns

The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

Resize Columns

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
  • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Tree table with context menu
Tree table with context menu

Cell Content

The tree is traditional in that each cell can contain only one data point in one single line.

Apart from plain read-only text, cells can contain the following:

While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

Guidelines

Filtering

What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

  • Remove all leaves that don’t fit the filter criteria
  • Remove empty nodes

Where nodes need to be filtered, keep the following in mind:

  • A node may or may not fit the filter criteria.
  • A node can contain items (nodes and/or leaves) that fit the filter criteria.

Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

Developer Hint
The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

Sorting

First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

Loading Data

To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

Initital Display

Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

Errors and Warnings

To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
  • For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
  • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Empty Table

Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

Remove the item count in the table title if there are zero items.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

Show new items as the first item of the tree table or node:

  • If nothing is selected, add the new item to the root.
  • If a single node is selected, add the new item to the selected node.
  • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

Disable Create or Add if more than one item is selected.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the tree toolbar or at page level.
    • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Enabling/Disabling Actions

To indicate if an action can be applied to the current selection:

  • Enable the action if it always works, regardless of whether or not items are selected.
  • Enable the action if it can be applied to all selected items.
  • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
  • Only disable the action if:
    • The action can’t be applied to any of the selected items.
    • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

For more details, see UI Element – States.

If the action was applied and the items are still available, keep them selected.

Message for an action that applies to a part of a selection
Message for an action that applies to a part of a selection

Columns

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

Alignment of Cell Content

Align column headers according to their cell content:

  • Texts are left-aligned.
  • Numbers (except for IDs), dates, and times are right-aligned.
  • Icons are centered.
  • Micro charts are left-aligned.

In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

  • The Tunisian dinar has three digits.
  • The Japanese yen has no digits.

In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

For more information, see currency.

Formatting Cell Content

  • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
  • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
    • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
    • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
  • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
  • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

Tree vs. Table

Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

Do
Example of an acceptable use of tree tables
Example of an acceptable use of tree tables
Do
A clear parent-child relationship
A clear parent-child relationship

When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

Don't
Avoid unnecessary depth in the hierarchy
Avoid unnecessary depth in the hierarchy
Do
Favor breadth over depth in the hierarchy
Favor breadth over depth in the hierarchy

You can use the following methods to reduce hierarchy levels:

  • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
  • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
  • Container nodes at the top level can usually be replaced by tabs or value pickers.
  • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
  • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

Design Concepts

The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

  • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
  • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Navigation

To trigger navigation on line item level, choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
  • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
    Do not use the RowActions column for actions other than navigation and deletion.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Examples of Incorrect and Correct Usage

When you use trees:

  • Choose breadth over depth.
  • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
  • Try to minimize the number of columns, especially if there is a large number of rows.
  • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
  • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
Don't
Avoid truncating the initial visible content in the default delivery
Avoid truncating the initial visible content in the default delivery
Don't
Never wrap texts
Never wrap texts
  • Maintain a fixed layout, except when the user wants to change it.
  • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
  • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
Do
Acceptable: repeat entries to optimize finding items
Acceptable: repeat entries to optimize finding items
  • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
  • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
  • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

Empty Tree Tables

Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

Examples:

  • If a tree table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the tree table with data.
  • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    No filters set. To start, enter your search and filter settings and run the search.
  • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
    No items found. Check the search and filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
  • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).

Highlight Items

To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within a tree table, use the following options:

  • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
  • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
  • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop target on an item
Drop target on an item

Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

Moving items from one node to another can be combined with sorting without any issues.

Don't
Do not combine rearranging items on the same level with sorting
Do not combine rearranging items on the same level with sorting

Visible Alternatives to Drag and Drop

Depending on the functionality you need, use one or more of the following alternatives:

  • To move items up or down within a node:
    Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
    Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
    Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
    Do not combine the option to move items up and down with sorting.
  • To move items to another node:
    Use Copy and Paste buttons on the toolbar.
    Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
  • To change the level of an item:
    In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Tables in Object Pages

In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Responsive Table

The responsive table contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

Responsive table
Responsive table

Usage

Use the responsive table if:

  • You need a table to display a moderate amount of data. When your data is of average complexity, the responsive table can handle up to 200 items. However, more complex data lowers the limit, and less complex data raises it. Note that the limit is not on the number of items in the database or in the filtered results, but the volume of data loaded at any point. Factors that influence the exact limit include:
    • The number of loaded rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on the page)
    • The browser used

    For loading large amounts of complex data, use a grid table instead, as it can handle higher volumes more efficiently.

  • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
  • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
  • Selecting one or more items is a main use case and details are needed to choose the correct item.
  • Line items are independent of each other and no operation across columns is needed.
  • You want a single implementation for all devices. As its name suggests, the table is responsive and adjusts its appearance to the screen size so you can use it on all devices. However, make sure you adapt the responsive table design to offer the best solution for the tasks performed on mobile devices. Sometimes, a solution without a table is more useful and usable.

Do not use the responsive table if:

  • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
  • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You expect users to work with large amounts of complex data. Use the analytical table or grid table instead; they are optimized for those cases.
    Note that the analytical table and the grid table are not fully responsive, but available only for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. In contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that the analytical table isn’t fully responsive and is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need an overview of a large amount of data. In this case, use a chart.
  • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
  • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
Don't
Don't use a responsive table as a form
Don't use a responsive table as a form

See the table overview to decide which SAP Fiori table is most suitable for your needs.

Responsiveness

The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

  • Block: Label/value pairs are listed one below the other.
  • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
  • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

In all layouts, you can show the labels next to or above (recommended) the corresponding data.

The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

Information
The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
Responsive table displayed on a smartphone (size S)
Responsive table displayed on a smartphone (size S)
Responsive table displayed on a tablet (size M)
Responsive table displayed on a tablet (size M)
Responsive table displayed in compact mode on a desktop computer (size L)
Responsive table displayed in compact mode on a desktop computer (size L)

The responsive behavior is optional. If it is not used, the responsive table minimizes all visible columns until they are no longer readable. The priority level assigned to columns also impacts the display of the responsive table. For more information on the priority levels, see: Smart Table

There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

  • Let more than one column stay in the tabular layout
  • Move more than one column into the pop-in area at once

In both modes, the responsive table ensures that at least one column always remains in the table layout.

Auto Pop-In Mode

The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in area. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in area first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

In auto pop-in mode, all other pop-in-related column settings are ignored.

Manual Pop-In Mode

The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

  • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
  • Move to the pop-in area (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
  • Hide

By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

For the smallest screen width, keep the following information in the table layout:

  • The identifier of the line item
  • The key attribute

Example for Block Layout

A typical responsive table.

A typical responsive table
A typical responsive table

Hide the information column for a width smaller than 570 px.

Hiding the information column
Hiding the information column

Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the vendor column to the pop-in area
Moving the vendor column to the pop-in area

Move the column “limit” to the pop-in area for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the limit column to the pop-in area
Moving the limit column to the pop-in area

Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

Moving the price column to the pop-in area
Moving the price column to the pop-in area

If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

Pop-in area: Moving the data below the labels
Pop-in area: Moving the data below the labels

Example for GridLarge Layout

A more complex responsive table.

A more complex responsive table (full screen without pop-in content)
A more complex responsive table (full screen without pop-in content)

In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

GridLarge layout - 'Average Stay' column moves to the pop-in area
GridLarge layout - 'Average Stay' column moves to the pop-in area

If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in content wraps.

GridLarge layout - 'Description' column moves to the pop-in area
GridLarge layout - 'Description' column moves to the pop-in area

If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

GridLarge layout - 'Details' column moves to the pop-in area
GridLarge layout - 'Details' column moves to the pop-in area

Layout

The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

The column header shows the label for each column. In addition, it allows the user to resize the column.

The collection of items, or rows, occupies the main part of the responsive table.

You can add aggregation information (such as totals) on the table footer.

A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

Schematic visualization of the responsive table
Schematic visualization of the responsive table

Components

The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
You can use the table footer to display additional static information relating to the table content.
The More button loads more items to the front end if not all items have yet been loaded.
Components of the responsive table
Components of the responsive table

Behavior and Interaction

The responsive table is quite flexible with regard to its content.

Table Level

Scroll

The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

If the table works in “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

Same table, different number of items
Same table, different number of items

When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

Information
The “sticky” feature comes with some limitations:

  • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
  • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
  • If focus is set to a fixed column header, the table is automatically scrolled to top.

Sticky table title and sticky column header
Sticky table title and sticky column header

Merge Duplicates

To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

Do not use the merge feature:

  • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
  • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
Supplier column merges duplicates in consecutive rows
Supplier column merges duplicates in consecutive rows
Merged columns with multiselection
Merged columns with multiselection

Select

A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

  • None: Items cannot be selected (sap.m.ListMode.None).
    Note: Line items can still use the sap.m.ListType “navigation”, which allows click handling for specific line items. Only use this option if the click triggers navigation to a corresponding details page.
  • Single select master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
  • Single select left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
  • Multi select: Users can select one or more items using the checkboxes on the left of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).
    Another multi select variant is to not provide a Select All option, but just a Clear All check box in the same place (property: multiSelectMode, value: ClearAll).

Keyboard: If the focus is on a row, the space bar selects the corresponding item.

Responsive table without selectable items
Responsive table without selectable items
Single select master
Single select master
SIngle select left, with radio buttons. Use only if row clicks are used for something else.
SIngle select left, with radio buttons. Use only if row clicks are used for something else.
Multi select with 'Select All' checkbox
Multi select with 'Select All' checkbox
Multi select with 'Clear All' button
Multi select with 'Clear All' button

Group

When items are grouped, a group header is displayed. The group header is not interactive.

Group headers
Group headers

Show Aggregations

Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

Don’t show aggregations in “growing” mode. In “growing” mode it isn’t clear which values are being aggregated; only the items currently loaded in the front end, or all items.

Table footer displays aggregated total
Table footer displays aggregated total

Load Items

When the responsive table fits the general requirements for your use case, always consider ways to reduce the amount of data loaded in the responsive table with, for example, filters, graphics, aggregation of information, and navigation. Keep in mind you should use it only to display moderate amounts of data, including factors like number of items and content complexity.

To show more than 100 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The “growing” mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. You decide whether the user triggers the request by scrolling (preferred) or by clicking the More button.

If you use the More button, show the number of items already loaded and the total number items below the More text, if possible.

Do not show aggregations in “growing” mode. Also, do not display an item count on the table toolbar if “growing” mode is used. Use the count on the More button instead.

Guidelines
If you expect users to work with large amounts of data, use the grid table because it is optimized for handling large data sets.

The growing mode will only help to reduce the amount of data loaded at once but the limits to the overall amount of data still apply.

Load on scroll
Load on scroll

Column Header Level

The column header provides the label for the corresponding column. It also handles the functionality for resizing columns.

Resizing Columns

If you implement column resizing, users can resize the columns as follows:

  • Mouse interaction: The user drags the separator line between two columns. Double-clicking the line optimizes the column width based on the length of the currently visible data and the label of the column header.
  • Touch interaction: As for mouse interaction, but with a larger target touch area.
  • Keyboard interaction: When the focus is on the column header, Shift+Right increases the width of the focused column. Shift+Left decreases the width.

When a column is resized, the other columns can keep their original width or adapt their width. This depends on the column width settings:

  • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and the columns that follow are moved accordingly. The width of all the other columns is not affected. If the visible columns don’t use the full width of the table control, empty space is added. If the visible columns exceed the width of the table control, one or more columns move to the pop-in area.
  • If all column widths are set as a percentage or as “auto”, resizing one column might also result in automatic resizing of some or all other columns. The position of the resized column might also be affected. This ensures that the full table width is used and no white space is added.
Developer Hint
To enable resizable columns, implement the plugin:
sap.m.plugins.ColumnResizer.
Resizing a column
Resizing a column

Line Item Level

Delete Single Item Rows

To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

Do not use this mode if deleting multiple lines at once is the preferred use case.

Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

Responsive table in 'Delete' mode
Responsive table in 'Delete' mode

Highlight an Item

To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

Highlighted item
Highlighted item

Navigate

To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

If no navigation is possible, set sap.m.ListType to “inactive”.

“Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

Navigation indicator
Navigation indicator

Indicate Navigated Item

When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

Navigated item
Navigated item

Edit Line Items

To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

Edit button
Edit button

Click an Item

Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

Active element
Active element

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Responsive table with a context menu
Responsive table with a context menu

Cell Level

Showing Information

In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

Several lines of text within one cell
Several lines of text within one cell

Add Controls

Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

Controls inside cells
Controls inside cells
Any control can be placed inside cells
Any control can be placed inside cells

A cell can contain more than one control and more than one data point.

With the View Settings dialog, users can sort, filter, and group by each of these data points.

Several controls per cell
Several controls per cell

You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

Different controls per column
Different controls per column

Guidelines

Responsiveness

In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

  • The values are text-only (no input fields, icons, images, micro charts, and so on)
  • The available space is at least the double the width of size S.

This avoids truncation or “over-wrapping” of the labels and content.

If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

Information
The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534)

The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

Remove the item count in the table title if there are zero items. Do not use an item count together with “growing” mode.

If possible, keep the title bar sticky (sap.m.Table, property: sticky).

Table title with item count
Table title with item count

Selection

For single selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for list-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

In multiple selection mode:

  • Prefer Select All over Clear All
  • Use Clear All only for tables with a large number of items (more than recommended above), where loading all items to select them would harm performance.
  • To avoid confusion, don’t show checkboxes in the first data column in the default delivery.
  • Make sure that the Select All checkbox (de)selects all items the user can reach by scrolling. This is only possible if all items are rendered.
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
Don't
Single selection left - Don't show radio buttons in the first column in the default delivery
Single selection left - Don't show radio buttons in the first column in the default delivery
Don't
Multiple selection - Don't show checkboxes in the first column in the default delivery
Multiple selection - Don't show checkboxes in the first column in the default delivery
Do
Use the selection mode
Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
Do
Use the selection mode
Use the selection mode "single select master" in all other single selection cases
Developer Hint
Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

Loading Data

To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Table in busy state while loading data
Table in busy state while loading data

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors
Table containing errors

Columns – Best Practices

Minimize the number of columns:

  • On a smartphone, use only one or two columns, depending on the content.
  • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

If the responsive table does not fit into the width provided:

  • Hide columns to reduce the width of the table.
  • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

At the smallest size, keep the following information in the table layout:

  • The column that identifies the line item.
  • The column that contains the key attribute.

If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with empty space.

Optimize the column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize the column width for typical content.

When defining the column width, consider the implications when a column is resized:

  • If you define the column width in pixels or rem, resizing a column only affects the width of that particular column.
    • If the table isn’t wide enough to show all the columns after a column has been resized, one or more of follow-on columns move into the pop-in area.
    • If the columns don’t use up the available space, white space appears to the right of the last column (property: fixedLayout, value: strict).
    • If only one column remains, and the width of this column exceeds the width of the table itself, the width of the column is reduced to the width of the table.
  • If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text wraps more when the browser window size is reduced. This ensures that all columns together make use of the full table width.
  • If you define the column width as “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.
  • Be cautious of mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when columns are resized. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

Don't
Do not distribute just a few columns across the full width
Do not distribute just a few columns across the full width
Do
Use a fixed column width instead
Use a fixed column width instead

Column Headers – Best Practices

Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

To keep the column headers readable, wrap or truncate the texts as follows:

  • If columns are not resizable, use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.
  • If columns are resizable, use controls that truncate.

Keep column headers sticky.

Do
Wrap column headers if columns are not resizable
Wrap column headers if columns are not resizable
Do
Truncate column headers if columns are resizable
Truncate column headers if columns are resizable

Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

Accepted: Link as column header text (rarely used)
Accepted: Link as column header text (rarely used)
Accepted if responsiveness is taken into account: Text plus search field
Accepted if responsiveness is taken into account: Text plus search field

If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

For text and ID fields, use a generic label (for example, Employee for Name and ID).

If none of these are possible, separate the labels with “/” (for example, Name / Status).

For boolean values, such as checkboxes, find a descriptive text for the column header.

Horizontal Content Alignment

For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

Exception: Secondary information in a column always follows the alignment of the main information.

Left-Align

Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-align text
Left-align text

Left-align: Status information

Left-align status information
Left-align status information

Right-Align

Right-align: Dates and times (to ensure comparability for most formats and locales)

Right-align dates
Right-align dates

Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

Right-align numbers
Right-align numbers

Center-Align

Center-align: Icons, images, and avatars

Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

Align buttons with the content hierarchically

Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

Vertical Content Alignment

Top-align where possible to facilitate reading the content on one line.

Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

Do
Use top-alignment where possible
Use top-alignment where possible
Don't
Don't use top alignment if it doesn't make sense
Don't use top alignment if it doesn't make sense

Content Formatting

The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

If the table width is small, do not hide this column or move it to the pop-in area.

Object identifier
Object identifier

Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

This minimizes the line height.

For items with a small line height, place the ID in brackets after the corresponding string
For items with a small line height, place the ID in brackets after the corresponding string
If displayed as a link, use the whole text as the link
If displayed as a link, use the whole text as the link

Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

For items with a large line height, place the ID below the corresponding string
For items with a large line height, place the ID below the corresponding string
Is displayed as a link, use only the first line as the link
Is displayed as a link, use only the first line as the link

If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

Several key identifiers
Several key identifiers

For status information, use semantic colors on the foreground elements.

For status information on text: If the status is actionable, add a transparent icon button next to the text.

Semantic colors on text
Semantic colors on text

Avoid truncation. Use controls that wrap the text and support hyphenation.

For example, use text.

Do
Wrap text
Wrap text
Don't
Don't truncate text
Don't truncate text

For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

Interactive controls – Inline
Interactive controls – Inline

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

  • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
  • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
  • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
For short numbers, add the item number to the description
For short numbers, add the item number to the description

Flag and Favorite

Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

Item marked as a favorite
Item marked as a favorite

Empty Tables

Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).

Remove the item count in the table title if there are zero items.

Provide meaningful instructions
Provide meaningful instructions

Displaying Boolean Values

If a column contains Boolean values, such as “Yes” or “No”, show a read-only checkbox next to the texts.

The supplementary checkbox makes it easier for users to see at a glance which items are “true” (checked) and which are “false” (unchecked).

 

Developer Hint

Use sap.m.checkbox with the Horizon theme and set the editable property to “false” to get the read-only variant. Add the checkbox next to the existing text value. The text itself should remain unchanged.

Avoid showing only text for Boolean values
Avoid showing only text for Boolean values
Boolean values with read-only checkboxes for easier scanning
Boolean values with read-only checkboxes for easier scanning

Item States

To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

An unread item
An unread item

To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

A modified item
A modified item

To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight). A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

A locked item
A locked item

To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

Item in draft state
Item in draft state

Show only one state at any one time.

Highlight Items

To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.m.ListItemBase, property: highlight)

Highlighted items using status colors
Highlighted items using status colors
Highlighted items using industry-specific (indication) colors
Highlighted items using industry-specific (indication) colors

Numbers and Units

If the following conditions all apply, show the unit of measurement in the column header:

  • The unit of measurement is the same for all rows
  • A single cell contains only one amount with the unit of measurement
  • The column header does not scroll away

In all other cases, show the unit of measurement together with the corresponding amount within the row.

Show the unit of measurement in the same column as the corresponding amount.

For numbers with units, show the correct formatting by using the object number control.

Object number
Object number

For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
Exception: If all numbers are of equal importance, emphasize none of them.

If the table width is narrow, do not hide this column or move it to the pop-in area.
Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

Object number (emphasized)
Object number (emphasized)

Drag and Drop

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Currently, there is no keyboard support for drag and drop.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop targets in between items
Drop targets in between items

Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

Example:
A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

Don't
Don't combine rearranging items with grouping, unless you know exactly what you're doing.
Don't combine rearranging items with grouping, unless you know exactly what you're doing.

Context Menu

Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the whole table or per row.

Actions

To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
  • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
Do
Inline actions
Inline actions
Don't
Don't combine unrelated inline actions
Don't combine unrelated inline actions

The following actions on single items must always be in-line:

Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

Delete button
Delete button

Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

Navigation indicator
Navigation indicator

Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

Edit button
Edit button

From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

Edit and navigation cannot be combined.

To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

For information on enabling and disabling actions, see Enabling/Disabling Actions.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the table toolbar or at page level
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Add button in table toolbar
Add button in table toolbar
New item as first row in edit mode
New item as first row in edit mode
Saved new item, still highlighted, still the first item
Saved new item, still highlighted, still the first item

Editable Content

For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

All SAPUI5 controls can be used.

If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

For mass editing items:

  • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
  • Provide an Edit button.
  • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

For details, see mass editing.

View Settings: Sort, Filter, Group

Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

  • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
  • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

Several triggers for the different view settings (sort, filter, group)
Several triggers for the different view settings (sort, filter, group)

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

For each data point, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

Keep the infobar sticky (sap.m.Table, property: sticky).

Developer Hint
To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
Filtered table
Filtered table

Group

To display the current group state, group headers are shown.

On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

[Label of the grouped column]: [Grouping Value]

Do not use several values on the group header.

Grouped table
Grouped table

If there is no grouping value, show the following text:
[Label of the grouped column]: (Not Available)

This is the case if you have a group of items that don’t have a value for the grouped column.

Grouped table, with missing grouping value
Grouped table, with missing grouping value

Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

Personalization: Add, Remove, Rearrange Columns

To enable users to add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

If all columns are hidden, the table shows a corresponding “no data” text.

View settings and table personalization icons
View settings and table personalization icons

Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

Tables in Object Pages

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Paste

To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

  • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
  • If the focus is on an editable control within the table, the control gets the data automatically.

Pasting via context menu does not work if a custom context menu is used.

Properties

sap.m.Table

The following additional properties are available for the responsive table:

  • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
  • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
  • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
  • The property: inset adds a margin on all sides of the responsive table.
  • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
    • A separate toolbar
    • variantManagement
    • headerToolbar aggregation
  • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
  • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
  • The property: width defines the width of the whole table.
  • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
  • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
  • The property: modeAnimationOn does not have any effect. Do not use it.
  • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
  • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
  • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
  • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
  • The property: visible shows the table (“true”) or hides it (“false”).
  • The property: tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.m.Column

The following additional properties are available for sap.m.Column:

  • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
  • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
  • The property: visible shows or hides the column.
  • The property: tooltip does not have an effect. Do not use it.

sap.m.ColumnListItem

The following additional properties are available for sap.m.ColumnListItem:

  • The property: selected allows an item to be selected programmatically.
  • The property: counter does not have any effect. Do not use it.
  • Do not use the property: busy.
  • Do not use the property: busyIndicatorDelay.
  • The property: visible shows or hides the item.
  • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Grid Table

A grid table contains a set of data that is structured in rows and columns. It allows users to scroll in both directions and is optimized for handling large numbers of rows and columns.

Usage

Use the grid table if:

  • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
  • You need a table to display large amounts of complex data. The grid table can handle higher volumes more efficiently than the responsive table.

The responsive table can handle around 200 items when data is of average complexity — more items when data is less complex and fewer when data is more complex. If your scenario exceeds these data limits, use the grid table. Factors that influence the exact limit include:

    • The number of loaded rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on the page)
    • The browser used
  • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult.
  • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.
  • Your use case is for tasks performed on a desktop or tablet device. The grid table is not fully responsive.

Do not use the grid table if:

  • You expect users to work with moderate amounts of data. Note that this is about the data actually loaded — not the items in the database or the filtered results — which includes the number of items as well as the complexity of the data displayed. In these cases, consider the responsive table.

Additional use cases where you might need the responsive table include:

    • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
    • Selecting one or several items is the main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. However, make sure you adapt the responsive table design to offer the best solution for the tasks performed on mobile devices. Sometimes, a solution without a table is more useful and usable.
  • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
  • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
  • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
  • You need an overview of a large amount of data. In this case, use charts.
  • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
  • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

Responsiveness

A grid table is not fully responsive, but available for only desktops and tablets, and it supports touch interactions. For mobile use cases, you need to:​

  • Create a new Fiori application with reduced complexity, not an exact match of the desktop application.
  • With the new application, address the most important use cases for users in a mobile context. The responsive controls (responsive tablelist or tree,) or a relevant control for your use case (for example a chart or the category navigation pattern) may suffice.

Or, you could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

Grid table shown on a desktop
Grid table shown on a desktop
Grid table shown on a tablet
Grid table shown on a tablet

Layout

  1. Select All – The Select All checkbox selects or deselects all items.
  2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
  3. Selector cells – The selector cells allow the user to select one or more items.
  4. Items – The collection of items, or rows, occupies the main part of the grid table.
Schematic visualization of the grid table
Schematic visualization of the grid table

Components

A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

Behavior and Interaction

A grid table is quite restricted in terms of its content.

Table Level

Scroll

A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

You can add any number of line items to the grid table, which uses “lazy loading”.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

The grid table is optimized to allow faster scrolling within the first 1000 items.

Scrollbar
Scrollbar

Select

Selection Mode

Selection for a grid table depends on the chosen selection mode. The following options are available:

No selection: Items cannot be selected. (property: selectionMode = None)

A non-selection grid table
A non-selection grid table

Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

A single-selection grid table
A single-selection grid table

Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

For multiple selection, you can choose between two variants.

  • Multi-toggle mode (property: selectionMode = MultiToggle)
  • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

These variants behave differently when the user selects more items than are currently loaded in the front end.

Multi-toggle

In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

Multi-selection plug-in

If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

  • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
  • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
    • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
    • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
  • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

A multiselection grid table
A multiselection grid table
Using the multi-selection plug-in with a limit
Using the multi-selection plug-in with a limit

Selection Behavior

An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

  • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
  • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
  • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

Compact, Cozy, and Condensed

Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

For more information on cozy and compact modes, see content density.

Column Header

The column header provides the label for the corresponding column and access to the column header menu.

Columns are resized as follows:

  • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
  • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
  • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

After resizing a column, the adaptation of the column widths depends on how the column width is set:

  • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
    If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
  • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

Column header
Column header
Opening the column header menu on touch devices
Opening the column header menu on touch devices
Fewer columns than space available
Fewer columns than space available

Column Header Menu

For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

  • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
  • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
  • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

For each column, the menu can be replaced by an app-specific menu.

Column header menu
Column header menu

Sort

The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

  • Sort Ascending
  • Sort Descending

The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

Sort settings in column header menu
Sort settings in column header menu

Filter

The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

Note that the filter may return zero results, in which case, the table might be empty.

General recommendations for filtering:

  • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
  • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
Free text filter in column header menu
Free text filter in column header menu

Freeze Columns

The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

Freeze setting in column header menu
Freeze setting in column header menu

Line Item Level

A line item contains a set of cells and provides options for selecting the item.

To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

Line item
Line item

Drag and Drop

One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

Drag and drop is only available on supporting browsers.

Drag and drop
Drag and drop
Whole item as drop target
Whole item as drop target

Context Menu

You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

Grid table with a context menu
Grid table with a context menu

Cell Level

A cell provides one data point and can contain one of the following controls:

We recommend against using other controls to prevent issues with alignment, condensed mode, screen reader support, and keyboard support.

Cell
Cell

Guidelines

Data Density vs. Complexity

The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

Only show tables with a lot of data as a last resort. Try the following instead:

  • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
  • Use charts with drilldown functionality until the amount of data is more manageable.

Try to avoid horizontal scrolling in the default delivery.

Try to minimize the number of columns, especially if there is a large number of rows.

Table Title

Implement the table title by using a title control in a toolbar.

Use a table title only if the title of the table is not indicated in the surrounding area.

Do not use a table title if it simply repeats text that is already above the table. For example:

  • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
  • A section or subsection on an object page contains only one table.

Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

Items (2,534).

The item count in the table title includes all the visible items that a user can reach by scrolling.

Remove the item count in the table title if there are zero items.

Developer Hint
Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

Selection

Single Selection

For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

Multiple Selection

  • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
  • Do not limit the range selection for the multi-selection plug-in unless you have to.
    • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
    • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
  • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
Information
When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

  • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
  • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

  • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
Don't
Do not add checkboxes to the first data column in the default delivery
Do not add checkboxes to the first data column in the default delivery
  • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

Loading Data

To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

Grid table in busy state while loading data
Grid table in busy state while loading data

Errors and Warnings

To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

To indicate an error in a single row, see Item States below.

For details on displaying errors, warnings, and other messages, see Message Handling.

Developer Hint
The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
Table containing errors and warnings
Table containing errors and warnings

Columns – Best Practices

Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

  • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
  • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
  • For all other tables, use whatever fits your case better.

Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

Maintain a constant column width and avoid adjusting it automatically when the content changes.

Always keep to one line of text. Do not wrap.

Don't
Don't truncate the initial visible content in the default delivery
Don't truncate the initial visible content in the default delivery
Don't
Never wrap texts
Never wrap texts

Column Headers – Best Practices

For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

Content Alignment

For alignment of cell content, follow the guidelines below.

Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

Left-alignment of text
Left-alignment of text

Right-align numbers (except IDs).

This ensures comparability of numbers and amounts.

Right-alignment of numbers
Right-alignment of numbers

Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

For aligning to the decimal point, use the sap.ui.uinified.Currency control.

Alignment to decimal point
Alignment to decimal point

Right-align dates and times.

This ensures comparability for most formats and locales.

Right-alignment of dates
Right-alignment of dates

Left-align status information.

Left-align status information
Left-align status information

Center-align icons.

Left-align micro charts.

XS micro charts in condensed mode
XS micro charts in condensed mode

Content Formatting

Locale Settings

Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

Key Identifier

Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

Emphasized link
Emphasized link

For strings with IDs, use one of the following options:

  • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
  • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
Text and ID in two columns – Allows users to sort and filter both separately
Text and ID in two columns – Allows users to sort and filter both separately
If displayed as a link, use only the text as the link, not the ID
If displayed as a link, use only the text as the link, not the ID
Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

Truncation

Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

Optimize column width for typical content, not all content
Optimize column width for typical content, not all content

Number of Links

Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

Emphasized links, links, subtle links, and text
Emphasized links, links, subtle links, and text

Missing Value

If there is no value for a cell, leave it blank. Do not display text as N/A.

Leave empty fields blank
Leave empty fields blank

Numbering Items

In terms of numbering items:

  • If the item number is more like an ID with regard to its description, use ID formatting as described above.
  • In all other cases, use a separate column for the item number.
Add a separate column for the item number
Add a separate column for the item number

Status

For status information, use semantic colors on the foreground elements.

For status information on text, use an object status.

Semantic colors on text
Semantic colors on text

Micro Charts

Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

Micro charts in a grid table
Micro charts in a grid table

Empty Tables

Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

Examples:

  • If a table is initially empty, provide at least a basic text:
    No items available.
    Overwrite this whenever a hint can be provided on how to fill the table with data.
  • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
    To start, set the relevant filters.
  • If a table is used together with a filter bar and the filter does not return results, use the following text:
    No data found. Try adjusting the filter settings.

Adapt the texts above if:

  • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
  • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
Provide meaningful instructions
Provide meaningful instructions

Invalid State

To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

Grid table with invalid data
Grid table with invalid data

Item States

To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

In the default delivery, add a column directly behind the key identifier.

A modified item
A modified item

To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

A modified item with an error
A modified item with an error

To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

A locked item
A locked item

To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

Item in draft state
Item in draft state

Show only one state at a time.

Numbers and Units

Show the unit of measurement in one of the following ways:

Number and Unit in Same Cell

The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

For amounts, use a currency control to display the concatenated string.

Number and unit of measurement in one cell
Number and unit of measurement in one cell

Number and Unit in Separate Columns

The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

Number and unit of measurement in two columns
Number and unit of measurement in two columns

Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

Drag and Drop

If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

Drop targets in between items
Drop targets in between items

Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

Don't
Do not combine rearranging items with sorting
Do not combine rearranging items with sorting

Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

Use drag and drop only in addition to existing visible UI elements
Use drag and drop only in addition to existing visible UI elements

Context Menu

Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

Actions

Multiple Items

To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

Single Item

To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

  • Show the actions on the table toolbar.
  • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

To trigger navigation on line item level, choose one of the following options:

  • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
  • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

Special case: Multi-selection in a list-detail scenario
When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

Use the RowActions column only for one or both of the following actions:

  • Navigate to details page ( )
  • Delete ( )

The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

Navigate to details page
Navigate to details page

Single Cell

To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

Add Items

For adding items, place an Add or Create text button on the table toolbar.

  • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
  • Use Add if the item already exists and is merely added or assigned to the current object.

Show new items as the first item of the table, with a visual highlight at the beginning of the row.

Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

There are three options for adding an item. In order of priority (most recommended first), these are:

  1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
  2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
  3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

Depending on the flow, an item can be in one of three different states:

  • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
  • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
  • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
    • Inline creation: After Save was triggered on the table toolbar or at page level.
    • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

For more details, see the guidelines for managing objects (including subarticles).

Editable Content

For editable content, only use the following controls, and only one control per cell:

Only these controls are optimized for all viewing modes of the grid table.

If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

For mass editing items:

  • Provide multiselection.
  • Provide an Edit button.
  • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

For more information, see Mass Editing.

Interactive controls – In line
Interactive controls – In line

View Settings

There are several ways to show Sort and/or Filter settings:

  • Column header menu: In all cases, show the corresponding settings in the column header menu.
  • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
  • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
  • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

Trigger the dialogs in one of the following ways:

  • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
  • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

Use only the view settings you really need.

Column header menu with view settings
Column header menu with view settings
Table toolbar with triggers for view settings dialog
Table toolbar with triggers for view settings dialog
Table toolbar with trigger for table personalization dialog
Table toolbar with trigger for table personalization dialog

Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

Sort

Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

Column, sorted ascending
Column, sorted ascending
Column, sorted descending
Column, sorted descending

The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

  • Sort text alphabetically
  • Sort numbers by their value
  • Sort status information by the severity of the status:
    • Ascending: Sort status information from positive to negative, with neutral last.
    • Descending: Sort status information from negative to positive, with neutral first.
Object status sorted ascending, with neutral status last
Object status sorted ascending, with neutral status last
Object status sorted descending, with neutral status first
Object status sorted descending, with neutral status first
    • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
    • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted ascending and alphabetically, from positive to negative with neutral last
Object status sorted descending and alphabetically, from negative to positive with neutral first
Object status sorted descending and alphabetically, from negative to positive with neutral first

Filter

To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

Column, filtered
Column, filtered

Personalization

Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

Add, Remove, and Rearrange Columns

To add, remove, or rearrange columns, use one of the following:

  • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
  • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

Resize Columns

Resizing columns works differently on touch and non-touch devices.

  • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
  • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

Freeze Columns

To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

Frozen column
Frozen column

Highlight Items

To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

  • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
  • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
  • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

(sap.ui.table.Table, aggregation: rowSettingsTemplate)

Highlighted items
Highlighted items

Tables in Object Pages

For more information on the use of tables within the object page, see the Tables section of the Object Page article.

Export to Spreadsheet

On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

'Export to Spreadsheet' menu button
'Export to Spreadsheet' menu button

Paste

The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

  • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
  • If the focus is on an editable control within the table, the control gets the data automatically.

Pasting via the context menu does not work if a custom context menu is used.

Properties

sap.ui.table.Table

The following additional properties are available for the grid table:

  • The property: width defines the width of the grid table.
  • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
  • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
  • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
  • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
  • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
  • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
  • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
  • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
  • The property: editable does not have a visible effect. Do not use it.
  • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
  • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
  • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
  • The property: footer adds a short text at the bottom of the table.
  • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
  • The property: Tooltip does not have an effect. Do not use it.
  • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

sap.ui.table.Column

The following additional properties are available for the column:

  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
  • The property: Tooltip does not have an effect. Do not use it.

 

sap.ui.table.Column

The following additional properties are available for the column:

  • The property: visible defines whether a column is shown or hidden.
  • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
  • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
  • The property: Tooltip does not have an effect. Do not use it.

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Message Handling – Processing Multiple Items

When a user selects multiple items from a table, it might not be possible to process all of the items at once.

Users therefore need clear and user-friendly information on:

  • The actions available for the selected items
  • Any issues that prevent items from being processed
  • Whether or not an action was successful for all items

 

Scenarios for Processing Results

This guideline outlines the message patterns and recommended message texts for the following scenarios:

  • Success: All items were processed successfully
  • Failure: No items can be processed / were processed
  • Partial Processing: Only some items can be processed. Others can’t be processed or require manual validation.

 

Enabling/Disabling Actions

Guidelines
Enable an action that:

  • Always works, regardless of whether or not items are selected
  • Can be applied to at least one of the selected items

Disable an action that:

  • Can’t be applied to any of the selected items
  • Doesn’t correspond to the number of selected items. For example, disable Compare if only one item is selected

For more details, see UI Element States.

After the action is applied, keep the items selected.

Success

When all items were processed successfully, show a message toast.

 

Message Toast
Text <number of items> <item name> were <action>.
Message toast
Message toast

Failure Cases

No items can be processed

When no items can be processed, disable the action button.

For example, if all the selected items are locked, disable the Edit button.

To help users understand why the action button is disabled, use the item states.

Disabled edit button
Disabled edit button


No items were processed

When no items were processed, show a message view in a dialog.

 

Message View
Header Summary
First List Item No <item names> were <action>.
Next List Items Specific messages for each unprocessed item.
Button Close
Message view with errors only
Message view with errors only

Partial Processing

Backend issues

When one or more of the selected items were processed successfully and one or more were not, due to backend issues, show a message view in a dialog.

 

Message View
Header Summary
First List Item Success Message
<number of successful items> of <total number of items> <item name> were <action>.
Next List Items
  • Specific error messages for unprocessed items
  • Specific warning messages for processed items
Button Close
Message view with a mix of success, error, and warnings messages
Message view with a mix of success, error, and warnings messages


One or more items can’t be processed

  1. Before processing, a warning message asks users whether they want to apply the action to remaining items.
  2. After user confirmation the resulting message depends on the processing results:
    • A message toast for successful processing
    • A message view for when backend errors occurred during the processing


Messaging sequence for items that can't be processed
Messaging sequence for items that can't be processed

Before Processing

If the action cannot be applied to one or more items, a warning message asks the users whether they want to apply the action to the other items.

Warning Message Box
Message Text <number of items ineligible for the action> of <total number of items> <item name> can’t be <action>.

Do you still want to <action> the remaining <number of editable items> <item name>?

Message Details Possible Causes
Selected <item names> are excluded if:

  • Somebody is working on the <item name> (a draft exists or changes haven’t been saved).
  • <action> is not allowed on the <item name>.
Buttons <Primary action>, Cancel

 

After User Confirmation

After the users confirm the primary action for the remaining items the resulting message depends on the processing results:

  • When all the remaining items were successfully processed, a message toast is displayed.
  • When one or more backend errors occurred during the processing, a Summary message view in a dialog is displayed. It includes:
    1. Successfully processed items
    2. The backend error or errors
    3. An information message for each item excluded from the processing

Information message text: The <item name> can’t be <action>

Summary with backend errors and information messages for items excluded from processing
Summary with backend errors and information messages for items excluded from processing


Processing is blocked by items that require manual validation

Some warnings for individual items may require a user decision before processing can continue:

  • Case 1: Just one warning. The user can ignore the warning and process the item, or skip the item.
  • Case 2: More than one warning. The user can ignore the warnings and process all the items, or skip all the affected items. Processing is only interrupted once.

Case 1: One Item

When one item requires manual validation, show a warning message box with actions to:

  • Validate and process the item
  • Skip the item: When the users skip the item, in the message view in a dialog, show an information message for the skipped item in the message view.
Warning Message Box
Body Text <item name> <item ID>: <message description>

You can <action> this <item name> anyway, or skip it for now.

Show Details Optional
Buttons <Primary action>, Skip

 

For the skipped item, in the Summary message view, add an information message text below the other (success, error, and warning) items.

Message View
Information Message Text The <item name> was skipped and not <action>.

 

Manual validation flow for one item (message box)
Manual validation flow for one item (message box)

Case 2: More than One

When more than one item requires manual validation, show a warning message box with actions to:

  • Validate and process the items
  • Skip the items: When the users skip the items, in the message view in a dialog, show an information message for each skipped item.
Warning Message View
Header Warning
Body Text Warnings exist for some of the selected <item name, plural>.

You can choose “<primary action>” to ignore the warnings, or skip these <item name, plural> for now.

Buttons <Primary action>, Skip

 

For each skipped item, in the Summary message view, add an information message text below the other (success, error, and warning) items.

Message View
Information Message Text The <item name> was skipped and not <action>.

 

Manual validation flow for several items (message view)
Manual validation flow for several items (message view)

Action on multiple items with field issues in edit mode

Triggering a mass action can reveal field issues because the mass action also triggers field validation.

List the field related messages among other messages in the summary message view dialog.

Once the dialog is closed, the message popover appears, with a list of only the field issues.

Action on multiple items with field errors in edit mode
Action on multiple items with field errors in edit mode

Related Links

Elements and Controls

Implementation

  • No links.
  • Message Handling – Processing Multiple Items

    When a user selects multiple items from a table, it might not be possible to process all of the items at once.

    Users therefore need clear and user-friendly information on:

    • The actions available for the selected items
    • Any issues that prevent items from being processed
    • Whether or not an action was successful for all items

     

    Scenarios for Processing Results

    This guideline outlines the message patterns and recommended message texts for the following scenarios:

    • Success: All items were processed successfully
    • Failure: No items can be processed / were processed
    • Partial Processing: Only some items can be processed. Others can’t be processed or require manual validation.

     

    Enabling/Disabling Actions

    Guidelines
    Enable an action that:

    • Always works, regardless of whether or not items are selected
    • Can be applied to at least one of the selected items

    Disable an action that:

    • Can’t be applied to any of the selected items
    • Doesn’t correspond to the number of selected items. For example, disable Compare if only one item is selected

    For more details, see UI Element States.

    After the action is applied, keep the items selected.

    Success

    If all items were processed successfully, show a message toast.

    Body text: <number of items> <item name> were <action>.
    Example: 20 sales orders were released.

    Message toast
    Message toast

    Failure Cases

    No items can be processed

    Disable the action button. For example, if all the selected items are locked, disable the Edit button.

    To help users understand why the action button is disabled, use the item states.

    Disabled edit button
    Disabled edit button

    No items were processed

    Show a message view in a dialog, listing the issues.

    • As the first entry in the list, show a generic error message indicating that no items were processed.
    • Below, show the specific messages for the items that weren’t processed.

    Dialog header: Summary

    Generic error message text (top of list): No <item name> were <action>.
    Example: No sales orders were released.

    Message view with errors only
    Message view with errors only

    Partial Processing

    Backend issues

    One or more of the selected items were processed successfully and one or more were not, due to backend issues.

    Show a message view dialog to list the results.

    Start the list with a success message that counts the successfully processed items. Next, list the errors and warnings for the items.

    Dialog header: Summary

    Generic success message text (top of list):
    <number of successful items> of <total number of items> <item name> were <action>.
    Example: 8 of 10 sales orders were released.

    Message view with a mix of success, error, and warnings messages
    Message view with a mix of success, error, and warnings messages

    One or more items can’t be processed

    Before processing, if the action cannot be applied to one or more items, a warning dialog asks the user for a decision.

    Message box type: Warning

    Message text: <number of items ineligible for the action> of <total number of items> <item name> can’t be <action>.
    Do you still want to <action> the remaining <number of editable items> <item name>?
    Example: 4 of 10 sales orders can’t be edited.
    Do you still want to edit the remaining 6 sales orders?

    Message details:
    Possible Causes
    Selected <item name> are excluded if:
    Somebody is working on the <item name> (a draft exists or changes haven’t been saved).
    <action> is not allowed on the <item name>.

    Buttons: <primary action>, Cancel

    Example:

    • Somebody is working on the sales order (a draft exists or changes haven’t been saved).
    • Editing isn’t allowed on the sales order.

    If the user confirms the action for the remaining items and, after processing:

    • All these items were successfully processed, a message toast summarizes the operation
    • At least one backend error caused a remaining item to fail, the message view dialog with a summary appears
    Messaging sequence for items that can't be processed
    Messaging sequence for items that can't be processed

    Processing is blocked by items that require manual validation

    Some warnings for individual items may require a user decision before processing can continue.

    There are two cases:

    • Case 1: Just one warning. The user can ignore the warning and process the item, or skip the item.
    • Case 2: Multiple warnings. The user can ignore the warnings and process all the items, or skip all the affected items. Processing is only interrupted once.

    Case 1: One Item

    When one item requires manual validation, show a warning message box with actions to either process or skip the item.

    Message box type: Warning

    Body text:
    <item name> <item ID>: <message description>
    You can <action> this <item name> anyway, or skip it for now.
    Show Details (optional)

    Buttons: <primary action>, Skip

    If the user skips the item, show a corresponding information message in the summary dialog.

    Information message text:
    The <item name> was skipped and not <action>.
    Example: The sales order was skipped and not released.

    Manual validation flow for one item (message box)
    Manual validation flow for one item (message box)

    Case 2: More than One

    When more than one item requires manual validation, show a message view in a message dialog with options to process or skip all the items.

    • As the first entry in the list, show a generic message indicating that warnings exist. In the message details, explain the two options.
    • Below the first entry, show the specific warnings for the individual items.

    Message dialog type: Warning

    Generic warning message text (top of list): Warnings exist for some of the selected <item name, plural>.

    Message details: You can choose “<primary action>” to ignore the warnings, or skip these <item name, plural> for now.

    Buttons: <primary action>, Skip

    The primary action validates all the items at once.

    If the user skips the items, show corresponding information messages for each item in the summary dialog.

    Information message text (per skipped item):
    The <item name> was skipped and not <action>.
    Example: The sales order was skipped and not released.

    Manual validation flow for several items (message view)
    Manual validation flow for several items (message view)

    Action on multiple items with field issues in edit mode

    Triggering a mass action can reveal field issues because the mass action also triggers field validation.

    List the field related messages among other messages in the summary dialog.

    Once the dialog is closed, the message popover appears, with a list of only the field issues.

    Action on multiple items with field errors in edit mode
    Action on multiple items with field errors in edit mode

    Related Links

    Elements and Controls

    Implementation

  • No links.
  • Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the main list for a list-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: Only one item is selected.
    Single selection: Only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that Ctrl+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in 'delete' mode
    Tree in 'delete' mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with the “single select master” mode.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - Context menu
    Tree - Context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Errors and Warnings

    To indicate that the tree contains items with errors or warnings, show a message strip above the tree. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Tree containing errors
    Tree containing errors

    Content

    Content Formatting

    To display object names with an ID, show the ID in parentheses after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with 'Delete' button
    Items with 'Delete' button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the tree toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable item as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios where just a few input fields have to be filled.
    2. Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the tree.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at tree level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Information
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the tree in a meaningful way when it first loads.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in list-detail scenarios using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the list-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Users can (de)select all items using CTRL+A. Select All (de)selects all items that the user can reach by scrolling.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use this mode only if you really need two different click areas; a small one for a selection, and the rest of the item for something else.
    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
    • If selecting / deselecting all items is important for your app, add a button with the text Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the CONTEXT MENU KEY, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Errors and Warnings

    To indicate that the list contains items with errors or warnings, show a message strip above the list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    List containing errors
    List containing errors

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the list, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority, these are:

    • Add the item inline. Create an empty, editable item as the first item of the list. Show the Save button on the toolbar of the list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items with up to 8 input fields. Save the new item at dialog level.
    • Navigate to a new page. Only use this behavior for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the list. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level
      • Create with dialog: A list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved on list level, but rather with the entire draft.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available for all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the list. Use the filter bar instead.
    • Only use the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Keep the view settings consistent. When a user reopens the app, show the list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort setting, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings located in the filter bar or in a select control placed in the toolbar of the list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.List, property: sticky).

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid List

    The grid list displays a set of items. Whereas the list and the responsive table display the items in rows, the grid list displays the items as rectangular boxes on a grid. This makes it ideal for displaying visual content, such as images, charts, or object cards.

    Grid list
    Grid list

    When to Use

    Use the grid list if:

    • You want to display a set of homogeneous items.
    • The rectangular format of the items is better suited to your content than tables or lists.
    • The focus is on complete items, not cells.
    • Your items mimic the format of existing objects (such as business cards).
    • Users need to sort, group, or filter the items.

    Don’t use the grid list if:

    • Your content isn’t suitable for a card-like format. If you need to display a lot of detail or if your content is very text-heavy, use a table instead.
    • You expect to show more than 1.000 items. For better performance, use the grid table or analytical table instead.
    • You need an overview of a large amount of data. In this case, consider using a chart.
    • You only need the grid-style layout. In this case, use a layout container, such as the flexible grid.

    Components

    Grid list components
    Grid list components

    1. Title bar or toolbar
    2. Filter infobar (optional)
    3. Items
    4. More button (optional)
    5. Footer (optional)

    1. Title Bar

    The title bar contains the title of the grid list and an item counter.

    Instead of a a title bar, you can use a toolbar. The toolbar can have the following elements:


    Title bar
    Title bar
    Toolbar instead of title bar
    Toolbar instead of title bar
    Guidelines

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, you can also use a generic title text, such as Items.
    • Don’t show the title bar at all if all elements are available in the surrounding area (title, item count, variant management, toolbar).
      Example: An object page section contains only one grid list. In this case, add the item count and the toolbar to the section header.
    • For the item count, apply the following:
      • Use the format: [title text] ([count])
        Example: Items (234)
      • Include all the items that a user can reach by scrolling, except group headers.
      • Remove the item count if there are no items.
      • If you are using a More button, don’t show a count on the title bar. Show the count below the More button instead.
    • Keep the title bar sticky (sap.f.GridList, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    2. Filter Infobar (Optional)

    The filter infobar shows information on the filter settings.

    Filter infobar
    Filter infobar
    Guidelines
    Display the filter infobar when the grid list is filtered.

    3. Items

    A grid list item can contain any content. This can include single controls or a combination of controls (for example, using layout containers).

    A grid list can contain different item types. For example:

    • Sales orders and purchase orders
    • Items in display mode and single items in edit mode

    You can highlight items and show an item state (such as “unread” or “locked”).

    Example of a grid list item
    Example of a grid list item
    Guidelines

    • Ensure that items can be identified. For example, add a title and subtitle.
    • If the item has an ID and a description, use the title for the description and the subtitle for the ID.
    • Avoid truncation. Use wrapping instead.
    • Since no specific item templates are available, we recommend following the guidelines for object cards.

    Another example of a grid list item
    Another example of a grid list item

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator to the left of the item.
    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item
    Guidelines

    • Use highlighting to indicate:
      • A semantic state, such as red for an error or orange for a warning. In this case, use semantic colors.
      • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
      • Industry- / process-specific states, such as “Out of Stock” or “Excess of Inventory”. In this case, use indication colors.
    • Provide information within the item to explain why it is highlighted, ideally in the same color. The highlight is just a visual cue. It doesn’t tell users why the item has been highlighted.
    • For more details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    Item States

    Show the different item states as follows:

    State

    Unread

    How to Display

    Shows most content in bold.

    sap.f.GridList
    property: showUnread

    sap.f.GridListItem
    property: unread

    Unread item next to a read item
    Unread item next to a read item
    Guidelines

    Add the string (Modified) near the item identifier.

    A modified item
    A modified item

    Error

    Add the string (Contains errors) near the item identifier.

    sap.m.ObjectStatus
    Property: state
    Value: sap.ui.core.ValueState.Error


    Highlight the item accordingly

    sap.f.GridListItem
    property: highlight

    An item with an error
    An item with an error

    Locked

    Add a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier.

    Clicking the button opens a quick view of the person.

    A locked item
    A locked item

    Add a transparent button with the text Draft near the item identifier.

    Clicking the button opens a popover showing the timestamp of the last change.

    An item in a draft state
    An item in a draft state

    “More” Button (Optional)

    The More button loads more items. The count below the button indicates the items displayed and the total number of items.

    'More' button
    'More' button

    Footer (Optional)

    You can use the footer to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    This section covers the following topics:

    In addition, see the following guidelines for the responsive table:

    Loading Items

    You can load the grid list in “growing” mode.

    In “growing” mode, only a limited number of items are loaded when the grid list is initially displayed. Additional items are only loaded (and rendered) on request. This request can be triggered either by scrolling (preferred) or by clicking the More button.

    Guidelines

    • To optimize performance, we recommend showing no more than 200 items at once in the grid list.
    • For larger datasets (200 to 1,000 items), use the “growing” mechanism to limit the number of displayed items (property: growing), and make sure that users can filter the data.
    • Ideally, use scrolling to load more items instead of the More button (property: growingScrollToLoad).
    • Use the More button only if content is shown below the grid list.

    Warning
    The 200 and 1,000 item limits given here are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of items in the grid list
    • The number of displayed data points inside the items
    • The complexity of the data points (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Scroll

    The height of the grid list is defined by the number of items it contains.

    The grid list is scrolled together with the page and doesn’t have its own scroll container. When the user scrolls through the page, the title bar and filter infobar can stick to the top of the surrounding layout container
    (sap.f.GridList, property:sticky).

    Sticky toolbar
    Sticky toolbar
    Information
    The “sticky” feature comes with some limitations:

    • It isn’t available on all browsers.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.

    “More” Button

    The More button is the default implementation when growing is switched on (property: growing = true).

    'More' button with loaded/total items
    'More' button with loaded/total items
    Guidelines

    • Only use the More button if your page contains content below the grid list.
    • Below the More text, show the number of items already loaded and (if possible) the total number items.
    • Don’t show an item count on the title bar. Use the count on the More button instead.

    Drag and Drop

    The grid list offers the same drag and drop features as the responsive table.

    However, because the items in the grid list are rearranged after an item is dropped, it isn’t always clear where the item will finally be placed.

    Guidelines
    When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item.

    sap.f.dnd.GridDropInfo
    Property: dropIndicatorSize

    In addition, see the corresponding guidelines for the responsive table.

    Keyboard Navigation

    The grid list supports the following keyboard navigation options:

    • Arrow keys: Navigate between items in all directions
    • Page Up / Page Down: Skip several rows
    • Home: Move the focus to the first item
    • End: Move the focus to the last item

    Selecting Items

    A grid list offers the same selection modes as the responsive table
    (sap.f.GridList / sap.m.ListBase, property: mode).

    Exception: A Select All checkbox isn’t provided. Users can only select/deselect all items with the keyboard shortcut (CTRL+A).

    An unselected and a selected item in
    An unselected and a selected item in "multi-selection" mode
    A selected item in
    A selected item in "single select master" mode
    Guidelines

    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user can’t return to the initial state. A selected item can only be deselected by selecting another item.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Don’t show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use “single select left” only if you really need two different click areas; a small selection area, and the rest of the item for something else.
    • Never disable the selection checkbox (multiple selection) or radio button (single selection). If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • If selecting/deselecting all items is important for your app, add a Select All button to the toolbar. Change the button text to Deselect All if all items are selected.

    Clickable Items

    The whole item can be clickable. You can define the action triggered by the click, such as opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements don’t have a visual indicator and therefore can’t be differentiated from non-active elements.

    Clicks on interactive controls within the item are handled by the interactive control and don’t trigger the event for the item as a whole.

    Guidelines

    • Don’t use the “Active” list item type for navigation, to switch the item to an edit state, or to delete the item.
    • You can combine clickable items with edit and delete actions, but not with navigation.
    • Don’t combine clickable items with single selection. “Active” uses the whole item as a clickable area and therefore can’t be used together with a grid list in “single select master” mode.

    Actions

    You can offer actions for the entire grid list, single items, and multiple items.

    Guidelines
    If an action is independent of the selection, show it on the toolbar of the grid list. Examples of such actions are Add or Edit (in the sense of changing all items to edit mode), Sort, Filter, and Group.

    To indicate if an action is available, follow the guidelines for enabling/disabling actions.

    Actions on Single Items

    You can offer actions for single items either on the toolbar or within the item.

    Delete, navigation, and edit actions for single items are supported by the grid list control (see below).

    Guidelines

    • Offer only one or two actions within the item. In this case, show the action trigger near the content to which it belongs.
    • Use a button, unless the action trigger belongs to a link. Hide the action if it doesn’t apply to an item.
    • If you offer delete, navigation, or edit actions for single items, always offer them at item level.

    Delete:

    Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete).

    This places a Delete button (  ) in the top right area of the item.

    'Delete' button
    'Delete' button
    Guidelines

    • Don’t use the “Delete” mode if users typically need to delete multiple items.
    • The “Delete” mode can’t be used with the “single select” or “multi select” selection modes.

    Navigation:

    Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation).

    This places a navigation indicator (  ) in the top right area of the item, and the entire item becomes clickable.

    By contrast, clicking an interactive control within an item doesn’t trigger the navigation event. Instead, the corresponding control handles the click event.

    Navigation indicator
    Navigation indicator
    Guidelines

    • Use the navigation action to navigate to a new page containing item details. In rare cases, you can also use the navigation action for the category navigation pattern without navigating to another page.
    • You can’t use the navigation action together with “edit” or in combination with click events for the entire item (“Active”).

    Edit

    Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail).

    This places an Edit icon (  ) in the top right area of the item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.

    Edit button
    Edit button
    Guidelines
    If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls as soon as you switch to edit mode, but not before. You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    You can’t use the “Edit” list item type together with the “navigation” list item type or in combination with click events for the entire item (“Active”).

    Actions on Multiple Items

    To trigger actions for multiple items:

    • Use a multi-selection grid list.
      (sap.f.GridList, property: mode, value: sap.m.ListMode.MultiSelect)
    • Offer the corresponding actions on the toolbar of the grid list.
    • Keep the toolbar sticky.
      (sap.f.GridList, property: sticky)
    Guidelines

    • Don’t offer actions for multiple items if you expect the grid list to usually have fewer than 10 items.
    • For mass editing scenarios, provide an Edit button. When the user clicks this button, open a dialog for editing the corresponding fields for all selected items. For more information, see Mass Edit.
    • In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only for finalizing actions and if the grid list is the only area on the screen to which actions can be applied.

    Errors and Warnings

    Error handling must be implemented by the app team.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Grid list with errors
    Grid list with errors
    Guidelines
    If the grid list contains items with errors or warnings, show a corresponding message strip above the grid list:

    • On the message strip, provide information about errors or warnings.
    • When issues are solved or when new issues appear, update the message strip accordingly.

    Use item states to indicate errors and warnings for single items.

    Developer Hint
    sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid, which is defined by rows and columns. Columns can have a minimum and maximum size or a fixed size. Whenever an additional column fits on the screen, it is added. If a column no longer fits on the screen, it is removed. Items are re-layouted accordingly.

    You can also define different configurations for the underlying grid using breakpoints (for example, based on the device types).

    Predefined Layouts

    To define the grid layout and behavior, you can use one of the predefined layouts:

    • Grid box layout: Adds a variable number of columns, depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size ML and L, 16 for size XL, 20 for size XXL and XXXL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Custom Grid

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ according to the width of the screen (“breathing”) or be fixed. The height can differ according to the content of the item or be fixed.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Guidelines
    When defining a custom grid:

    • We recommend letting items “breathe” to make better use of the available screen space.
    • Make sure that the item adapts to the resulting width/height. For example:
      • Re-layout the item content.
      • Hide less important information.
      • Re-size content, such as images or charts.

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Don’t use other list items. They aren’t responsive enough.
    • Use responsive content. For example, use controls that wrap text and configure them accordingly.

    Examples

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • inset adds a margin on all sides of the grid list.
    • headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • Variant management
    • headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • footerText adds a small additional row below the table footer or last item. This row can contain text only. Don’t use this property.
    • width defines the width of the whole grid list.
    • includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and therefore shouldn’t be used in combination with these two settings.
    • enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the busy property, where the application can control when the grid list is set to busy state)
    • modeAnimationOn has no effect. Don’t use it.
    • showSeparators has no effect. Don’t use it..
    • swipeDirection has no effect. Don’t use it..
    • rememberSelections leaves items selected even if they aren’t currently visible (for example, after filtering). If this behavior isn’t wanted, you can set the flag to “false”. However, you should only do so in exceptional cases.
    • busy sets the grid list to a busy state. While in the busy state, the entire grid list can’t be used and items can’t be read due to an overlay.
    • busyIndicatorDelay defines how long a busy state is shown after the grid list has been set to this state. Use the default value.
    • visible shows the grid list (true) or hides it (false).
    • tooltip provides a tooltip for the whole grid list. Don’t use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • selected allows an item to be selected programmatically.
    • counter shows a number on the right side of an item. This is used to show the number of subitems, for example.
    • Don’t use the busy property.
    • Don’t the busyIndicatorDelay property.
    • visible shows or hides the item.
    • tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It won’t work on tablets or smartphones. Don’t use it.

    Top Tips

    • Use the grid list only if the content is suitable for a rectangular format.
    • Ensure that items can be identified.
    • Keep your grid and your items responsive. Consider allowing cards of different sizes to avoid content truncation.
    • In your card design, either mimic existing objects like business cards or follow the guidelines for object cards.

    Related Links

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows users to scroll in both directions and is optimized for handling large numbers of rows and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Users need to work with more than 200 rows. The grid table architecture is optimized for handling a large number of items, in contrast to the responsive table with its display limit of 200 rows after filtering.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult.
    • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.
    • Your use case is for tasks performed on a desktop or tablet device. The grid table is not fully responsive.

    Do not use the grid table if:

    • You need a table to display fewer than 200 rows after filtering. Instead, consider the responsive table. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices. However, make sure you adapt the responsive table design to offer the best solution for the tasks performed on mobile devices. Sometimes, a solution without a table is more useful and usable.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is not fully responsive, but available for only desktops and tablets, and it supports touch interactions. For mobile use cases, you need to:​

    • Create a new Fiori application with reduced complexity, not an exact match of the desktop application.
    • With the new application, address the most important use cases for users in a mobile context. The responsive controls (responsive tablelist or tree,) or a relevant control for your use case (for example a chart or the category navigation pattern) may suffice.

    Or, you could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point and can contain one of the following controls:

    We recommend against using other controls to prevent issues with alignment, condensed mode, screen reader support, and keyboard support.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
    Text and ID in two columns – Allows users to sort and filter both separately
    Text and ID in two columns – Allows users to sort and filter both separately
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort and/or Filter settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
    • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

     

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. If you use an analytical table, you need to take an adaptive approach by offering an additional UI for smartphones.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    The overall aggregation is shown in a row at the bottom of the analytical table when the column contains values for a single unit of measure.

    Overall aggregation for a single unit of measure
    Overall aggregation for a single unit of measure

    When the column contains values for more than one unit of measure, a Show Details link is displayed in a row at the bottom of the table, for example, when the column contains multiple currencies.

    The Show Details link opens a popover that lists the totals for each unit of measure.

    Overall aggregation for multiple units of measure via the 'Show Details' link
    Overall aggregation for multiple units of measure via the 'Show Details' link

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    The P13n dialog control tabs allow users to personalize table and smart chart attributes.

    Table Personalization Tabs

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    The tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    Smart Chart Personalization Tabs

    In addition to the Sort and Filter tabs, the P13n dialog for smart charts can include the Chart tab to allow users to set the visibility of chart dimensions and measures.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table or chart toolbar, as shown below.

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog can include the following tabs, separately or combined, as required by the use case:

    • Sort
    • Filter
    • Columns (available only for tables)
    • Group (available only for tables)
    • Chart (available only for the Smart Chart)

    App developers can add more tabs manually.

    Behavior and Interaction

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields:

    • One for choosing the sort column in a table or the sort dimension or measure in a smart chart
    • The second for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table or smart chart.

    Information

    • The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    • Using the sort feature for column headers replaces ALL sort options in the dialog!

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog

    Filter

    The Filter tab allows users to filter the table or chart information according to specific criteria.

    Once a filter criterion is entered, a new line appears for entering another one. Users can remove filters by clicking the   (Remove Filter) icon at the end of each filter item.

    Filter Criterion

    In the first input field, the user selects the column (for tables) or the dimension/measure (for charts) to be filtered. Any column or dimension/measure can be selected, including columns and dimensions/measures that are not currently visible.

    Define Conditions

    The second field is an input field which calls a Value Help Dialog when the user clicks the selection icon (value help icon) in the input field.

    The first input field in the value help dialog contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, or not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The second field in the value help dialog contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    The above mentioned guidance for filtering is applied to both the table and chart personalization.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Group

    The Group tab allows users to group the table data.

    In the select control, they can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Warning
    Only columns marked as visible on the Columns tab can be used for grouping!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Chart

    The Chart tab allows users to set the visibility of chart dimensions and measures and to change the order in which they are displayed.

    Users can add dimensions and measures with the select control or remove them by clicking the  (Remove dimension/measure) icon at the end of each chart item.

    They can enter multiple dimensions and measures. Once a dimension or measure is entered, a new line appears for entering another one.

    The order of the entered dimensions and measures reflects the order in which they are applied to the chart.

    Dimensions

    Each entry has two select controls: one for choosing the dimension, and one for choosing the layout option. The dialog is adapted to the currently selected chart type and shows layout options that work on the selected chart type.

    Measures

    In the select control, the user can select a needed measure from a list of all available measures.

    Reorder

    To change the order of the dimensions and measures, users focus on the list item and use the buttons on the right-hand side of the table toolbar to move it up or down or by dragging the dimension/measure to the desired location.

    Warning
    Users can select or change a chart type via the Smart Charts toolbar!
    Chart settings in the P13n dialog
    Chart settings in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in list-detail scenarios using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the list-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Users can (de)select all items using CTRL+A. Select All (de)selects all items that the user can reach by scrolling.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use this mode only if you really need two different click areas; a small one for a selection, and the rest of the item for something else.
    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
    • If selecting / deselecting all items is important for your app, add a button with the text Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the CONTEXT MENU KEY, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Errors and Warnings

    To indicate that the list contains items with errors or warnings, show a message strip above the list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    List containing errors
    List containing errors

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the list, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority, these are:

    • Add the item inline. Create an empty, editable item as the first item of the list. Show the Save button on the toolbar of the list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items with up to 8 input fields. Save the new item at dialog level.
    • Navigate to a new page. Only use this behavior for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the list. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level
      • Create with dialog: A list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved on list level, but rather with the entire draft.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action which applies to a part of a selection
    Message for an action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available for all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the list. Use the filter bar instead.
    • Only use the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Keep the view settings consistent. When a user reopens the app, show the list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort setting, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings located in the filter bar or in a select control placed in the toolbar of the list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.List, property: sticky).

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    View Settings Dialog

    The view settings dialog helps users to sort, filter, or group data within a list or a table. The dialog is triggered by icon buttons in the table toolbar.

    Usage

    We recommend making each feature (sort, filter, group) available as a separate button in the table toolbar (see Button Placement below). Each button then triggers a separate dialog. If specifically required, you can combine the dialogs into one with a segmented button acting as tabs to switch between the sort, filter and group options. Note: In a combined dialog, the Reset button resets all tabs.

    Use the view settings dialog if:

    • Users need to sort line items in a manageable list or table (up to about 20 columns).
    • You need to offer custom filter settings in a manageable list or table (up to about 20 columns).
    • Users need to group line items in a manageable list or table (up to about 20 columns).

    Do not use the view settings dialog if:

    • You have complex tables (more than about 20 columns).
    • Users need to rearrange columns within the table. Use the table personalization dialog instead.
    • Users need very specific sort, filter, or column sorting options within complex tables. Use the P13n dialog instead.

    Button Placement

    Use distinct icon buttons for the sort, filter, and group settings. Place the icons in the following order:   (Sort) (Filter)  (Group).

    Do not place Sort, Filter, or Group buttons in the footer toolbar if they refer to a table.

    For more information about the button placement, see Sort, Filter, Group (Generic) in the table toolbar article.

    Sort, Group, and Filter a List

    You can also offer the view setting features for a list.

    Responsiveness

    The popover dialog appears as a modal window on desktop and tablet screen sizes, but uses the full screen on smartphones.

    The view settings dialog is a composite control that consists of a modal dialog with a maximum of three tabs with lists of attributes. Each helps the user to either sort, filter, or group a table or list. If the use case requires only a sort feature, for example, you can hide the filter and group tabs.

    The dialog is triggered by one of the icon buttons in the table header
    The dialog is triggered by one of the icon buttons in the table header
    View settings dialog - Size S
    View settings dialog - Size S
    View settings dialog - Size M
    View settings dialog - Size M
    View settings dialog - Size L
    View settings dialog - Size L

    Behavior and Interaction

    The sort, filter, and group features can all be applied to a table simultaneously.

    Sort

    The sort dialog shows two groups of sort settings. The first group offers general Ascending and Descending sort options. The second group offers attributes that fit the use case, such as Product, Supplier, Weight, or Price. The attributes can match the table columns, but because a table column can also contain several data points, such as “Name” and “Surname”, the attributes allow an attribute to be shown for each data point.

    Users can select attributes using the radio buttons. Clicking OK closes the dialog and shows the table items in the selected order.

    If a combined dialog is used, the first tab is the sort feature.

    View settings dialog - Sort
    View settings dialog - Sort

    Filter

    The filter dialog can offer a single filter selection list, a multi-filter selection list, or a category list. The category list provides an overview, and allows the user to drill down to detailed filter selection lists.

    In a combined view settings dialog, filtering is on the second tab.

    Filter Selection List – Single Selection

    The dialog offers one selection list with radio buttons to select a filter. This list is useful for offering a list of preconfigured filters for a specific use, such as “Products with numbers ‘starting between 100 and 200’ with status ‘in stock’ and color ‘green’”.

    Filter Selection List – Multi-Selection

    You can also offer a multi-selection list. For example, a user might want to show all open items for both “Company A” and “Company D”.

    Show Selected Only

    If the user clicks the    button (Show Selected Only), only the selected filters are shown (for example, “Company A” and “Company D”). Clicking the button again shows all of the available filter values.

    Multiple filters selected
    Multiple filters selected
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown

    Category List

    The filter dialog shows a single list of general filter categories depending on the use case, like Price or Height. The user chooses a category by clicking the list item, such as Price. As this is a simple drilldown, these categories do not have radio buttons. The follow-on dialog shows a list of optional filter settings in the Price category. These filters, such as Less than 100, depend on the use case. The user chooses a specific filter setting by selecting one of the radio buttons offered in this list. Clicking OK closes the dialog and shows the table items filtered by the selected attribute. The infobar shows which filter has been set.

    Example: Filter Dialog with Category List

    1) Select a category
    1) Select a category
    2) Option to refine filters for the selected category (here: 'Weight')
    2) Option to refine filters for the selected category (here: 'Weight')
    3) Infobar showing the filter setting for a table view filtered by 'Weight'
    3) Infobar showing the filter setting for a table view filtered by 'Weight'

    Free-Form Apps

    You can also customize your own filter UIs, for example, to support date picking.

    Filter Values

    Filters can correspond to single values as well as groups, such as “<100.00 EUR”.

    Filter Reset

    The Reset button on the filter tab resets all filter settings.

    Removing Filters

    In single selection lists, offer a Not Filtered option. This enables users to remove existing filters.

    Group

    The group dialog shows two groups of attributes. The first group offers a general Ascending or Descending order, which allows the user to select the order in which the defined groups appear. The second group offers attributes that fit the use case, such as Type or Supplier.

    You can also offer an attribute like Price to group data in a table.

    Users can choose attributes using radio buttons or checkboxes. Clicking OK closes the dialog and shows the table with items grouped below headers.

    In a combined view settings dialog, the group feature is the third tab.

    Dialog for choosing an attribute from the group tab
    Dialog for choosing an attribute from the group tab
    Table view grouped by supplier – Group headers divide the list
    Table view grouped by supplier – Group headers divide the list

    Naming Group Headers

    Be sure to name the group headers as follows: <Category Name>: <Value/Range>

    Examples:

    • Category: Accessories
    • Supplier: Red Point Stores.

    Guidelines

    On the table toolbar, use different buttons for each function (sort, filter, group). With each button, open the View Settings dialog with just the corresponding tab.

    If possible, give users the option not to filter or group. For sorting, this is only necessary if the use case calls for an unsorted list. In all three cases, show this option as the first entry in the list of criteria (remember to include the brackets):

    • (Not Sorted)
    • (Not Filtered)
    • (Not Grouped)

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    The P13n dialog control tabs allow users to personalize table and smart chart attributes.

    Table Personalization Tabs

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    The tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    Smart Chart Personalization Tabs

    In addition to the Sort and Filter tabs, the P13n dialog for smart charts can include the Chart tab to allow users to set the visibility of chart dimensions and measures.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table or chart toolbar, as shown below.

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog can include the following tabs, separately or combined, as required by the use case:

    • Sort
    • Filter
    • Columns (available only for tables)
    • Group (available only for tables)
    • Chart (available only for the Smart Chart)

    App developers can add more tabs manually.

    Behavior and Interaction

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields:

    • One for choosing the sort column in a table or the sort dimension or measure in a smart chart
    • The second for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table or smart chart.

    Information

    • The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    • Using the sort feature for column headers replaces ALL sort options in the dialog!

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog

    Filter

    The Filter tab allows users to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    The above mentioned guidance for filtering is also applied to the chart personalization.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Group

    The Group tab allows users to group the table data.

    In the select control, they can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Warning
    Only columns marked as visible on the Columns tab can be used for grouping!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Chart

    The Chart tab allows users to set the visibility of chart dimensions and measures and to change the order in which they are displayed.

    Users can add dimensions and measures with the select control or remove them by clicking the  (Remove dimension/measure) icon at the end of each chart item.

    They can enter multiple dimensions and measures. Once a dimension or measure is entered, a new line appears for entering another one.

    The order of the entered dimensions and measures reflects the order in which they are applied to the chart.

    Dimensions

    Each entry has two select controls: one for choosing the dimension, and one for choosing the layout option. The dialog is adapted to the currently selected chart type and shows layout options that work on the selected chart type.

    Measures

    In the select control, the user can select a needed measure from a list of all available measures.

    Reorder

    To change the order of the dimensions and measures, users focus on the list item and use the buttons on the right-hand side of the table toolbar to move it up or down or by dragging the dimension/measure to the desired location.

    Warning
    Users can select or change a chart type via the Smart Charts toolbar!
    Chart settings in the P13n dialog
    Chart settings in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    P13n Dialog

    The P13n dialog control tabs allow users to personalize table and smart chart attributes.

    Table Personalization Tabs

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    The tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    Smart Chart Personalization Tabs

    In addition to the Sort and Filter tabs, the P13n dialog for smart charts can include the Chart tab to allow users to set the visibility of chart dimensions and measures.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table or chart toolbar, as shown below.

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog can include the following tabs, separately or combined, as required by the use case:

    • Sort
    • Filter
    • Columns (available only for tables)
    • Group (available only for tables)
    • Chart (available only for the Smart Chart)

    App developers can add more tabs manually.

    Behavior and Interaction

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields:

    • One for choosing the sort column in a table or the sort dimension or measure in a smart chart
    • The second for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table or smart chart.

    Information

    • The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    • Using the sort feature for column headers replaces ALL sort options in the dialog!

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog

    Filter

    The Filter tab allows users to filter the table or chart information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The second field in the value help dialog contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    The above mentioned guidance for filtering is also applied to both the table and chart personalization.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Group

    The Group tab allows users to group the table data.

    In the select control, they can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Warning
    Only columns marked as visible on the Columns tab can be used for grouping!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Chart

    The Chart tab allows users to set the visibility of chart dimensions and measures and to change the order in which they are displayed.

    Users can add dimensions and measures with the select control or remove them by clicking the  (Remove dimension/measure) icon at the end of each chart item.

    They can enter multiple dimensions and measures. Once a dimension or measure is entered, a new line appears for entering another one.

    The order of the entered dimensions and measures reflects the order in which they are applied to the chart.

    Dimensions

    Each entry has two select controls: one for choosing the dimension, and one for choosing the layout option. The dialog is adapted to the currently selected chart type and shows layout options that work on the selected chart type.

    Measures

    In the select control, the user can select a needed measure from a list of all available measures.

    Reorder

    To change the order of the dimensions and measures, users focus on the list item and use the buttons on the right-hand side of the table toolbar to move it up or down or by dragging the dimension/measure to the desired location.

    Warning
    Users can select or change a chart type via the Smart Charts toolbar!
    Chart settings in the P13n dialog
    Chart settings in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    P13n Dialog

    The P13n dialog control tabs allow users to personalize table and smart chart attributes.

    Table Personalization Tabs

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    The tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    Smart Chart Personalization Tabs

    In addition to the Sort and Filter tabs, the P13n dialog for smart charts can include the Chart tab to allow users to set the visibility of chart dimensions and measures.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table or chart toolbar, as shown below.

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog can include the following tabs, separately or combined, as required by the use case:

    • Sort
    • Filter
    • Columns (available only for tables)
    • Group (available only for tables)
    • Chart (available only for the Smart Chart)

    App developers can add more tabs manually.

    Behavior and Interaction

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields:

    • One for choosing the sort column in a table or the sort dimension or measure in a smart chart
    • The second for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table or smart chart.

    Information

    • The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    • Using the sort feature for column headers replaces ALL sort options in the dialog!

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog

    Filter

    The Filter tab allows users to filter the table or chart information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The second field in the value help dialog contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    The above mentioned guidance for filtering is also applied to both the table and chart personalization.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Group

    The Group tab allows users to group the table data.

    In the select control, they can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Information
    The new P13n panels from the SmartTable (ColumnsSortGroup) are now available for freestyle application development.
    Warning
    Only columns marked as visible on the Columns tab can be used for grouping!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Chart

    The Chart tab allows users to set the visibility of chart dimensions and measures and to change the order in which they are displayed.

    Users can add dimensions and measures with the select control or remove them by clicking the  (Remove dimension/measure) icon at the end of each chart item.

    They can enter multiple dimensions and measures. Once a dimension or measure is entered, a new line appears for entering another one.

    The order of the entered dimensions and measures reflects the order in which they are applied to the chart.

    Dimensions

    Each entry has two select controls: one for choosing the dimension, and one for choosing the layout option. The dialog is adapted to the currently selected chart type and shows layout options that work on the selected chart type.

    Measures

    In the select control, the user can select a needed measure from a list of all available measures.

    Reorder

    To change the order of the dimensions and measures, users focus on the list item and use the buttons on the right-hand side of the table toolbar to move it up or down or by dragging the dimension/measure to the desired location.

    Warning
    Users can select or change a chart type via the Smart Charts toolbar!
    Chart settings in the P13n dialog
    Chart settings in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    P13n Dialog

    Warning
    The sap.m.P13nDialog control has been deprecated. See the new control sap.m.p13n.Popup.

    Intro

    The p13n dialog control allows users to personalize one or more of the following table attributes:

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    These tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table toolbar.

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields: one for choosing the sort column, and one for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature for column headers replaces ALL sort options in the dialog!

    Filter

    The Filter tab allows users to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Group

    The Group tab can be used to group the table data.

    In the selection field, the user can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Warning
    To group by a specific column, that particular column must be marked as visible on the Columns tab!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    Message Handling – Processing Multiple Items

    When a user selects multiple items from a table, it might not be possible to process all of the items at once.

    Users therefore need clear and user-friendly information on:

    • The actions available for the selected items
    • Any issues that prevent items from being processed
    • Whether or not an action was successful for all items

    Scenarios

    This guideline outlines the message patterns and recommended message texts for the following scenarios:

    • Success: All items were processed successfully
    • Failure: No items can be processed / were processed
    • Partial Processing: Only some items can be processed. Others can’t be processed or require manual validation.

    Enabling/Disabling Actions

    Guidelines
    Enable an action that:

    • Always works, regardless of whether or not items are selected
    • Can be applied to at least one of the selected items

    Disable an action that:

    • Can’t be applied to any of the selected items
    • Doesn’t correspond to the number of selected items. For example, disable Compare if only one item is selected

    For more details, see UI Element States.

    After the action is applied, keep the items selected.

    Success

    If all items were processed successfully, show a message toast.

    Body text: <number of items> <item name> were <action>.
    Example: 20 sales orders were released.

    Message toast
    Message toast

    Failure Cases

    No items can be processed

    Disable the action button. For example, if all the selected items are locked, disable the Edit button.

    To help users understand why the action button is disabled, use the item states.

    Disabled edit button
    Disabled edit button

    No items were processed

    Show a message view in a dialog, listing the issues.

    • As the first entry in the list, show a generic error message indicating that no items were processed.
    • Below, show the specific messages for the items that weren’t processed.

    Dialog header: Summary

    Generic error message text (top of list): No <item name> were <action>.
    Example: No sales orders were released.

    Message view with errors only
    Message view with errors only

    Partial Processing

    Backend issues

    One or more of the selected items were processed successfully and one or more were not, due to backend issues.

    Show a message view dialog to list the results.

    Start the list with a success message that counts the successfully processed items. Next, list the errors and warnings for the items.

    Dialog header: Summary

    Generic success message text (top of list):
    <number of successful items> of <total number of items> <item name> were <action>.
    Example: 8 of 10 sales orders were released.

    Message view with a mix of success, error, and warnings messages
    Message view with a mix of success, error, and warnings messages

    One or more items can’t be processed

    Before processing, if the action cannot be applied to one or more items, a warning dialog asks the user for a decision.

    Message box type: Warning

    Message text: <number of items ineligible for the action> of <total number of items> <item name> can’t be <action>.
    Do you still want to <action> the remaining <number of editable items> <item name>?
    Example: 4 of 10 sales orders can’t be edited.
    Do you still want to edit the remaining 6 sales orders?

    Message details:
    Possible Causes
    Selected <item name> are excluded if:
    Somebody is working on the <item name> (a draft exists or changes haven’t been saved).
    <action> is not allowed on the <item name>.

    Buttons: <primary action>, Cancel

    Example:

    • Somebody is working on the sales order (a draft exists or changes haven’t been saved).
    • Editing isn’t allowed on the sales order.

    If the user confirms the action for the remaining items and, after processing:

    • All these items were successfully processed, a message toast summarizes the operation
    • At least one backend error caused a remaining item to fail, the message view dialog with a summary appears
    Messaging sequence for items that can't be processed
    Messaging sequence for items that can't be processed

    Processing is blocked by items that require manual validation

    Some warnings for individual items may require a user decision before processing can continue.

    There are two cases:

    • Case 1: Just one warning. The user can ignore the warning and process the item, or skip the item.
    • Case 2: Multiple warnings. The user can ignore the warnings and process all the items, or skip all the affected items. Processing is only interrupted once.

    Case 1: One Item

    When one item requires manual validation, show a warning message box with actions to either process or skip the item.

    Message box type: Warning

    Body text:
    <item name> <item ID>: <message description>
    You can <action> this <item name> anyway, or skip it for now.
    Show Details (optional)

    Buttons: <primary action>, Skip

    If the user skips the item, show a corresponding information message in the summary dialog.

    Information message text:
    The <item name> was skipped and not <action>.
    Example: The sales order was skipped and not released.

    Manual validation flow for one item (message box)
    Manual validation flow for one item (message box)

    Case 2: More than One

    When more than one item requires manual validation, show a message view in a message dialog with options to process or skip all the items.

    • As the first entry in the list, show a generic message indicating that warnings exist. In the message details, explain the two options.
    • Below the first entry, show the specific warnings for the individual items.

    Message dialog type: Warning

    Generic warning message text (top of list): Warnings exist for some of the selected <item name, plural>.

    Message details: You can choose “<primary action>” to ignore the warnings, or skip these <item name, plural> for now.

    Buttons: <primary action>, Skip

    The primary action validates all the items at once.

    If the user skips the items, show corresponding information messages for each item in the summary dialog.

    Information message text (per skipped item):
    The <item name> was skipped and not <action>.
    Example: The sales order was skipped and not released.

    Manual validation flow for several items (message view)
    Manual validation flow for several items (message view)

    Action on multiple items with field issues in edit mode

    Triggering a mass action can reveal field issues because the mass action also triggers field validation.

    List the field related messages among other messages in the summary dialog.

    Once the dialog is closed, the message popover appears, with a list of only the field issues.

    Action on multiple items with field errors in edit mode
    Action on multiple items with field errors in edit mode

    Related Links

    Elements and Controls

    Implementation

  • No links.
  • Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. For smartphones, you need to take an adaptive approach by offering an additional UI.

    Possible solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Errors and Warnings

    To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch interaction devices, but is not optimized for small screens. If you use an analytical table, you need to take an adaptive approach by offering an additional UI for smartphones.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Total setting in column header menu
    Total setting in column header menu

    The overall aggregation is shown at the bottom of the analytical table.

    Overall aggregation
    Overall aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Message Handling – Processing Multiple Items

    When multiple items are selected, it might not be possible to process all of the items at once.

    Users therefore need clear and user-friendly feedback on:

    • The available actions
    • Whether or not an action was successful for all items
    • Any issues that prevent items from being processed

    Scenarios

    This guideline outlines the message patterns and recommended message texts for the following scenarios:

    • Success: All items were processed successfully
    • Failure: No items can be processed / were processed
    • Partial Processing: Only some items can be processed. Others can’t be processed or require manual validation.

    Success

    If all items were processed successfully, show a message toast.

    Body text: <number of objects> <objects> were <action>.
    Example: 20 sales orders were released.

    Message toast
    Message toast

    Failure Cases

    None of the items can be processed

    Disable the action button. For example, if all the selected items are locked, disable the Edit button.

    To help users understand why the action button is disabled, use the item states.

    Disabled edit button
    Disabled edit button

    None of the items were processed

    Show a message view in a dialog, listing the issues.

    • As the first entry in the list, show a generic error message indicating that no items were processed.
    • Below, show the specific messages for the items that weren’t processed.

    Dialog header: Summary

    Generic error message text (top of list): No <objects> were <action>.
    Example: No sales orders were released.

    Message view with errors only
    Message view with errors only

    Partial Processing

    If one or more of the selected items can’t be processed, show a message view in a dialog as a summary at the end of the process.

    • As the first entry in the list, show a success message indicating the number of items that were processed successfully.
    • Below, show the specific messages for the items with issues.

    Dialog header: Summary

    Generic success message text (top of list): <number of successful objects> of <total number of objects> <objects> were <action>.
    Example: 8 of 10 sales orders were released.

    Message view with a mix of success, error, and warnings messages
    Message view with a mix of success, error, and warnings messages

    Processing is blocked by items that require manual validation

    Some warnings for individual items may require a user decision before processing can continue.

    There are two cases:

    • Case 1: Just one warning. The user can ignore the warning and process the item, or skip the item.
    • Case 2: Multiple warnings. The user can ignore the warnings and process all the items, or skip all the affected items. Processing is only interrupted once.

    Case 1: One item requires manual validation

    Show a warning message box with actions to process or skip the item.

    Message box type: Warning

    Body text:

    <object> <object ID>: <message description>

    You can process this item anyway, or skip it for now.

    Show Details (optional)

    Buttons: <Primary action>, Skip

    If the user skips the item, show a corresponding information message in the summary dialog.

    Information message text (per skipped item):
    The <object> was skipped and not <action>.
    <object ID>
    Example:
    The sales order was skipped and not released.
    500009070

    Manual validation flow for one item (message box)
    Manual validation flow for one item (message box)

    Case 2: Several items require manual validation

    Show a message view in a message dialog with options to process or skip all the items.

    • As the first entry in the list, show a generic message indicating that warnings exist. In the message details, explain the two options.
    • Below the first entry, show the specific warnings for the individual items.

    Message dialog type: Warning

    Generic warning message text (top of list): Warnings exist for some of the selected items.

    Message details: You can choose “<primary action>” to ignore the warnings, or skip these items for now.

    Buttons: <primary action>, Skip

    The primary action validates all the items at once.

    If the user skips the items, show corresponding information messages for each item in the summary dialog.

    Information message text (per skipped item):
    The <object> was skipped and not <action>.
    <object ID>
    Example:
    The sales order was skipped and not released.
    500009070

    Manual validation flow for several items (message view)
    Manual validation flow for several items (message view)

    Related Links

    Elements and Controls

    Implementation

  • No links.
  • Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    Displaying a title is optional (property: header).

    Guidelines

    • Add a title whenever the title is not indicated in the surrounding area.
    • If you don’t display a title, ensure that you still provide a table title for screen reader users.

    Developer Hint
    If there is no title title, support screen reader users as follows: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    The Show Details / Hide Details button is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, enableAutoColumnWidth, showDetailsButton, annotation: UI.Importance).

    You can define which priority levels cause the columns to be hidden (property: detailsButtonSettings). The button only appears if there are columns that belong in the pop-in area. Columns disappear from right to left but columns with the priority “High”, are never hidden. They are shown in the pop-in area if they do not fit on the current screen size

    Details hidden
    Details hidden
    Details shown
    Details shown

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    Responsive table within a smart table
    Responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
      The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
      If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
    Guidelines
    Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
    Developer Hint
    For the responsive table, enableAutoColumnWidth also applies the following changes:

    • The smart table property demandPopin is set to true.
    • The responsive table property fixedLayout is set to Strict.
    • The responsive table property contextualWidth is set to Auto.
    • Column resizing is enabled for all columns (including custom columns).
    • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

    In this case, the properties above must not be managed by the app.

    Responsive table with automatically calculated column widths, resizing, and remaining space
    Responsive table with automatically calculated column widths, resizing, and remaining space
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    • SAP S/4HANA Only:
      Tooltips are available by default for smart table column headers.
      In smart tables, texts that exceed the column width always truncate (see Column Layout). The tooltip allows users to read the full column header text without resizing.
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort AscendingSort Descending
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table offers the following options for creating columns automatically:

    1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
    2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields
    Developer Hint
    From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

    • For read-only tables, use the controls provided by the smart table.
    • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
    • For more complex editing cases, use smart fields.
    • For switching between read-only and edit modes:
      • In read-only mode, use the controls provided by the smart table.
      • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

    In cases where the controls are rendered by the smart table, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field Criticality, CriticalityType,
    CriticalityRepresentationType
    Do not use editable status information.
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

    Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Table containing warnings
    Table containing warnings
    Table containing errors and warnings
    Table containing errors and warnings
    Guidelines
    To show that an item contains an error,

    Developer Hint
    Binding-related messages are shown automatically.

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Developer Hint

    • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that the analytical table isn’t fully responsive and is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table minimizes all visible columns until they are no longer readable. The priority level assigned to columns also impacts the display of the responsive table. For more information on the priority levels, see: Smart Table

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in area. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in area first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in area (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in area for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in content)
    A more complex responsive table (full screen without pop-in content)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in content wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column. In addition, it allows the user to resize the column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Note: Line items can still use the sap.m.ListType “navigation”, which allows click handling for specific line items. Only use this option if the click triggers navigation to a corresponding details page.
    • Single select master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single select left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
    • Multi select: Users can select one or more items using the checkboxes on the left of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).
      Another multi select variant is to not provide a Select All option, but just a Clear All check box in the same place (property: multiSelectMode, value: ClearAll).

    Keyboard: If the focus is on a row, the space bar selects the corresponding item.

    Responsive table without selectable items
    Responsive table without selectable items
    Single select master
    Single select master
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    Multi select with 'Select All' checkbox
    Multi select with 'Select All' checkbox
    Multi select with 'Clear All' button
    Multi select with 'Clear All' button

    Group

    When items are grouped, a group header is displayed. The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Don’t show aggregations in “growing” mode. In growing mode it isn’t clear which values are being aggregated; only the items currently loaded in the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can be triggered either by scrolling (preferred) or by clicking the More button.

    If you use the More button, show the number of items already loaded and the total number items below the More text, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Column Header Level

    The column header provides the label for the corresponding column. It also handles the functionality for resizing columns.

    Resizing Columns

    If you implement column resizing, users can resize the columns as follows:

    • Mouse interaction: The user drags the separator line between two columns. Double-clicking the line optimizes the column width based on the length of the currently visible data and the label of the column header.
    • Touch interaction: As for mouse interaction, but with a larger target touch area.
    • Keyboard interaction: When the focus is on the column header, Shift+Right increases the width of the focused column. Shift+Left decreases the width.

    When a column is resized, the other columns can keep their original width or adapt their width. This depends on the column width settings:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and the columns that follow are moved accordingly. The width of all the other columns is not affected. If the visible columns don’t use the full width of the table control, empty space is added. If the visible columns exceed the width of the table control, one or more columns move to the pop-in area.
    • If all column widths are set as a percentage or as “auto”, resizing one column might also result in automatic resizing of some or all other columns. The position of the resized column might also be affected. This ensures that the full table width is used and no white space is added.
    Developer Hint
    To enable resizable columns, implement the plugin:
    sap.m.plugins.ColumnResizer.
    Resizing a column
    Resizing a column

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    For single selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for list-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

    In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode:

    • Prefer Select All over Clear All
    • Use Clear All only for tables with a large number of items (more than recommended above), where loading all items to select them would harm performance.
    • To avoid confusion, don’t show checkboxes in the first data column in the default delivery.
    • Make sure that the Select All checkbox (de)selects all items the user can reach by scrolling. This is only possible if all items are rendered.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors
    Table containing errors

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

    Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with empty space.

    Optimize the column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize the column width for typical content.

    When defining the column width, consider the implications when a column is resized:

    • If you define the column width in pixels or rem, resizing a column only affects the width of that particular column.
      • If the table isn’t wide enough to show all the columns after a column has been resized, one or more of follow-on columns move into the pop-in area.
      • If the columns don’t use up the available space, white space appears to the right of the last column (property: fixedLayout, value: strict).
      • If only one column remains, and the width of this column exceeds the width of the table itself, the width of the column is reduced to the width of the table.
    • If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text wraps more when the browser window size is reduced. This ensures that all columns together make use of the full table width.
    • If you define the column width as “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.
    • Be cautious of mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when columns are resized. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Don't
    Do not distribute just a few columns across the full width
    Do not distribute just a few columns across the full width
    Do
    Use a fixed column width instead
    Use a fixed column width instead

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    To keep the column headers readable, wrap or truncate the texts as follows:

    • If columns are not resizable, use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.
    • If columns are resizable, use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers if columns are not resizable
    Wrap column headers if columns are not resizable
    Do
    Truncate column headers if columns are resizable
    Truncate column headers if columns are resizable

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Align buttons with the content hierarchically

    Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Displaying Boolean Values

    If a column contains Boolean values, such as “Yes” or “No”, show a read-only checkbox next to the texts.

    The supplementary checkbox makes it easier for users to see at a glance which items are “true” (checked) and which are “false” (unchecked).

     

    Developer Hint

    Use sap.m.checkbox with the Horizon theme and set the editable property to “false” to get the read-only variant. Add the checkbox next to the existing text value. The text itself should remain unchanged.

    Avoid showing only text for Boolean values
    Avoid showing only text for Boolean values
    Boolean values with read-only checkboxes for easier scanning
    Boolean values with read-only checkboxes for easier scanning

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight). A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Currently, there is no keyboard support for drag and drop.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization: Add, Remove, Rearrange Columns

    To enable users to add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the main list for a list-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: Only one item is selected.
    Single selection: Only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that Ctrl+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in 'delete' mode
    Tree in 'delete' mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with the “single select master” mode.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - Context menu
    Tree - Context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Errors and Warnings

    To indicate that the tree contains items with errors or warnings, show a message strip above the tree. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Tree containing errors
    Tree containing errors

    Content

    Content Formatting

    To display object names with an ID, show the ID in parentheses after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with 'Delete' button
    Items with 'Delete' button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the tree toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable item as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios where just a few input fields have to be filled.
    2. Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the tree.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at tree level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Information
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the tree in a meaningful way when it first loads.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. It’s not fully responsive though, so it’s only available for desktop and tablet – you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.
    • Your use case requires grouping – the grid table doesn’t support grouping.

    Responsiveness

    A grid table is available for desktops and tablets, and it supports touch devices.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
    Text and ID in two columns – Allows users to sort and filter both separately
    Text and ID in two columns – Allows users to sort and filter both separately
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort and/or Filter settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
    • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

     

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Total setting in column header menu
    Total setting in column header menu

    The overall aggregation is shown at the bottom of the analytical table.

    Overall aggregation
    Overall aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string. A row with errors should be highlighted in all use cases – for example when the field is visible in the row in edit mode.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Errors and Warnings

    To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. It’s not fully responsive though, so it’s only available for desktop and tablet – you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.
    • Your use case requires grouping – the grid table doesn’t support grouping.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
    Text and ID in two columns – Allows users to sort and filter both separately
    Text and ID in two columns – Allows users to sort and filter both separately
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort and/or Filter settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
    • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

     

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    Warning
    The sap.m.P13nDialog control has been deprecated. See the new control sap.m.p13n.Popup.

    Intro

    The p13n dialog control allows users to personalize one or more of the following table attributes:

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    These tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table toolbar.

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields: one for choosing the sort column, and one for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature for column headers replaces ALL sort options in the dialog!

    Filter

    The Filter tab allows users to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Group

    The Group tab can be used to group the table data.

    In the selection field, the user can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Warning
    To group by a specific column, that particular column must be marked as visible on the Columns tab!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    Displaying a title is optional (property: header).

    Guidelines

    • Add a title whenever the title is not indicated in the surrounding area.
    • If you don’t display a title, ensure that you still provide a table title for screen reader users.

    Developer Hint
    If there is no title title, support screen reader users as follows: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    Show Details / Hide Details is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, showDetailsButton, annotation: UI.Importance). You can define which column priority levels are hidden (property: detailsButtonSettings). The button only appears if there are corresponding columns in the pop-in area.

    Details hidden
    Details hidden
    Details shown
    Details shown

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    Responsive table within a smart table
    Responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
      The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
      If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
    Guidelines
    Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
    Developer Hint
    For the responsive table, enableAutoColumnWidth also applies the following changes:

    • The smart table property demandPopin is set to true.
    • The responsive table property fixedLayout is set to Strict.
    • The responsive table property contextualWidth is set to Auto.
    • Column resizing is enabled for all columns (including custom columns).
    • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

    In this case, the properties above must not be managed by the app.

    Responsive table with automatically calculated column widths, resizing, and remaining space
    Responsive table with automatically calculated column widths, resizing, and remaining space
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    • SAP S/4HANA Only:
      Tooltips are available by default for smart table column headers.
      In smart tables, texts that exceed the column width always truncate (see Column Layout). The tooltip allows users to read the full column header text without resizing.
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort AscendingSort Descending
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table offers the following options for creating columns automatically:

    1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
    2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields
    Developer Hint
    From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

    • For read-only tables, use the controls provided by the smart table.
    • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
    • For more complex editing cases, use smart fields.
    • For switching between read-only and edit modes:
      • In read-only mode, use the controls provided by the smart table.
      • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

    In cases where the controls are rendered by the smart table, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field Criticality, CriticalityType,
    CriticalityRepresentationType
    Do not use editable status information.
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

    Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Table containing warnings
    Table containing warnings
    Table containing errors and warnings
    Table containing errors and warnings
    Guidelines
    To show that an item contains an error,

    Developer Hint
    Binding-related messages are shown automatically.

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Developer Hint

    • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. It’s not fully responsive though, so it’s only available for desktop and tablet – you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You’re going to implement inline creation and the sequence in which the items are created is important – the grid table creates new items at the bottom of the table.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.
    • Your use case requires grouping – the grid table doesn’t support grouping.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows. Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, or if they need to filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting and filtering, either the string or the ID. This option is then used for all sort and filter actions and can’t be changed later by the user. Use this format only if users don’t need to sort and filter by both the string and the ID.
    Text and ID in two columns – Allows users to sort and filter both separately
    Text and ID in two columns – Allows users to sort and filter both separately
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column – Sorting and filtering is available for either the text or the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting and filtering by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting and filtering by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort and filter criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort and filter settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting or filtering, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort and/or Filter settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting.
    • Table personalization dialog: Provides complex options for sorting items by several levels. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the user settings: When reopening the app, show the grid table with the same sort and filter settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

     

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. However, please note that the grid table doesn’t provide grouping, aggregation options, and is not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Total setting in column header menu
    Total setting in column header menu

    The overall aggregation is shown at the bottom of the analytical table.

    Overall aggregation
    Overall aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that the analytical table isn’t fully responsive and is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in area. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in area first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in area (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in area for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in content)
    A more complex responsive table (full screen without pop-in content)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in content wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column. In addition, it allows the user to resize the column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Note: Line items can still use the sap.m.ListType “navigation”, which allows click handling for specific line items. Only use this option if the click triggers navigation to a corresponding details page.
    • Single select master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single select left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
    • Multi select: Users can select one or more items using the checkboxes on the left of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).
      Another multi select variant is to not provide a Select All option, but just a Clear All check box in the same place (property: multiSelectMode, value: ClearAll).

    Keyboard: If the focus is on a row, the space bar selects the corresponding item.

    Responsive table without selectable items
    Responsive table without selectable items
    Single select master
    Single select master
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    Multi select with 'Select All' checkbox
    Multi select with 'Select All' checkbox
    Multi select with 'Clear All' button
    Multi select with 'Clear All' button

    Group

    When items are grouped, a group header is displayed. The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Don’t show aggregations in “growing” mode. In growing mode it isn’t clear which values are being aggregated; only the items currently loaded in the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can be triggered either by scrolling (preferred) or by clicking the More button.

    If you use the More button, show the number of items already loaded and the total number items below the More text, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Column Header Level

    The column header provides the label for the corresponding column. It also handles the functionality for resizing columns.

    Resizing Columns

    If you implement column resizing, users can resize the columns as follows:

    • Mouse interaction: The user drags the separator line between two columns. Double-clicking the line optimizes the column width based on the length of the currently visible data and the label of the column header.
    • Touch interaction: As for mouse interaction, but with a larger target touch area.
    • Keyboard interaction: When the focus is on the column header, Shift+Right increases the width of the focused column. Shift+Left decreases the width.

    When a column is resized, the other columns can keep their original width or adapt their width. This depends on the column width settings:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and the columns that follow are moved accordingly. The width of all the other columns is not affected. If the visible columns don’t use the full width of the table control, empty space is added. If the visible columns exceed the width of the table control, one or more columns move to the pop-in area.
    • If all column widths are set as a percentage or as “auto”, resizing one column might also result in automatic resizing of some or all other columns. The position of the resized column might also be affected. This ensures that the full table width is used and no white space is added.
    Developer Hint
    To enable resizable columns, implement the plugin:
    sap.m.plugins.ColumnResizer.
    Resizing a column
    Resizing a column

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    For single selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for list-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

    In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode:

    • Prefer Select All over Clear All
    • Use Clear All only for tables with a large number of items (more than recommended above), where loading all items to select them would harm performance.
    • To avoid confusion, don’t show checkboxes in the first data column in the default delivery.
    • Make sure that the Select All checkbox (de)selects all items the user can reach by scrolling. This is only possible if all items are rendered.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors
    Table containing errors

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

    Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with empty space.

    Optimize the column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize the column width for typical content.

    When defining the column width, consider the implications when a column is resized:

    • If you define the column width in pixels or rem, resizing a column only affects the width of that particular column.
      • If the table isn’t wide enough to show all the columns after a column has been resized, one or more of follow-on columns move into the pop-in area.
      • If the columns don’t use up the available space, white space appears to the right of the last column (property: fixedLayout, value: strict).
      • If only one column remains, and the width of this column exceeds the width of the table itself, the width of the column is reduced to the width of the table.
    • If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text wraps more when the browser window size is reduced. This ensures that all columns together make use of the full table width.
    • If you define the column width as “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.
    • Be cautious of mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when columns are resized. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Don't
    Do not distribute just a few columns across the full width
    Do not distribute just a few columns across the full width
    Do
    Use a fixed column width instead
    Use a fixed column width instead

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    To keep the column headers readable, wrap or truncate the texts as follows:

    • If columns are not resizable, use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.
    • If columns are resizable, use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers if columns are not resizable
    Wrap column headers if columns are not resizable
    Do
    Truncate column headers if columns are resizable
    Truncate column headers if columns are resizable

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Align buttons with the content hierarchically

    Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization: Add, Remove, Rearrange Columns

    To enable users to add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Message Handling – Processing Multiple Items

    When multiple items are selected, it might not be possible to process all of the items at once.

    Users therefore need clear and user-friendly feedback on:

    • The available actions
    • Whether or not an action was successful for all items
    • Any issues that prevent items from being processed

    Scenarios

    This guideline outlines the message patterns and recommended message texts for the following scenarios:

    • Success: All items were processed successfully
    • Failure: No items can be processed / were processed
    • Partial Processing: Only some items can be processed. Others can’t be processed or require manual validation.

    Success

    If all items were processed successfully, show a message toast.

    Body text: <number of objects> <objects> were <action>.
    Example: 20 sales orders were released.

    Message toast
    Message toast

    Failure Cases

    None of the items can be processed

    Disable the action button. For example, if all the selected items are locked, disable the Edit button.

    To help users understand why the action button is disabled, use the item states.

    Disabled edit button
    Disabled edit button

    None of the items were processed

    Show a message view in a dialog, listing the issues.

    • As the first entry in the list, show a generic error message indicating that no items were processed.
    • Below, show the specific messages for the items that weren’t processed.

    Dialog header: Summary

    Generic error message text (top of list): No <objects> were <action>.
    Example: No sales orders were released.

    Message view with errors only
    Message view with errors only

    Partial Processing

    If one or more of the selected items can’t be processed, show a message view in a dialog as a summary at the end of the process.

    • As the first entry in the list, show a success message indicating the number of items that were processed successfully.
    • Below, show the specific messages for the items with issues.

    Dialog header: Summary

    Generic success message text (top of list): <number of successful objects> of <total number of objects> <objects> were <action>.
    Example: 8 of 10 sales orders were released.

    Message view with a mix of success, error, and warnings messages
    Message view with a mix of success, error, and warnings messages

    Processing is blocked by items that require manual validation

    Some warnings for individual items may require a user decision before processing can continue.

    There are two cases:

    • Case 1: Just one warning. The user can ignore the warning and process the item, or skip the item.
    • Case 2: Multiple warnings. The user can ignore the warnings and process all the items, or skip all the affected items. Processing is only interrupted once.

    Case 1: One item requires manual validation

    Show a warning message box with actions to process or skip the item.

    Message box type: Warning

    Body text:

    <object> <object ID>: <message description>

    You can process this item anyway, or skip it for now.

    Show Details (optional)

    Buttons: <Primary action>, Skip

    If the user skips the item, show a corresponding information message in the summary dialog.

    Information message text (per skipped item):
    The <object> was skipped and not <action>.
    <object ID>
    Example:
    The sales order was skipped and not released.
    500009070

    Manual validation flow for one item (message box)
    Manual validation flow for one item (message box)

    Case 2: Several items require manual validation

    Show a message view in a message dialog with options to process or skip all the items.

    • As the first entry in the list, show a generic message indicating that warnings exist. In the message details, explain the two options.
    • Below the first entry, show the specific warnings for the individual items.

    Message dialog type: Warning

    Generic warning message text (top of list): Warnings exist for some of the selected items.

    Message details: You can choose “<primary action>” to ignore the warnings, or skip these items for now.

    Buttons: <primary action>, Skip

    The primary action validates all the items at once.

    If the user skips the items, show corresponding information messages for each item in the summary dialog.

    Information message text (per skipped item):
    The <object> was skipped and not <action>.
    <object ID>
    Example:
    The sales order was skipped and not released.
    500009070

    Manual validation flow for several items (message view)
    Manual validation flow for several items (message view)

    Related Links

    Elements and Controls

    Implementation

  • No links.
  • Grid List

    The grid list displays a set of items. Whereas the list and the responsive table display the items in rows, the grid list displays the items as rectangular boxes on a grid. This makes it ideal for displaying visual content, such as images, charts, or object cards.

    Grid list
    Grid list

    When to Use

    Use the grid list if:

    • You want to display a set of homogeneous items.
    • The rectangular format of the items is better suited to your content than tables or lists.
    • The focus is on complete items, not cells.
    • Your items mimic the format of existing objects (such as business cards).
    • Users need to sort, group, or filter the items.

    Don’t use the grid list if:

    • Your content isn’t suitable for a card-like format. If you need to display a lot of detail or if your content is very text-heavy, use a table instead.
    • You expect to show more than 1.000 items. For better performance, use the grid table or analytical table instead.
    • You need an overview of a large amount of data. In this case, consider using a chart.
    • You only need the grid-style layout. In this case, use a layout container, such as the flexible grid.

    Components

    Grid list components
    Grid list components

    1. Title bar or toolbar
    2. Filter infobar (optional)
    3. Items
    4. More button (optional)
    5. Footer (optional)

    1. Title Bar

    The title bar contains the title of the grid list and an item counter.

    Instead of a a title bar, you can use a toolbar. The toolbar can have the following elements:


    Title bar
    Title bar
    Toolbar instead of title bar
    Toolbar instead of title bar
    Guidelines

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, you can also use a generic title text, such as Items.
    • Don’t show the title bar at all if all elements are available in the surrounding area (title, item count, variant management, toolbar).
      Example: An object page section contains only one grid list. In this case, add the item count and the toolbar to the section header.
    • For the item count, apply the following:
      • Use the format: [title text] ([count])
        Example: Items (234)
      • Include all the items that a user can reach by scrolling, except group headers.
      • Remove the item count if there are no items.
      • If you are using a More button, don’t show a count on the title bar. Show the count below the More button instead.
    • Keep the title bar sticky (sap.f.GridList, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    2. Filter Infobar (Optional)

    The filter infobar shows information on the filter settings.

    Filter infobar
    Filter infobar
    Guidelines
    Display the filter infobar when the grid list is filtered.

    3. Items

    A grid list item can contain any content. This can include single controls or a combination of controls (for example, using layout containers).

    A grid list can contain different item types. For example:

    • Sales orders and purchase orders
    • Items in display mode and single items in edit mode

    You can highlight items and show an item state (such as “unread” or “locked”).

    Example of a grid list item
    Example of a grid list item
    Guidelines

    • Ensure that items can be identified. For example, add a title and subtitle.
    • If the item has an ID and a description, use the title for the description and the subtitle for the ID.
    • Avoid truncation. Use wrapping instead.
    • Since no specific item templates are available, we recommend following the guidelines for object cards.

    Another example of a grid list item
    Another example of a grid list item

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator to the left of the item.
    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item
    Guidelines

    • Use highlighting to indicate:
      • A semantic state, such as red for an error or orange for a warning. In this case, use semantic colors.
      • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
      • Industry- / process-specific states, such as “Out of Stock” or “Excess of Inventory”. In this case, use indication colors.
    • Provide information within the item to explain why it is highlighted, ideally in the same color. The highlight is just a visual cue. It doesn’t tell users why the item has been highlighted.
    • For more details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    Item States

    Show the different item states as follows:

    State

    Unread

    How to Display

    Shows most content in bold.

    sap.f.GridList
    property: showUnread

    sap.f.GridListItem
    property: unread

    Unread item next to a read item
    Unread item next to a read item
    Guidelines

    Add the string (Modified) near the item identifier.

    A modified item
    A modified item

    Error

    Add the string (Contains errors) near the item identifier.

    sap.m.ObjectStatus
    Property: state
    Value: sap.ui.core.ValueState.Error


    Highlight the item accordingly

    sap.f.GridListItem
    property: highlight

    An item with an error
    An item with an error

    Locked

    Add a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier.

    Clicking the button opens a quick view of the person.

    A locked item
    A locked item

    Add a transparent button with the text Draft near the item identifier.

    Clicking the button opens a popover showing the timestamp of the last change.

    An item in a draft state
    An item in a draft state

    “More” Button (Optional)

    The More button loads more items. The count below the button indicates the items displayed and the total number of items.

    'More' button
    'More' button

    Footer (Optional)

    You can use the footer to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    This section covers the following topics:

    In addition, see the following guidelines for the responsive table:

    Loading Items

    You can load the grid list in “growing” mode.

    In “growing” mode, only a limited number of items are loaded when the grid list is initially displayed. Additional items are only loaded (and rendered) on request. This request can be triggered either by scrolling (preferred) or by clicking the More button.

    Guidelines

    • To optimize performance, we recommend showing no more than 200 items at once in the grid list.
    • For larger datasets (200 to 1,000 items), use the “growing” mechanism to limit the number of displayed items (property: growing), and make sure that users can filter the data.
    • Ideally, use scrolling to load more items instead of the More button (property: growingScrollToLoad).
    • Use the More button only if content is shown below the grid list.

    Warning
    The 200 and 1,000 item limits given here are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of items in the grid list
    • The number of displayed data points inside the items
    • The complexity of the data points (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Scroll

    The height of the grid list is defined by the number of items it contains.

    The grid list is scrolled together with the page and doesn’t have its own scroll container. When the user scrolls through the page, the title bar and filter infobar can stick to the top of the surrounding layout container
    (sap.f.GridList, property:sticky).

    Sticky toolbar
    Sticky toolbar
    Information
    The “sticky” feature comes with some limitations:

    • It isn’t available on all browsers.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.

    “More” Button

    The More button is the default implementation when growing is switched on (property: growing = true).

    'More' button with loaded/total items
    'More' button with loaded/total items
    Guidelines

    • Only use the More button if your page contains content below the grid list.
    • Below the More text, show the number of items already loaded and (if possible) the total number items.
    • Don’t show an item count on the title bar. Use the count on the More button instead.

    Drag and Drop

    The grid list offers the same drag and drop features as the responsive table.

    However, because the items in the grid list are rearranged after an item is dropped, it isn’t always clear where the item will finally be placed.

    Guidelines
    When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item.

    sap.f.dnd.GridDropInfo
    Property: dropIndicatorSize

    In addition, see the corresponding guidelines for the responsive table.

    Keyboard Navigation

    The grid list supports the following keyboard navigation options:

    • Arrow keys: Navigate between items in all directions
    • Page Up / Page Down: Skip several rows
    • Home: Move the focus to the first item
    • End: Move the focus to the last item

    Selecting Items

    A grid list offers the same selection modes as the responsive table
    (sap.f.GridList / sap.m.ListBase, property: mode).

    Exception: A Select All checkbox isn’t provided. Users can only select/deselect all items with the keyboard shortcut (CTRL+A).

    An unselected and a selected item in
    An unselected and a selected item in "multi-selection" mode
    A selected item in
    A selected item in "single select master" mode
    Guidelines

    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user can’t return to the initial state. A selected item can only be deselected by selecting another item.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Don’t show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use “single select left” only if you really need two different click areas; a small selection area, and the rest of the item for something else.
    • Never disable the selection checkbox (multiple selection) or radio button (single selection). If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • If selecting/deselecting all items is important for your app, add a Select All button to the toolbar. Change the button text to Deselect All if all items are selected.

    Clickable Items

    The whole item can be clickable. You can define the action triggered by the click, such as opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements don’t have a visual indicator and therefore can’t be differentiated from non-active elements.

    Clicks on interactive controls within the item are handled by the interactive control and don’t trigger the event for the item as a whole.

    Guidelines

    • Don’t use the “Active” list item type for navigation, to switch the item to an edit state, or to delete the item.
    • You can combine clickable items with edit and delete actions, but not with navigation.
    • Don’t combine clickable items with single selection. “Active” uses the whole item as a clickable area and therefore can’t be used together with a grid list in “single select master” mode.

    Actions

    You can offer actions for the entire grid list, single items, and multiple items.

    Guidelines
    If an action is independent of the selection, show it on the toolbar of the grid list. Examples of such actions are Add or Edit (in the sense of changing all items to edit mode), Sort, Filter, and Group.

    To indicate if an action is available, follow the guidelines for enabling/disabling actions.

    Actions on Single Items

    You can offer actions for single items either on the toolbar or within the item.

    Delete, navigation, and edit actions for single items are supported by the grid list control (see below).

    Guidelines

    • Offer only one or two actions within the item. In this case, show the action trigger near the content to which it belongs.
    • Use a button, unless the action trigger belongs to a link. Hide the action if it doesn’t apply to an item.
    • If you offer delete, navigation, or edit actions for single items, always offer them at item level.

    Delete:

    Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete).

    This places a Delete button (  ) in the top right area of the item.

    'Delete' button
    'Delete' button
    Guidelines

    • Don’t use the “Delete” mode if users typically need to delete multiple items.
    • The “Delete” mode can’t be used with the “single select” or “multi select” selection modes.

    Navigation:

    Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation).

    This places a navigation indicator (  ) in the top right area of the item, and the entire item becomes clickable.

    By contrast, clicking an interactive control within an item doesn’t trigger the navigation event. Instead, the corresponding control handles the click event.

    Navigation indicator
    Navigation indicator
    Guidelines

    • Use the navigation action to navigate to a new page containing item details. In rare cases, you can also use the navigation action for the category navigation pattern without navigating to another page.
    • You can’t use the navigation action together with “edit” or in combination with click events for the entire item (“Active”).

    Edit

    Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail).

    This places an Edit icon (  ) in the top right area of the item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.

    Edit button
    Edit button
    Guidelines
    If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls as soon as you switch to edit mode, but not before. You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    You can’t use the “Edit” list item type together with the “navigation” list item type or in combination with click events for the entire item (“Active”).

    Actions on Multiple Items

    To trigger actions for multiple items:

    • Use a multi-selection grid list.
      (sap.f.GridList, property: mode, value: sap.m.ListMode.MultiSelect)
    • Offer the corresponding actions on the toolbar of the grid list.
    • Keep the toolbar sticky.
      (sap.f.GridList, property: sticky)
    Guidelines

    • Don’t offer actions for multiple items if you expect the grid list to usually have fewer than 10 items.
    • For mass editing scenarios, provide an Edit button. When the user clicks this button, open a dialog for editing the corresponding fields for all selected items. For more information, see Mass Edit.
    • In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only for finalizing actions and if the grid list is the only area on the screen to which actions can be applied.

    Errors and Warnings

    Error handling must be implemented by the app team.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Grid list with errors
    Grid list with errors
    Guidelines
    If the grid list contains items with errors or warnings, show a corresponding message strip above the grid list:

    • On the message strip, provide information about errors or warnings.
    • When issues are solved or when new issues appear, update the message strip accordingly.

    Use item states to indicate errors and warnings for single items.

    Developer Hint
    sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid, which is defined by rows and columns. Columns can have a minimum and maximum size or a fixed size. Whenever an additional column fits on the screen, it is added. If a column no longer fits on the screen, it is removed. Items are re-layouted accordingly.

    You can also define different configurations for the underlying grid using breakpoints (for example, based on the device types).

    Predefined Layouts

    To define the grid layout and behavior, you can use one of the predefined layouts:

    • Grid box layout: Adds a variable number of columns, depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size ML and L, 16 for size XL, 20 for size XXL and XXXL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Custom Grid

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ according to the width of the screen (“breathing”) or be fixed. The height can differ according to the content of the item or be fixed.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Guidelines
    When defining a custom grid:

    • We recommend letting items “breathe” to make better use of the available screen space.
    • Make sure that the item adapts to the resulting width/height. For example:
      • Re-layout the item content.
      • Hide less important information.
      • Re-size content, such as images or charts.

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Don’t use other list items. They aren’t responsive enough.
    • Use responsive content. For example, use controls that wrap text and configure them accordingly.

    Examples

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • inset adds a margin on all sides of the grid list.
    • headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • Variant management
    • headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • footerText adds a small additional row below the table footer or last item. This row can contain text only. Don’t use this property.
    • width defines the width of the whole grid list.
    • includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and therefore shouldn’t be used in combination with these two settings.
    • enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the busy property, where the application can control when the grid list is set to busy state)
    • modeAnimationOn has no effect. Don’t use it.
    • showSeparators has no effect. Don’t use it..
    • swipeDirection has no effect. Don’t use it..
    • rememberSelections leaves items selected even if they aren’t currently visible (for example, after filtering). If this behavior isn’t wanted, you can set the flag to “false”. However, you should only do so in exceptional cases.
    • busy sets the grid list to a busy state. While in the busy state, the entire grid list can’t be used and items can’t be read due to an overlay.
    • busyIndicatorDelay defines how long a busy state is shown after the grid list has been set to this state. Use the default value.
    • visible shows the grid list (true) or hides it (false).
    • tooltip provides a tooltip for the whole grid list. Don’t use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • selected allows an item to be selected programmatically.
    • counter shows a number on the right side of an item. This is used to show the number of subitems, for example.
    • Don’t use the busy property.
    • Don’t the busyIndicatorDelay property.
    • visible shows or hides the item.
    • tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It won’t work on tablets or smartphones. Don’t use it.

    Top Tips

    • Use the grid list only if the content is suitable for a rectangular format.
    • Ensure that items can be identified.
    • Keep your grid and your items responsive. Consider allowing cards of different sizes to avoid content truncation.
    • In your card design, either mimic existing objects like business cards or follow the guidelines for object cards.

    Related Links

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in area. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in area first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in area (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in area for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in content)
    A more complex responsive table (full screen without pop-in content)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in content wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column. In addition, it allows the user to resize the column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Note: Line items can still use the sap.m.ListType “navigation”, which allows click handling for specific line items. Only use this option if the click triggers navigation to a corresponding details page.
    • Single select master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single select left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
    • Multi select: Users can select one or more items using the checkboxes on the left of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).
      Another multi select variant is to not provide a Select All option, but just a Clear All check box in the same place (property: multiSelectMode, value: ClearAll).

    Keyboard: If the focus is on a row, the space bar selects the corresponding item.

    Responsive table without selectable items
    Responsive table without selectable items
    Single select master
    Single select master
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    SIngle select left, with radio buttons. Use only if row clicks are used for something else.
    Multi select with 'Select All' checkbox
    Multi select with 'Select All' checkbox
    Multi select with 'Clear All' button
    Multi select with 'Clear All' button

    Group

    When items are grouped, a group header is displayed. The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Don’t show aggregations in “growing” mode. In growing mode it isn’t clear which values are being aggregated; only the items currently loaded in the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can be triggered either by scrolling (preferred) or by clicking the More button.

    If you use the More button, show the number of items already loaded and the total number items below the More text, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Column Header Level

    The column header provides the label for the corresponding column. It also handles the functionality for resizing columns.

    Resizing Columns

    If you implement column resizing, users can resize the columns as follows:

    • Mouse interaction: The user drags the separator line between two columns. Double-clicking the line optimizes the column width based on the length of the currently visible data and the label of the column header.
    • Touch interaction: As for mouse interaction, but with a larger target touch area.
    • Keyboard interaction: When the focus is on the column header, Shift+Right increases the width of the focused column. Shift+Left decreases the width.

    When a column is resized, the other columns can keep their original width or adapt their width. This depends on the column width settings:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and the columns that follow are moved accordingly. The width of all the other columns is not affected. If the visible columns don’t use the full width of the table control, empty space is added. If the visible columns exceed the width of the table control, one or more columns move to the pop-in area.
    • If all column widths are set as a percentage or as “auto”, resizing one column might also result in automatic resizing of some or all other columns. The position of the resized column might also be affected. This ensures that the full table width is used and no white space is added.
    Developer Hint
    To enable resizable columns, implement the plugin:
    sap.m.plugins.ColumnResizer.
    Resizing a column
    Resizing a column

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    For single selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for list-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

    In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode:

    • Prefer Select All over Clear All
    • Use Clear All only for tables with a large number of items (more than recommended above), where loading all items to select them would harm performance.
    • To avoid confusion, don’t show checkboxes in the first data column in the default delivery.
    • Make sure that the Select All checkbox (de)selects all items the user can reach by scrolling. This is only possible if all items are rendered.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors
    Table containing errors

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

    Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with empty space.

    Optimize the column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize the column width for typical content.

    When defining the column width, consider the implications when a column is resized:

    • If you define the column width in pixels or rem, resizing a column only affects the width of that particular column.
      • If the table isn’t wide enough to show all the columns after a column has been resized, one or more of follow-on columns move into the pop-in area.
      • If the columns don’t use up the available space, white space appears to the right of the last column (property: fixedLayout, value: strict).
      • If only one column remains, and the width of this column exceeds the width of the table itself, the width of the column is reduced to the width of the table.
    • If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text wraps more when the browser window size is reduced. This ensures that all columns together make use of the full table width.
    • If you define the column width as “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.
    • Be cautious of mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when columns are resized. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Don't
    Do not distribute just a few columns across the full width
    Do not distribute just a few columns across the full width
    Do
    Use a fixed column width instead
    Use a fixed column width instead

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    To keep the column headers readable, wrap or truncate the texts as follows:

    • If columns are not resizable, use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.
    • If columns are resizable, use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers if columns are not resizable
    Wrap column headers if columns are not resizable
    Do
    Truncate column headers if columns are resizable
    Truncate column headers if columns are resizable

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Align buttons with the content hierarchically

    Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization: Add, Remove, Rearrange Columns

    To enable users to add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Examples include the list in a list-detail scenario or an attachment list. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Total setting in column header menu
    Total setting in column header menu

    The overall aggregation is shown at the bottom of the analytical table.

    Overall aggregation
    Overall aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    A group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in option to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in list-detail scenarios using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the list-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Users can (de)select all items using CTRL+A. Select All (de)selects all items that the user can reach by scrolling.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection list-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use this mode only if you really need two different click areas; a small one for a selection, and the rest of the item for something else.
    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
    • If selecting / deselecting all items is important for your app, add a button with the text Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the CONTEXT MENU KEY, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Errors and Warnings

    To indicate that the list contains items with errors or warnings, show a message strip above the list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    List containing errors
    List containing errors

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the list, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority, these are:

    • Add the item inline. Create an empty, editable item as the first item of the list. Show the Save button on the toolbar of the list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items with up to 8 input fields. Save the new item at dialog level.
    • Navigate to a new page. Only use this behavior for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the list. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level
      • Create with dialog: A list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved on list level, but rather with the entire draft.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action which applies to a part of a selection
    Message for an action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available for all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the list. Use the filter bar instead.
    • Only use the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Keep the view settings consistent. When a user reopens the app, show the list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort setting, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings located in the filter bar or in a select control placed in the toolbar of the list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.List, property: sticky).

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Errors and Warnings

    To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • For single-selection list-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if:
      • The action can’t be applied to any of the selected items.
      • The number of selected items doesn’t match the action. For example, disable Compare if only one item is selected.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a list-detail scenario
    When a multi-selection table is used in a list-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a list-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control allows users to personalize one or more of the following table attributes:

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    These tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table toolbar.

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields: one for choosing the sort column, and one for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature for column headers replaces ALL sort options in the dialog!

    Filter

    The Filter tab allows users to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Group

    The Group tab can be used to group the table data.

    In the selection field, the user can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Warning
    To group by a specific column, that particular column must be marked as visible on the Columns tab!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Resources

    Elements and Controls

    Implementation

    Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    The title is optional (property: header).

    Guidelines
    Add a title whenever the title is not indicated in the surrounding area.
    Developer Hint
    If you don’t provide a title, ensure that you support screen reader users: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    Show Details / Hide Details is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, showDetailsButton, annotation: UI.Importance). You can define which column priority levels are hidden (property: detailsButtonSettings). The button only appears if there are corresponding columns in the pop-in area.

    Details hidden
    Details hidden
    Details shown
    Details shown

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    Responsive table within a smart table
    Responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
      The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
      If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
    Guidelines
    Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
    Developer Hint
    For the responsive table, enableAutoColumnWidth also applies the following changes:

    • The smart table property demandPopin is set to true.
    • The responsive table property fixedLayout is set to Strict.
    • The responsive table property contextualWidth is set to Auto.
    • Column resizing is enabled for all columns (including custom columns).
    • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

    In this case, the properties above must not be managed by the app.

    Responsive table with automatically calculated column widths, resizing, and remaining space
    Responsive table with automatically calculated column widths, resizing, and remaining space
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort AscendingSort Descending
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table offers the following options for creating columns automatically:

    1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
    2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields
    Developer Hint
    From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

    • For read-only tables, use the controls provided by the smart table.
    • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
    • For more complex editing cases, use smart fields.
    • For switching between read-only and edit modes:
      • In read-only mode, use the controls provided by the smart table.
      • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

    In cases where the controls are rendered by the smart table, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field Criticality, CriticalityType,
    CriticalityRepresentationType
    Do not use editable status information.
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

    Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Table containing warnings
    Table containing warnings
    Table containing errors and warnings
    Table containing errors and warnings
    Guidelines
    To show that an item contains an error,

    Developer Hint
    Binding-related messages are shown automatically.

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Developer Hint

    • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control allows users to personalize one or more of the following table attributes:

    • Columns: Visibility and order of columns
    • Sort: Sort criteria for table items
    • Filter: Filter criteria for table items
    • Group: Grouping table items by specific attributes

    These tabs can be shown in any combination, as required by the use case.

    The P13n dialog is intended for complex tables that have a large number of columns and require complex queries for sorting, grouping, and filtering.
    For simple tables, see the view settings dialog and table personalization dialog.

    The P13n dialog is opened using the corresponding buttons on the right-hand side of the table toolbar.

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • Users can personalize more than ~20 columns.
    • You need multiple personalization functions (columns, sorting, filtering, grouping, …)
    • You are using the analytical table.
    • Complex queries have to be built for the table.

    Do not use the P13n dialog if:

    • Users can personalize fewer than ~20 columns.
    • You only need a simple feature to show/hide columns.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), it shows as a centered dialog. For size S (smartphones), it displays as a full screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The Columns tab allows users to change the visible table columns and the order in which they are displayed.

    The available columns are shown as list items with checkboxes. The checkboxes for the columns that are currently being displayed are selected.

    The Show Selected / Show All button toggles the display between all columns and only those that are currently selected.

    Show/Hide

    To show or hide a column, users select or deselect the column checkbox.

    Reorder

    To change the order of the columns, users focus on a list item and use the buttons on the right-hand side of the table toolbar to move it up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    The search field in the table toolbar enables users to find a specific column more quickly. Matching columns are displayed as soon as the user starts to type.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    On the Sort tab, the user can specify the sort criteria and sort order (ascending or descending).

    Each entry has two input fields: one for choosing the sort column, and one for choosing the sort order.

    Users can enter multiple sort criteria. Once a sort criterion is entered, a new line appears for entering another one.

    The order of the sort criteria reflects the order in which they are applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature for column headers replaces ALL sort options in the dialog!

    Filter

    The Filter tab allows users to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, the user selects the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or Boolean values could be a dropdown list, an input field with suggestions, or a date picker. You can also offer two or even more fields if the use case requires it.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Group

    The Group tab can be used to group the table data.

    In the selection field, the user can select a grouping criterion from a list of all available columns.

    For analytical tables, users can define more complex grouping scenarios. Once a grouping criterion is entered, a new line appears for entering another one. In addition, the Show Field As Column checkbox allows users to decide whether or not to display the corresponding column.

    The grouped table shows the individual values for the selected field as the group headers. Expanding the group shows all the corresponding table items.

    If you have defined multiple groups, the grouped table shows the individual values for the first selected field. Expanding the groups shows the subgroups and items in an expandable hierarchy.

    Warning
    To group by a specific column, that particular column must be marked as visible on the Columns tab!
    Group tab in the P13n dialog
    Group tab in the P13n dialog

    Guidelines

    On the table toolbar, offer separate buttons for each personalization function (sort, filter, group, column settings).

    With each button, open the P13n dialog with just the corresponding tab. Do not display the other tabs.

    Resources

    Elements and Controls

    Implementation

    View Settings Dialog

    The view settings dialog helps users to sort, filter, or group data within a list or a table. The dialog is triggered by icon buttons in the table toolbar.

    Usage

    We recommend making each feature (sort, filter, group) available as a separate button in the table toolbar (see Button Placement below). Each button then triggers a separate dialog. If specifically required, you can combine the dialogs into one with a segmented button acting as tabs to switch between the sort, filter and group options. Note: In a combined dialog, the Reset button resets all tabs.

    Use the view settings dialog if:

    • Users need to sort line items in a manageable list or table (up to about 20 columns).
    • You need to offer custom filter settings in a manageable list or table (up to about 20 columns).
    • Users need to group line items in a manageable list or table (up to about 20 columns).

    Do not use the view settings dialog if:

    • You have complex tables (more than about 20 columns).
    • Users need to rearrange columns within the table. Use the table personalization dialog instead.
    • Users need very specific sort, filter, or column sorting options within complex tables. Use the P13n dialog instead.

    Button Placement

    Use distinct icon buttons for the sort, filter, and group settings. Place the icons in the following order:   (Sort) (Filter)  (Group).

    Do not place Sort, Filter, or Group buttons in the footer toolbar if they refer to a table.

    For more information about the button placement, see Sort, Filter, Group (Generic) in the table toolbar article.

    Sort, Group, and Filter a List

    You can also offer the view setting features for a list.

    Responsiveness

    The popover dialog appears as a modal window on desktop and tablet screen sizes, but uses the full screen on smartphones.

    The view settings dialog is a composite control that consists of a modal dialog with a maximum of three tabs with lists of attributes. Each helps the user to either sort, filter, or group a table or list. If the use case requires only a sort feature, for example, you can hide the filter and group tabs.

    The dialog is triggered by one of the icon buttons in the table header
    The dialog is triggered by one of the icon buttons in the table header
    View settings dialog - Size S
    View settings dialog - Size S
    View settings dialog - Size M
    View settings dialog - Size M
    View settings dialog - Size L
    View settings dialog - Size L

    Behavior and Interaction

    The sort, filter, and group features can all be applied to a table simultaneously.

    Sort

    The sort dialog shows two groups of sort settings. The first group offers general Ascending and Descending sort options. The second group offers attributes that fit the use case, such as Product, Supplier, Weight, or Price. The attributes can match the table columns, but because a table column can also contain several data points, such as “Name” and “Surname”, the attributes allow an attribute to be shown for each data point.

    Users can select attributes using the radio buttons. Clicking OK closes the dialog and shows the table items in the selected order.

    If a combined dialog is used, the first tab is the sort feature.

    View settings dialog - Sort
    View settings dialog - Sort

    Filter

    The filter dialog can offer a single filter selection list, a multi-filter selection list, or a category list. The category list provides an overview, and allows the user to drill down to detailed filter selection lists.

    In a combined view settings dialog, filtering is on the second tab.

    Filter Selection List – Single Selection

    The dialog offers one selection list with radio buttons to select a filter. This list is useful for offering a list of preconfigured filters for a specific use, such as “Products with numbers ‘starting between 100 and 200’ with status ‘in stock’ and color ‘green’”.

    Filter Selection List – Multi-Selection

    You can also offer a multi-selection list. For example, a user might want to show all open items for both “Company A” and “Company D”.

    Show Selected Only

    If the user clicks the    button (Show Selected Only), only the selected filters are shown (for example, “Company A” and “Company D”). Clicking the button again shows all of the available filter values.

    Multiple filters selected
    Multiple filters selected
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown

    Category List

    The filter dialog shows a single list of general filter categories depending on the use case, like Price or Height. The user chooses a category by clicking the list item, such as Price. As this is a simple drilldown, these categories do not have radio buttons. The follow-on dialog shows a list of optional filter settings in the Price category. These filters, such as Less than 100, depend on the use case. The user chooses a specific filter setting by selecting one of the radio buttons offered in this list. Clicking OK closes the dialog and shows the table items filtered by the selected attribute. The infobar shows which filter has been set.

    Example: Filter Dialog with Category List

    1) Select a category
    1) Select a category
    2) Option to refine filters for the selected category (here: 'Weight')
    2) Option to refine filters for the selected category (here: 'Weight')
    3) Infobar showing the filter setting for a table view filtered by 'Weight'
    3) Infobar showing the filter setting for a table view filtered by 'Weight'

    Free-Form Apps

    You can also customize your own filter UIs, for example, to support date picking.

    Filter Values

    Filters can correspond to single values as well as groups, such as “<100.00 EUR”.

    Filter Reset

    The Reset button on the filter tab resets all filter settings.

    Removing Filters

    In single selection lists, offer a Not Filtered option. This enables users to remove existing filters.

    Group

    The group dialog shows two groups of attributes. The first group offers a general Ascending or Descending order, which allows the user to select the order in which the defined groups appear. The second group offers attributes that fit the use case, such as Type or Supplier.

    You can also offer an attribute like Price to group data in a table.

    Users can choose attributes using radio buttons or checkboxes. Clicking OK closes the dialog and shows the table with items grouped below headers.

    In a combined view settings dialog, the group feature is the third tab.

    Dialog for choosing an attribute from the group tab
    Dialog for choosing an attribute from the group tab
    Table view grouped by supplier – Group headers divide the list
    Table view grouped by supplier – Group headers divide the list

    Naming Group Headers

    Be sure to name the group headers as follows: <Category Name>: <Value/Range>

    Examples:

    • Category: Accessories
    • Supplier: Red Point Stores.

    Guidelines

    On the table toolbar, use different buttons for each function (sort, filter, group). With each button, open the View Settings dialog with just the corresponding tab.

    If possible, give users the option not to filter or group. For sorting, this is only necessary if the use case calls for an unsorted list. In all three cases, show this option as the first entry in the list of criteria (remember to include the brackets):

    • (Not Sorted)
    • (Not Filtered)
    • (Not Grouped)

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Errors and Warnings

    To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • For single-selection master-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the master list for a master-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: Only one item is selected.
    Single selection: Only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that Ctrl+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection master-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in 'delete' mode
    Tree in 'delete' mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with single select master.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - Context menu
    Tree - Context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Errors and Warnings

    To indicate that the tree contains items with errors or warnings, show a message strip above the tree. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Tree containing errors
    Tree containing errors

    Content

    Content Formatting

    To display object names with an ID, show the ID in parentheses after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with 'Delete' button
    Items with 'Delete' button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the tree toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable item as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios where just a few input fields have to be filled.
    2. Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the tree.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at tree level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Information
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the tree in a meaningful way when it first loads.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing paddings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    A group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in option to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection master-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid List

    As with the list and the responsive table, the grid list displays a set of items. In contrast to both controls, the grid list displays the items not in rows, but in a grid.

    The grid list is usually used as an alternative view for a list or table. It is ideal for displaying images, charts, object cards, and other content, which profit from more height (but less width).

    Grid List
    Grid List

    Usage

    Use the grid list if:

    • Your content is “visual” and profits from the rectangular format of the items. This is true for e.g. images, charts, and object cards.
    • The focus is on items, not on cells. The grid list shows complete items.
    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple data sets.
    • As an alternative view for tables or lists, if the content profits from the different format.

    Do not use the grid list if:

    • Your content is not appropriate for a card-like format. For example, do not use the grid list for displaying a wall of text. Use a table instead.
    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Data needs to be structured in a hierarchical manner. In this case, a tree might be more appropriate.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as the CSSGrid.
    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid. The underlying grid is defined by rows and columns. Columns can have a minimum and maximum or a fixed size. Whenever an additional column fits on the screen, it will be added. If a column does not fit on the screen anymore, it will be removed. Items are re-layouted accordingly.

    Optionally, there can be different configurations for the underlying grid based on breakpoints, for example based on the device types.

    To define the grid layout and behavior, you can use one of the pre-defined layouts:

    • Grid box layout: Adds a variable number of columns depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height, and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size ML and L, 16 for size XL, 20 for size XXL and XXXL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ pending on the screen width (“breathing”) or be fixed. The height can differ pending on the content of the item or be fixed. “Breathing” items make better use of the available screen space and is therefore recommended. Make sure, that the item adapts to the resulting width / height, for example by

    • Re-layouting the item content
    • Hiding less important information
    • Re-sizing content, such as images or charts.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Components

    • The title bar holds the title and, an item counter. Instead of a title bar you can use a toolbar, including title, counter, variant management and actions.
    • Optionally, a filter infobar should appear when the grid list is filtered and shows information on the filter settings.
    • The collection of grid list items, layouted on a grid, occupies the main part of the grid list.
    • A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button. Use More only, if content is shown below the grid list.
    • The footer can contain additional static text information.
    Schematic visualization of the grid list
    Schematic visualization of the grid list

    Title Bar

    The title bar contains the title of the grid list and an item counter

    Title Bar
    Title Bar

    Instead of the title bar, a toolbar can be used instead. If done so, use a title control to display the title and item count. Variant management and actions can be added in this case. The toolbar can contain entry points for the view settings dialog, as well as view switches in the form of a segmented button, and buttons for actions like for example Add, or Edit.

    Toolbar instead of title bar
    Toolbar instead of title bar

    For the title, keep the following in mind:

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    • Do not show the title bar at all, if all elements (title, item count, variant management, toolbar) are available in the surrounding area.
      Example: An object page (sub-)section contains only one grid list. In this case, add the item count and the toolbar to the (sub-)section header.
    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table. If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    For displaying the item count, use the following format:

    [title text] ([count])

    for example:

    Items (2,534)

    For the item count, keep the following in mind:

    • include all the items that a user can reach by scrolling except group headers.
    • Remove the item count if there are zero items.
    • Do not show a count on the title bar, if a More button is used. Show the count on the more button instead.

    If possible, keep the title bar sticky (sap.m.GridList, property: sticky).

    Filter Infobar

    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the grid list is filtered.

    Filter infobar
    Filter infobar

    Items

    The items (sap.f.GridListItem) are placed on a grid. To specify the design of items, it is recommend (but not mandatory) to follow the guidelines for object cards. Be aware that the item itself is responsible for its own responsiveness.

    Use the grid list only, if your content profits from the format. This can apply to images, charts, but also to object cards or quick views. Another option is to mimick the format (but not the visual) of existing objects (e.g. business cards).

    A grid list item can contain any content. This includes single controls, or a combination of controls (e.g. by using layout containers).

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Although the grid list can technically work with other list items (e.g. the standard list item), do not use them. They are not responsive enough for being used in a grid. In addition, selectors, navigation indicators and other elements are layouted differently (optimized for the list, not for the grid list).
    • Take care that an item can be identified, e.g. by adding a title, and if needed a sub title.
    • To show a string with an ID as identifier, use the title for the string, and the subtitle for the ID.
    • For status information, use semantic colors on foreground elements.
    • Avoid truncation. Use controls that wrap the text and configure them accordingly.
    • If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls, as soon as you switch to edit mode, but not before.
      You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    Not all items have to follow the same structure. This could be the case if one item is locked, but another item is in edit mode. Another example is to show a set of objects of different types in the same grid list.

    Items can be navigated in all directions using the Arrow keys. To skip several rows, Page Up and  Page Down can be used. To move the focus to the first / last item use the Home and End keys.

    Example for a grid list item
    Example for a grid list item
    Another example for a grid list item
    Another example for a grid list item

    Highlight

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry- / process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users what exactly is wrong. Make sure that you provide this information within the item, ideally in the same color.

    For details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item

    States

    To show that an item is unread, use the corresponding flag (sap.m.GridList, property: showUnread, sap.f.GridListItem, property: unread). This shows most of the content in bold font.

    Unread item next to a read item
    Unread item next to a read item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) near the item identifier.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) near the item identifier. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error). In addition, highlight the item accordingly (sap.f.GridListItem, property: highlight).

    An item with an error
    An item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft near the item identifier. The user can click the button to open a popover showing the timestamp of the last change.

    An item with draft state
    An item with draft state

    Show only one state at any one time.

    “More” Button

    The More button loads more items to the front end if not all items have yet been loaded.

    "More" button

    Footer

    The footer can be used to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    Scroll

    The height of the grid list is defined by the number of items it contains. It does not have a scroll container on its own but is scrolled together with the page. When the user scrolls the page, the title bar and filter infobar can stick to the top of the surrounding layout container (sap.m.GridList, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.
    • If focus is set to a fixed column header, the grid list is automatically scrolled to top.

    Sticky toolbar
    Sticky toolbar

    Showing more items

    If the grid list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. This request can either be triggered by scrolling (preferred), or by clicking the More button. Use the latter one only if content follows below the grid list. Use the “growing mode”, if more than 200 items are expected to be displayed.

    If using the “More” button,

    • show the number of items already loaded and (if possible) the total number items below the text More.
    • do not show an item count on the title bar. Use the count on the More button instead.

    In any case, if the “growing mode” is used, do not show more than 1,000 items overall.

    Select

    A grid list can have one of the following selection modes (sap.m.GridList/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Items can still use the sap.m.ListType “navigation”, which allows click handling on specific items. Only use this option if the click triggers navigation to a corresponding item details page.
    • Single selection master: One item in the grid list can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from grid lists without selection (mode: None). Single select master is the preferred mode for single selection. (sap.m.ListMode.SingleSelectMaster).
    Selected item in
    Selected item in "single selection master"
    • Single selection left: One item in the grid list can be selected. For this, the grid list provides radio buttons on the left side of each item. Only use this mode if a click on the whole item is being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft). Even in this case, prefer single select master and synchronize the selection with the navigation, so that the navigated item is also the selected item.
    • Multi selection: Users can select one or more items. For this, the grid list provides checkboxes on the left side of each item. (sap.m.ListMode.MultiSelect). The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All must (de)select all items that the user can reach by scrolling. Try to avoid combining multi selection with navigation.
    An unselected and a selected item in
    An unselected and a selected item in "multi selection"
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
    • For single-selection master-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Click an Item

    The whole item can be clickable. An event is fired by clicking the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a grid list in “single select master” mode.

    Drag and Drop

    One or several items can be repositioned within a grid list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    When using drag and drop, keep the following in mind:

    • Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. They are keyboard operable and available on all browsers.
    • If you offer drag and drop for rearranging items within the grid list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).
    • Be aware that due to the re-arrangement of the items which happens after an item is dropped, it is not always clear where the item will finally be placed.
    • When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item (sap.f.dnd.GridDropInfo, property: dropIndicatorSize).
    • Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.
    • When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on a specific data point, the dropped item needs to take on the value of the target group for the corresponding data point. If this is not wanted, do not allow users to rearrange items in grouped grid lists. Example:
      A grid list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Loading Data

    To indicate that the grid list is currently loading items, use the busy state. (sap.m.GridList, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Empty Grid Lists

    Try not to display an empty grid list. If there is no way around this, provide instructions on how to fill the grid list with data (sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a grid list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the grid list with data.
    • If a grid list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a grid list is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Context Menu

    You can attach a context menu to a grid list. The context menu gives users an alternative way to modify the whole grid list or an individual item by providing access to context-specific actions. A context menu is opened by right-clicking (mouse), long press (touch devices), or via keyboard using the Context Menu key or Shift+F10. If a control inside a grid list is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Be aware that using the context menu overrides the browsers context menu, which can no longer be opened.

    Group

    If grouped, a group header is displayed (sap.m.GroupHeaderListItem) above all items which belong to the corresponding group. The group header is not interactive.

    A grouped grid list
    A grouped grid list

    Guidelines

    Actions

    To trigger actions on multiple items, use a multi-selection grid list (sap.m.GridList, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the toolbar of the grid list. Keep the toolbar sticky (sap.m.GridList, property: sticky).

    In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only if the grid list is the only area on the screen to which actions can be applied and if the actions are finalizing.

    Do not offer actions for multiple items if the grid list is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.GridList, property: mode, value: sap.m.ListMode.SingleSelectMaster), the action can also be shown within the item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every item and thus use a lot of screen real estate, only do this for one or two actions at most. In this case, show the action trigger near the content to which it belongs. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    The following actions on single items must always be in-line:

    • Delete: Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the right side of an item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case.
      Delete is a mode of the grid list and therefore cannot be used together with single selection or multi-selection.
    Delete button
    Delete button
    • Navigation: Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the right side of an item and the entire item becomes clickable. Use this to navigate to a new page containing item details. In rare cases, you can also use this for the category navigation pattern without navigating to another page. By contrast, clicking an interactive control within an item does not trigger the navigation event. Instead, the corresponding control handles the click event.
      “Navigation” is an item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).
    Navigation Indicator
    Navigation Indicator
    • Edit: Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the right side of an item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.
      Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).
    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Add Items

    • Place the Add or Create text button on the toolbar of the grid list.
      • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
      • Use Add if the item already exists and is merely added or assigned to the current object.
    • Place new items always as the first item of the grid list.
    • Use highlight (information state) on the new item.
    • Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three possibilities for adding an item, which should be considered in the following priority:

    • Add the item inline. Create an empty, editable item as the first item of the grid list. Show the Save button on the toolbar of the grid list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    • Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the grid list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the grid list. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level.
      • Create with dialog: A grid list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved on grid list level, but rather with the entire draft.

    Export to Spreadsheet

    Mass Editing

    • Provide multiselection (sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    Paste

    To paste data from the clipboard to the grid list, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    If the focus is on item level, the app has to take the data from the clipboard and add it to the corresponding controls within the items.

    If the focus is on an editable control within an item, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the grid list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the grid list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the grid list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the grid list. Use the filter bar instead.
    • Always use only the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Persist the view settings. When a user reopens the app, show the grid list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort settings, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the toolbar of the grid list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.GridList, property: sticky).
    Guidelines
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).

    Group

    • To display the current group state, group headers are shown.
    • On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):
      [Label of the grouped data point]: [Grouping Value]
    • If there is no grouping value, show the following text:
      [Label of the grouped data point]: (Not Available)
      This is the case if you have a group of items that don’t have a value for the grouped data point.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection,

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action, if it can be applied to all selected items.
    • Enable the action, if it can be applied to a part of the selected items. If the action is triggered, show a message that informs the user about how many items will be affected. Provide the choice to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action which applies to a part of a selection
    Message for an action which applies to a part of a selection

    To trigger actions that are independent of the selection, show the actions on the toolbar of the grid list. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, and group.

    To trigger a default action on the whole item, use the “Active” or “DetailAndActive” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Active).
    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event but are handled by the interactive control. Do not use Active for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Errors and Warnings

    To indicate that the grid list contains items with errors or warnings, show a corresponding message strip above the grid list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single item, see States above.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Grid list containing errors
    Grid list containing errors

    Grid Lists in Object Pages

    A grid list with up to 20 expected items can be displayed right away, without lazy loading.

    If you expect the grid list to have more than 20 items, use one of the following 3 options:

    • Lazy loading (More button): Use this option if you expect to have up to 100 items.
    • Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the grid list on a dedicated tab.
    • Navigation to a list report: If you expect the grid list to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the grid list itself to a reasonable amount. To provide the user with a way to work with the entire grid list, offer navigation to a separate list report containing all items.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the grid list in the object page. Grouping should be avoided.

    For more information on the use of grid lists within the object page, see Object Page – Tables.

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • The property: inset adds a margin on all sides of the grid list.
    • The property: headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • variantManagement
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole grid list.
    • The property: includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used in combination with these two settings.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the grid list is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators does not have any effect. Do not use this property.
    • The property: swipeDirection does not have any effect. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are currently not visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the grid list to a busy state. While in busy state, the whole grid list cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the grid list has been set to this state. Use the default value.
    • The property: visible shows the grid list (“true”) or hides it (“false”).
    • The property: tooltip provides a tooltip for the whole grid list. Do not use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter shows a number on the right side of an item. This is used in cases like showing the number of subitems.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance. Examples include the master list and the attachment list.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: Ctrl+A)
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: Users can increase the width of the focused column header with Shift+Right and decrease it with Shift+Left.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering). Keyboard interaction: Ctrl+Left and Ctrl+Right move the focused column header one position in the corresponding direction.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Total setting in column header menu
    Total setting in column header menu

    The overall aggregation is shown at the bottom of the analytical table.

    Overall aggregation
    Overall aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection master-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, regardless of whether the currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to the decimal point
    Alignment to the decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping are available for either the text or the ID, but not for both
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    To let users add items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally also Enter) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. Only use this option for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item in the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is applied as follows:
      • Inline creation: After Save is triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    If draft handling is used, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use CTRL+COMMA.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid List

    As with the list and the responsive table, the grid list displays a set of items. In contrast to both controls, the grid list displays the items not in rows, but in a grid.

    The grid list is usually used as an alternative view for a list or table. It is ideal for displaying images, charts, object cards, and other content, which profit from more height (but less width).

    Grid List
    Grid List

    Usage

    Use the grid list if:

    • Your content is “visual” and profits from the rectangular format of the items. This is true for e.g. images, charts, and object cards.
    • The focus is on items, not on cells. The grid list shows complete items.
    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple data sets.
    • As an alternative view for tables or lists, if the content profits from the different format.

    Do not use the grid list if:

    • Your content is not appropriate for a card-like format. For example, do not use the grid list for displaying a wall of text. Use a table instead.
    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Data needs to be structured in a hierarchical manner. In this case, a tree might be more appropriate.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as the CSSGrid.
    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid. The underlying grid is defined by rows and columns. Columns can have a minimum and maximum or a fixed size. Whenever an additional column fits on the screen, it will be added. If a column does not fit on the screen anymore, it will be removed. Items are re-layouted accordingly.

    Optionally, there can be different configurations for the underlying grid based on breakpoints, for example based on the device types.

    To define the grid layout and behavior, you can use one of the pre-defined layouts:

    • Grid box layout: Adds a variable number of columns depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height, and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size ML and L, 16 for size XL, 20 for size XXL and XXXL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ pending on the screen width (“breathing”) or be fixed. The height can differ pending on the content of the item or be fixed. “Breathing” items make better use of the available screen space and is therefore recommended. Make sure, that the item adapts to the resulting width / height, for example by

    • Re-layouting the item content
    • Hiding less important information
    • Re-sizing content, such as images or charts.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Components

    • The title bar holds the title and, an item counter. Instead of a title bar you can use a toolbar, including title, counter, variant management and actions.
    • Optionally, a filter infobar should appear when the grid list is filtered and shows information on the filter settings.
    • The collection of grid list items, layouted on a grid, occupies the main part of the grid list.
    • A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button. Use More only, if content is shown below the grid list.
    • The footer can contain additional static text information.
    Schematic visualization of the grid list
    Schematic visualization of the grid list

    Title Bar

    The title bar contains the title of the grid list and an item counter

    Title Bar
    Title Bar

    Instead of the title bar, a toolbar can be used instead. If done so, use a title control to display the title and item count. Variant management and actions can be added in this case. The toolbar can contain entry points for the view settings dialog, as well as view switches in the form of a segmented button, and buttons for actions like for example Add, or Edit.

    Toolbar instead of title bar
    Toolbar instead of title bar

    For the title, keep the following in mind:

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    • Do not show the title bar at all, if all elements (title, item count, variant management, toolbar) are available in the surrounding area.
      Example: An object page (sub-)section contains only one grid list. In this case, add the item count and the toolbar to the (sub-)section header.
    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table. If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    For displaying the item count, use the following format:

    [title text] ([count])

    for example:

    Items (2,534)

    For the item count, keep the following in mind:

    • include all the items that a user can reach by scrolling except group headers.
    • Remove the item count if there are zero items.
    • Do not show a count on the title bar, if a More button is used. Show the count on the more button instead.

    If possible, keep the title bar sticky (sap.m.GridList, property: sticky).

    Filter Infobar

    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the grid list is filtered.

    Filter infobar
    Filter infobar

    Items

    The items (sap.f.GridListItem) are placed on a grid. To specify the design of items, it is recommend (but not mandatory) to follow the guidelines for object cards. Be aware that the item itself is responsible for its own responsiveness.

    Use the grid list only, if your content profits from the format. This can apply to images, charts, but also to object cards or quick views. Another option is to mimick the format (but not the visual) of existing objects (e.g. business cards).

    A grid list item can contain any content. This includes single controls, or a combination of controls (e.g. by using layout containers).

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Although the grid list can technically work with other list items (e.g. the standard list item), do not use them. They are not responsive enough for being used in a grid. In addition, selectors, navigation indicators and other elements are layouted differently (optimized for the list, not for the grid list).
    • Take care that an item can be identified, e.g. by adding a title, and if needed a sub title.
    • To show a string with an ID as identifier, use the title for the string, and the subtitle for the ID.
    • For status information, use semantic colors on foreground elements.
    • Avoid truncation. Use controls that wrap the text and configure them accordingly.
    • If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls, as soon as you switch to edit mode, but not before.
      You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    Not all items have to follow the same structure. This could be the case if one item is locked, but another item is in edit mode. Another example is to show a set of objects of different types in the same grid list.

    Items can be navigated in all directions using the Arrow keys. To skip several rows, Page Up and  Page Down can be used. To move the focus to the first / last item use the Home and End keys.

    Example for a grid list item
    Example for a grid list item
    Another example for a grid list item
    Another example for a grid list item

    Highlight

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry- / process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users what exactly is wrong. Make sure that you provide this information within the item, ideally in the same color.

    For details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item

    States

    To show that an item is unread, use the corresponding flag (sap.m.GridList, property: showUnread, sap.f.GridListItem, property: unread). This shows most of the content in bold font.

    Unread item next to a read item
    Unread item next to a read item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) near the item identifier.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) near the item identifier. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error). In addition, highlight the item accordingly (sap.f.GridListItem, property: highlight).

    An item with an error
    An item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft near the item identifier. The user can click the button to open a popover showing the timestamp of the last change.

    An item with draft state
    An item with draft state

    Show only one state at any one time.

    “More” Button

    The More button loads more items to the front end if not all items have yet been loaded.

    "More" button

    Footer

    The footer can be used to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    Scroll

    The height of the grid list is defined by the number of items it contains. It does not have a scroll container on its own but is scrolled together with the page. When the user scrolls the page, the title bar and filter infobar can stick to the top of the surrounding layout container (sap.m.GridList, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.
    • If focus is set to a fixed column header, the grid list is automatically scrolled to top.

    Sticky toolbar
    Sticky toolbar

    Showing more items

    If the grid list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. This request can either be triggered by scrolling (preferred), or by clicking the More button. Use the latter one only if content follows below the grid list. Use the “growing mode”, if more than 200 items are expected to be displayed.

    If using the “More” button,

    • show the number of items already loaded and (if possible) the total number items below the text More.
    • do not show an item count on the title bar. Use the count on the More button instead.

    In any case, if the “growing mode” is used, do not show more than 1,000 items overall.

    Select

    A grid list can have one of the following selection modes (sap.m.GridList/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Items can still use the sap.m.ListType “navigation”, which allows click handling on specific items. Only use this option if the click triggers navigation to a corresponding item details page.
    • Single selection master: One item in the grid list can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from grid lists without selection (mode: None). Single select master is the preferred mode for single selection. (sap.m.ListMode.SingleSelectMaster).
    Selected item in
    Selected item in "single selection master"
    • Single selection left: One item in the grid list can be selected. For this, the grid list provides radio buttons on the left side of each item. Only use this mode if a click on the whole item is being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft). Even in this case, prefer single select master and synchronize the selection with the navigation, so that the navigated item is also the selected item.
    • Multi selection: Users can select one or more items. For this, the grid list provides checkboxes on the left side of each item. (sap.m.ListMode.MultiSelect). The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All must (de)select all items that the user can reach by scrolling. Try to avoid combining multi selection with navigation.
    An unselected and a selected item in
    An unselected and a selected item in "multi selection"
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.
    • For single-selection master-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Click an Item

    The whole item can be clickable. An event is fired by clicking the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a grid list in “single select master” mode.

    Drag and Drop

    One or several items can be repositioned within a grid list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    When using drag and drop, keep the following in mind:

    • Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. They are keyboard operable and available on all browsers.
    • If you offer drag and drop for rearranging items within the grid list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).
    • Be aware that due to the re-arrangement of the items which happens after an item is dropped, it is not always clear where the item will finally be placed.
    • When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item (sap.f.dnd.GridDropInfo, property: dropIndicatorSize).
    • Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.
    • When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on a specific data point, the dropped item needs to take on the value of the target group for the corresponding data point. If this is not wanted, do not allow users to rearrange items in grouped grid lists. Example:
      A grid list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Loading Data

    To indicate that the grid list is currently loading items, use the busy state. (sap.m.GridList, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Empty Grid Lists

    Try not to display an empty grid list. If there is no way around this, provide instructions on how to fill the grid list with data (sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a grid list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the grid list with data.
    • If a grid list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a grid list is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Context Menu

    You can attach a context menu to a grid list. The context menu gives users an alternative way to modify the whole grid list or an individual item by providing access to context-specific actions. A context menu is opened by right-clicking (mouse), long press (touch devices), or via keyboard using the Context Menu key or Shift+F10. If a control inside a grid list is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Be aware that using the context menu overrides the browsers context menu, which can no longer be opened.

    Group

    If grouped, a group header is displayed (sap.m.GroupHeaderListItem) above all items which belong to the corresponding group. The group header is not interactive.

    A grouped grid list
    A grouped grid list

    Guidelines

    Actions

    To trigger actions on multiple items, use a multi-selection grid list (sap.m.GridList, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the toolbar of the grid list. Keep the toolbar sticky (sap.m.GridList, property: sticky).

    In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only if the grid list is the only area on the screen to which actions can be applied and if the actions are finalizing.

    Do not offer actions for multiple items if the grid list is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.GridList, property: mode, value: sap.m.ListMode.SingleSelectMaster), the action can also be shown within the item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every item and thus use a lot of screen real estate, only do this for one or two actions at most. In this case, show the action trigger near the content to which it belongs. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    The following actions on single items must always be in-line:

    • Delete: Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the right side of an item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case.
      Delete is a mode of the grid list and therefore cannot be used together with single selection or multi-selection.
    Delete button
    Delete button
    • Navigation: Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the right side of an item and the entire item becomes clickable. Use this to navigate to a new page containing item details. In rare cases, you can also use this for the category navigation pattern without navigating to another page. By contrast, clicking an interactive control within an item does not trigger the navigation event. Instead, the corresponding control handles the click event.
      “Navigation” is an item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).
    Navigation Indicator
    Navigation Indicator
    • Edit: Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the right side of an item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.
      Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).
    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Add Items

    • Place the Add or Create text button on the toolbar of the grid list.
      • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
      • Use Add if the item already exists and is merely added or assigned to the current object.
    • Place new items always as the first item of the grid list.
    • Use highlight (information state) on the new item.
    • Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three possibilities for adding an item, which should be considered in the following priority:

    • Add the item inline. Create an empty, editable item as the first item of the grid list. Show the Save button on the toolbar of the grid list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    • Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the grid list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the grid list. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level.
      • Create with dialog: A grid list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved on grid list level, but rather with the entire draft.

    Export to Spreadsheet

    Mass Editing

    • Provide multiselection (sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    Paste

    To paste data from the clipboard to the grid list, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    If the focus is on item level, the app has to take the data from the clipboard and add it to the corresponding controls within the items.

    If the focus is on an editable control within an item, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the grid list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the grid list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the grid list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the grid list. Use the filter bar instead.
    • Always use only the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Persist the view settings. When a user reopens the app, show the grid list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort settings, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the toolbar of the grid list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.GridList, property: sticky).
    Guidelines
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).

    Group

    • To display the current group state, group headers are shown.
    • On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):
      [Label of the grouped data point]: [Grouping Value]
    • If there is no grouping value, show the following text:
      [Label of the grouped data point]: (Not Available)
      This is the case if you have a group of items that don’t have a value for the grouped data point.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection,

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action, if it can be applied to all selected items.
    • Enable the action, if it can be applied to a part of the selected items. If the action is triggered, show a message that informs the user about how many items will be affected. Provide the choice to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    To trigger actions that are independent of the selection, show the actions on the toolbar of the grid list. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, and group.

    To trigger a default action on the whole item, use the “Active” or “DetailAndActive” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Active).
    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event but are handled by the interactive control. Do not use Active for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Errors and Warnings

    To indicate that the grid list contains items with errors or warnings, show a corresponding message strip above the grid list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single item, see States above.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Grid list containing errors
    Grid list containing errors

    Grid Lists in Object Pages

    A grid list with up to 20 expected items can be displayed right away, without lazy loading.

    If you expect the grid list to have more than 20 items, use one of the following 3 options:

    • Lazy loading (More button): Use this option if you expect to have up to 100 items.
    • Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the grid list on a dedicated tab.
    • Navigation to a list report: If you expect the grid list to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the grid list itself to a reasonable amount. To provide the user with a way to work with the entire grid list, offer navigation to a separate list report containing all items.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the grid list in the object page. Grouping should be avoided.

    For more information on the use of grid lists within the object page, see Object Page – Tables.

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • The property: inset adds a margin on all sides of the grid list.
    • The property: headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • variantManagement
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole grid list.
    • The property: includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used in combination with these two settings.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the grid list is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators does not have any effect. Do not use this property.
    • The property: swipeDirection does not have any effect. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are currently not visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the grid list to a busy state. While in busy state, the whole grid list cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the grid list has been set to this state. Use the default value.
    • The property: visible shows the grid list (“true”) or hides it (“false”).
    • The property: tooltip provides a tooltip for the whole grid list. Do not use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter shows a number on the right side of an item. This is used in cases like showing the number of subitems.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: CTRL+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets. (Keyboard: CTRL+A)
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased via Shift+Right and decreased via Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position in the corresponding direction via Ctrl+Left / Ctrl+Right.

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    A group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in option to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Selection

    Single Selection

    For single-selection master-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in parentheses after the corresponding string. In this case, you must opt for one criterion for sorting, filtering, and grouping – either the string or the ID. This option is then used for all sort, filter and group actions and can’t be changed later by the user. Use this format only if users don’t need to sort, filter, and group by both the string and the ID.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column – Sorting, filtering, and grouping available for either the text or for the ID, but not for both
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    For amounts, use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level.
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • P13nDialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar. As short cut, use Ctrl+comma.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    The title is optional (property: header).

    Guidelines
    Add a title whenever the title is not indicated in the surrounding area.
    Developer Hint
    If you don’t provide a title, ensure that you support screen reader users: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    Show Details / Hide Details is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, showDetailsButton, annotation: UI.Importance). You can define which column priority levels are hidden (property: detailsButtonSettings). The button only appears if there are corresponding columns in the pop-in area.

    Details hidden
    Details hidden
    Details shown
    Details shown

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    Responsive table within a smart table
    Responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
      The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
      If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
    Guidelines
    Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
    Developer Hint
    For the responsive table, enableAutoColumnWidth also applies the following changes:

    • The smart table property demandPopin is set to true.
    • The responsive table property fixedLayout is set to Strict.
    • The responsive table property contextualWidth is set to Auto.
    • Column resizing is enabled for all columns (including custom columns).
    • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

    In this case, the properties above must not be managed by the app.

    Responsive table with automatically calculated column widths, resizing, and remaining space
    Responsive table with automatically calculated column widths, resizing, and remaining space
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort AscendingSort Descending
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table offers the following options for creating columns automatically:

    1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
    2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields
    Developer Hint
    From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

    • For read-only tables, use the controls provided by the smart table.
    • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
    • For more complex editing cases, use smart fields.
    • For switching between read-only and edit modes:
      • In read-only mode, use the controls provided by the smart table.
      • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

    In cases where the controls are rendered by the smart table, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field Criticality, CriticalityType,
    CriticalityRepresentationType
    Do not use editable status information.
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

    Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, the smart table can show a message strip above the table (aggregation: dataStateIndicator). On the message strip, information about errors or warnings is provided, as well as the possibility to filter down the table to the corresponding rows. When issues are solved or when new issues appear, the message strip is updated accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Table containing warnings
    Table containing warnings
    Table containing errors and warnings
    Table containing errors and warnings
    Guidelines
    To show that an item contains an error,

    Developer Hint
    Binding-related messages are shown automatically.

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Developer Hint

    • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering). Keyboard: the focused column header can be moved by one position to the corresponding direction with Shift+Left / Shift+Right.

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end (keyboard: Ctrl+A). All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets (Keyboard: Ctrl+A).
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged. Keyboard: the focused column header can be moved by one position to the corresponding direction with Ctrl+Left / Ctrl+Right.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.
    • Keyboard interaction: The width of the focused column header can be increased with Shift+Right and decreased with Shift+Left.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the tree column.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Errors and Warnings

    To indicate that the tree table contains items with errors or warnings, show a message strip above the tree table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • For single-selection master-detail scenarios within the flexible column layout, do not show an additional “navigated” indicator.
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.
    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tree tables with up to 8 editable columns. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tree tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the tree table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved at tree table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the master list for a master-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: Only one item is selected.
    Single selection: Only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range. Users can (de)select all items using Ctrl+A. Select All should (de)select all items that the user can reach by scrolling. (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that Ctrl+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection master-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the possibility of clicking somewhere on the item to select it. Use it only if it is really necessary to have two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in 'delete' mode
    Tree in 'delete' mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with single select master.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - Context menu
    Tree - Context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Errors and Warnings

    To indicate that the tree contains items with errors or warnings, show a message strip above the tree. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Tree containing errors
    Tree containing errors

    Content

    Content Formatting

    To display object names with an ID, show the ID in parentheses after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with 'Delete' button
    Items with 'Delete' button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the tree toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable item as the first item of the selected node. Show the Save button on the tree toolbar. This option is recommended for simple scenarios where just a few input fields have to be filled.
    2. Open a dialog for items where up to 8 input fields need to be filled. Save the new item at dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the tree.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the corresponding node. Ignore current sort, filter, and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the tree toolbar or at page level.
      • Create with dialog: A tree showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling, new items are not saved at tree level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Information
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    Always sort the tree in a meaningful way when it first loads.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control provides a dialog for tables that allows the user to personalize one or more of the following attributes:

    • Columns (visibility and order of columns)
    • Sort (sorting of table values)
    • Filter (filtering of table values)
    • Group (grouping for specific attributes)

    These tabs can be shown in any combination, as the use case requires.

    The P13n dialog is intended for complex tables with a large number of columns and the need for complex queries for sorting, grouping, and filtering.
    For simple tables, see view settings dialog and table personalization dialog.

    The P13n dialog can be triggered in the table toolbar using the corresponding buttons in the top right-hand corner of the table.

    The dialog is shown centered, either as a dialog (on desktop and tablet devices) or as a full-screen dialog (on mobile devices).

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • The user is able to personalize more than 20 or so columns.
    • You need several functions for sorting, grouping, and so on.
    • You are using the analytical table.
    • Complex queries have to be built for the relevant table.

    Do not use the P13n dialog if:

    • The user is able to personalize fewer than about 20 columns.
    • You only need a simple column show/hide feature.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), the dialog is shown as a dialog. For size S (smartphones), the P13n dialog is displayed as a full-screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The Columns tab allows the user to change the table columns that are shown and the order in which they are displayed.

    The list contains all of the table’s possible columns in the form of list items with checkboxes. The checkboxes of the currently displayed columns are selected.

    Another button next to the search field in the table toolbar allows the user to toggle between showing all columns and only those that are currently selected in the list.

    Show/Hide

    To show or hide a column, select or deselect the appropriate checkbox.

    Reorder

    To change the order of the columns, simply mark one list item and use the buttons on the right-hand side of the table toolbar to move them up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    If the table has numerous columns, the user can use the search field in the table toolbar to find a specific column more quickly. As soon as the user enters the first letter, the resulting columns are displayed instantly.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    The Sort tab allows the user to sort the table content according to the chosen attributes, and also in either ascending or descending order.

    The sort criterion consists of two input fields. In the first field, the user can choose a column by which the table is to be sorted. In the second field, the user chooses the sort order (ascending or descending).

    For more complex sorting needs, the user can add the required number of criteria by clicking the plus “ ” sign at the end of the line.

    The order of the criteria is exactly the same as the order in which sorting is applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature on column headers replaces ALL sort options in the dialog!

    Filter

    The Filter tab allows the user to filter the table information according to specific criteria.

    Users can add filters with the Add button or remove them by clicking the  (Remove Filter) icon at the end of each filter item.

    Column

    In the first input field, the user selects the column to be filtered. Any column can be selected, including columns that are not currently visible.

    Operator

    The second field contains the operator that is applied to the filter value (such as greater than or not before).

    To include or exclude filter criteria, users select the relevant operator from the Include or Exclude section of the dropdown list. For example, equal to to include a value, and not equal to to exclude it.

    If individual filter criteria have Boolean values, the operator is always “equal to” and the operator dropdown is disabled.

    Available operators:

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true/false)

    • equal to

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column and the selected operator. For example, the value field for fixed or boolean values could be a dropdown list, and input field with suggestions, or a date picker. Two or even more fields can be provided, as required by the use case.

    Information
    If there is a filter bar, use the filter bar functionality and deactivate the filter feature of the P13n dialog.

    Group

    The Group tab enables the user to group the table data by one or more columns.

    In the first selection field, all columns are provided for selection. The user can select a checkbox on the right of the column selection field if the selected field is to be displayed as a column anyway.

    For more complex grouping scenarios, the user can add more grouping options by clicking the plus “ ” button on the right-hand side of each grouping line. This option only works with the analytical table.

    The grouped table shows the selected field as the group header, which can be expanded or collapsed.

    Under the group headers, all subgroup headers and all applicable table entries are displayed.

    Group tab in the P13n dialog
    Group tab in the P13n dialog
    Information
    To group by a specific column, that particular column must be marked as visible on the Columns tab!

    Guidelines

    For opening the dialog from a table toolbar, use different buttons for each function (sort, filter, group, column settings). With each button, open the P13n dialog with just the corresponding tab. Do not display the other tabs.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header (or CTRL+A). Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).

    Keyboard: If the focus is on a row, the space bar selects the corresponding item.

    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    For single-selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for master-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

    In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a message strip above the table. On the message strip, provide information on errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors
    Table containing errors

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

    Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with an “empty space”.

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Don't
    Do not distribute just a few columns across the full width
    Do not distribute just a few columns across the full width
    Do
    Use a fixed column width instead
    Use a fixed column width instead

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Don't truncate column headers
    Don't truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Align buttons with the content hierarchically

    Always place buttons directly next to their content. Do not add an additional column for buttons. If you have more than one button, display them next to each other. Order the buttons based on importance. The most important button is on the left, the least important on the right. If there is not enough space to display them all in one line, move the buttons from the right onto the next line one by one. Do not use more than two buttons per line item.

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available on all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in the master list for a master-detail scenario using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the master list for a master-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Users can (de)select all items using CTRL+A. Select All (de)selects all items that the user can reach by scrolling.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Guidelines

    • Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.
    • For single-selection master-detail scenarios within the flexible column layout, use the mode “single select master”. Do not show an additional “navigated” indicator.
    • Avoid the mode “single select left”. It removes the option to click somewhere on the item to select it. Use this mode only if you really need two different click areas; a small one for a selection, and the rest of the item for something else.
    • If selecting / deselecting all items is important for your app, add a button with the text Select All to the toolbar. Change the button text to Deselect All if all items are selected.

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the CONTEXT MENU KEY, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Errors and Warnings

    To indicate that the list contains items with errors or warnings, show a message strip above the list. On the message strip, provide information about errors or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    List containing errors
    List containing errors

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the list, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority, these are:

    • Add the item inline. Create an empty, editable item as the first item of the list. Show the Save button on the toolbar of the list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items with up to 8 input fields. Save the new item at dialog level.
    • Navigate to a new page. Only use this behavior for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the list.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator (information state).
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the list. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the toolbar or at page level
      • Create with dialog: A list showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of draft handling new items are not saved on list level, but rather with the entire draft.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action which applies to a part of a selection
    Message for an action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items. These are keyboard operable and available for all browsers.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the list. Use the filter bar instead.
    • Only use the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Keep the view settings consistent. When a user reopens the app, show the list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort setting, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings located in the filter bar or in a select control placed in the toolbar of the list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.List, property: sticky).

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. This mode is not recommended (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header. Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).

    Keyboard: If the focus is on a row, the space bar selects the corresponding item.

    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item. (Keyboard: If the focus is on the row itself, the Delete key can be used to trigger the Delete button.)

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable (keyboard: if the focus is on the row itself, the Enter key triggers navigation). If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event (keyboard: If the focus is on the row itself, the F2 key triggers the Edit button). Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    For single-selection cases, use the selection mode “single select master”. This is the recommended single-selection mode for master-detail scenarios within the flexible column layout. If you use it there, do not show a “navigated” indicator.

    In rare cases, you can also use the click area for the row for another purpose (for example, to open dialogs). As a result, the click area cannot be used for selecting the row. In these cases only, use the “single select left” selection mode to offer a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in the default delivery.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Never disable the selection checkbox. If an action can’t be performed on a specific item, inform the user after the corresponding action has been triggered. For more information, see Enabling/Disabling Actions.

    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Errors and Warnings

    To indicate that the table contains items with errors or warnings, show a corresponding message strip above the table. On the message strip, provide information on the current number of errors and/or warnings. When issues are solved or when new issues appear, update the message strip accordingly.

    To indicate an error in a single row, see Item States below.

    For details on displaying errors, warnings, and other messages, see Message Handling.

    Developer Hint
    The sap.m.plugins.DataStateIndicator displays a message strip above the table, which shows binding-related messages.
    Table containing errors and warnings
    Table containing errors and warnings

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. In doing so, it uses all the available space. We recommend overwriting this default to provide optimal space for your content (sap.m.Column, property: width).

    Especially for tables with just a few columns, we recommend assigning a fixed width to each column and to disabling automatic distribution of the remaining available space (property: fixedLayout, value: Strict). In this case, the rest of the table is filled with an “empty space”.

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Don't
    Do not distribute just a few columns across the full width
    Do not distribute just a few columns across the full width
    Do
    Use a fixed column width instead
    Use a fixed column width instead

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Don't truncate column headers
    Don't truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Responsive table with an avatar and an action
    Responsive table with an avatar and an action

    Center-align: All actions in a line item that appear as buttons

    If you have more than one action, display them next to each other. Order the buttons based on importance. The most important action is on the left, the least important on the right. If there is not enough space to display them all in one line, move the actions from the right onto the next line one by one. We recommend a maximum of two buttons per line item.

    Responsive table with icon, avatar, and actions
    Responsive table with icon, avatar, and actions

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose and provide the corresponding keyboard support. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection
    Place actions near to the objects to which they belong
    Place actions near to the objects to which they belong

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter (and ideally Enter in addition) to trigger the Add or Create button.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    Depending on the flow, an item can be in one of three different states:

    • New: The item was just created inline and is in edit mode (for example, after pressing the Create button). It is highlighted with a visual indicator.
    • Recent: The item was just created and is in read-only mode (for example, if Create leads to a dialog, and Save was triggered within the dialog). In this case, keep the item highlighted and display it as the first item of the table. Ignore current sort, filter and grouping criteria to keep the item visible.
    • Added: The item has been fully added. It follows the sort, filter, and grouping settings and also loses the visual highlight. This state is used after:
      • Inline creation: After Save was triggered on the table toolbar or at page level
      • Create with dialog: A table showing one or several items with the state “Recent” gets updated (for example, after sorting, filtering, or grouping, or when the browser is refreshed).

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    Always sort the table in a meaningful way when it first loads. In most cases, this means sorting by the column that identifies the row. This is usually the first column in the default delivery. Use the primary data point from this column.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar. Add the shortcut Ctrl+Comma.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Smart List

    You can use the smart list control to create lists or trees.

    Smart list as list
    Smart list as list
    Smart list as tree
    Smart list as tree
    Information
    Unlike most smart controls, the smart list does not use annotations to create the content automatically.

    When to Use

    You can use the smart list if you use an OData service for your app (OData version 2 only).

    For detailed recommendations on when to use a list or a tree, see the corresponding guideline articles:

    Components

    The smart list control consists of an overflow toolbar (1) in combination with either the list control (2) or the tree control (3).

    Smart list used as a list:

    (1) An overflow toolbar on the top
    (2) List control below

    List components
    List components

    Smart list used as a tree:

    (1) An overflow toolbar on the top
    (3) Tree control below

    Tree components
    Tree components

    Behavior and Interaction

    The individual controls mentioned in the Components section behave exactly as they would on their own.

    For more information, see the respective guidelines:

    Responsiveness

    Both smart list variants are responsive. Each embedded control behaves as specified.

    The following schematic examples show how list and tree use cases appear on different devices.

    Responsive list - Size S
    Responsive list - Size S
    Responsive list - Size M
    Responsive list - Size M
    Responsive list - Size L
    Responsive list - Size L
    Responsive tree - Size S
    Responsive tree - Size S
    Responsive tree - Size M
    Responsive tree - Size M
    Responsive tree - Size L
    Responsive tree - Size L

    Top Tips

    List or tree? What you should consider

    Due to their one-dimensional layout, lists are much easier for users to grasp than trees. First consider if you can use a list to present your data. Only use a tree if your data requires a hierarchy. Make sure that the nodes are clearly labeled and that information is not nested too deeply.

    Developer Hint
    The listType property controls whether the smart list presents itself as a list or tree. It must be appended by either List or Tree to work.

    More guidelines and tips for each component of the smart list

    • Guidelines and tips for toolbars
    • Guidelines and tips for lists
    • Guidelines and tips for trees

    Related Links

    Elements and Controls

    Implementation

    Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    The title is optional (property: header).

    Guidelines
    Add a title whenever the title is not indicated in the surrounding area.
    Developer Hint
    If you don’t provide a title, ensure that you support screen reader users: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: persistencyKeyuseVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    Show Details / Hide Details is mandatory with and only available for the responsive table. Columns with a low priority (low or medium priority on phones) are hidden in the pop-in area (properties: demandPopin, showDetailsButton, annotation: UI.Importance). You can define which column priority levels are hidden (property: detailsButtonSettings). The button only appears if there are corresponding columns in the pop-in area.

    Details hidden
    Details hidden
    Details shown
    Details shown

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    A responsive table within a smart table
    A responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each OData entity property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • A default column width can be calculated for each column based on the data type, the column label, the edit/read-only state, and the annotations: textArrangement, MaxLength for strings, Precision and Scale for numeric data (property: enableAutoColumnWidth).
      The calculated width is between 3 rem and 20 rem. Apps can change this default width if needed (annotation: CSSDefaults).
      If the combined width of all the columns is less than the width of the table, the remaining space stays empty.
    Guidelines
    Choose a column width that avoids truncation for the initial data and (if feasible) for the column header label. If the default column width doesn’t fit, change it.
    Developer Hint
    For the responsive table, enableAutoColumnWidth also applies the following changes:

    • The smart table property demandPopin is set to true.
    • The responsive table property fixedLayout is set to Strict.
    • The responsive table property contextualWidth is set to Auto.
    • Column resizing is enabled for all columns (including custom columns).
    • Labels in the column headers no longer wrap. If there is not enough space, they truncate.

    In this case, the properties above must not be managed by the app.

    Responsive table with automatically calculated column widths, resizing, and remaining space
    Responsive table with automatically calculated column widths, resizing, and remaining space
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one OData entity property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table offers the following options for creating columns automatically:

    1. You can render the smart table in either read-only or edit mode (with no option to switch), or allow users to switch between the two modes (properties: editable, useSmartToggle).
    2. In read-only or edit mode, the smart table renders the controls as listed in the table below, or uses the smart field for both modes. If you use smart fields together with the option to switch between read-only and edit mode, the smart table renders the read-only controls as in the list below, but uses the smart field for edit mode. The smart field limits the rendering options (aggregation: customData, key: useSmartField), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields
    Developer Hint
    From a performance perspective, using the smart field is more expensive than using the controls provided by the smart table directly. With this in mind, follow the rules below:

    • For read-only tables, use the controls provided by the smart table.
    • For simple editing cases with no need for FieldControl or value help on input fields, use the controls provided by the smart table.
    • For more complex editing cases, use smart fields.
    • For switching between read-only and edit modes:
      • In read-only mode, use the controls provided by the smart table.
      • In edit mode, use either smart fields or the controls provided by the smart table, based on the guidance above.

    In cases where the controls are rendered by the smart table, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field Criticality, CriticalityType,
    CriticalityRepresentationType
    Do not use editable status information.
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.

    Sorting, filtering, and grouping only works for the ID, even if the ID is not displayed.

    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker Edm.DateTime, sap:display-format, value: date, IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    In all cases, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Developer Hint

    • To change the layout of the pop-in area (Block, GridSmall, GridLarge), you need to create a responsive table with the corresponding settings (property: popinLayout). You do not need to define anything else. Hand this responsive table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    • Do not use the annotation UI.Importance together with the grid table, tree table, or analytical table. It hides columns with low priority on phones or narrow-width screens, without the possibility to show them again.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control provides a dialog for tables that allows the user to personalize one or more of the following attributes:

    • Columns (visibility and order of columns)
    • Sort (sorting of table values)
    • Filter (filtering of table values)
    • Group (grouping for specific attributes)

    These tabs can be shown in any combination, as the use case requires.

    The P13n dialog is intended for complex tables with a large number of columns and the need for complex queries for sorting, grouping, and filtering.
    For simple tables, see view settings dialog and table personalization dialog.

    The P13n dialog can be triggered in the table toolbar using the corresponding buttons in the top right-hand corner of the table.

    The dialog is shown centered, either as a dialog (on desktop and tablet devices) or as a full-screen dialog (on mobile devices).

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • The user is able to personalize more than 20 or so columns.
    • You need several functions for sorting, grouping, and so on.
    • You are using the analytical table.
    • Complex queries have to be built for the relevant table.

    Do not use the P13n dialog if:

    • The user is able to personalize fewer than about 20 columns.
    • You only need a simple column show/hide feature.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), the dialog is shown as a dialog. For size S (smartphones), the P13n dialog is displayed as a full-screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The first tab is the Columns tab. It allows the user to change the table columns that are shown and the order in which they are displayed.

    The list contains all of the table’s possible columns in the form of list items with checkboxes. The checkboxes of the currently displayed columns are selected.

    Another button next to the search field in the table toolbar allows the user to toggle between showing all columns and only those that are currently selected in the list.

    Show/Hide

    To show or hide a column, select or deselect the appropriate checkbox.

    Reorder

    To change the order of the columns, simply mark one list item and use the buttons on the right-hand side of the table toolbar to move them up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    If the table has numerous columns, the user can use the search field in the table toolbar to find a specific column more quickly. As soon as the user enters the first letter, the resulting columns are displayed instantly.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    The second tab is the Sort tab, which allows the user to sort the table content according to the chosen attributes, and also in either ascending or descending order.

    The sort criterion consists of two input fields. In the first field, the user can choose a column by which the table is to be sorted. In the second field, the user chooses the sort order (ascending or descending).

    For more complex sorting needs, the user can add the required number of criteria by clicking the plus “ ” sign at the end of the line.

    The order of the criteria is exactly the same as the order in which sorting is applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature on column headers replaces ALL sort options in the dialog!

    Filter

    The third tab is the Filter tab, which allows the user to filter the table information according to specific criteria.

    The filter criteria can be included or excluded in the relevant section of the filter. There is only one operation dropdown for both include/exclude operations.

    Column

    In the first input field, the user selects the column to be filtered. Any of the columns can be selected; even those that are not currently visible.

    Option

    The second field offers an operator for specifying the filter in more detail. The operators that are available depends on the data type of the selected column.

    Filter tab in the P13n dialog
    Filter tab in the P13n dialog

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true / false)

    • equal to

    The only available operator for excluding values from the filter results is equal to.

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column.

    Two or even more fields can be provided as required by the use case.

    For more complex cases, the user can add filters by clicking the plus “ ” button or remove them by clicking the Remove button at the end of each filter item.

    Information
    If there is a filter bar, use its filter functionality and deactivate the filter feature of the P13n dialog.

    Group

    The last tab is the Group tab, which enables the user to group the table data by one or more columns.

    In the first selection field, all columns are provided for selection. The user can select a checkbox on the right of the column selection field if the selected field is to be displayed as a column anyway.

    For more complex grouping scenarios, the user can add more grouping options by clicking the plus “ ” button on the right-hand side of each grouping line. This option only works with the analytical table.

    The grouped table shows the selected field as the group header, which can be expanded or collapsed.

    Under the group headers, all subgroup headers and all applicable table entries are displayed.

    Group tab in the P13n dialog
    Group tab in the P13n dialog
    Information
    To group by a specific column, that particular column must be marked as visible on the Columns tab!

    Guidelines

    For opening the dialog from a table toolbar, use different buttons for each function (sort, filter, group, column settings). With each button, open the P13n dialog with just the corresponding tab. Do not display the other tabs.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    View Settings Dialog

    The view settings dialog helps users to sort, filter, or group data within a (master) list or a table. The dialog is triggered by icon buttons in the table toolbar.

    Usage

    We recommend making each feature (sort, filter, group) available as a separate button in the table toolbar (see Button Placement below). Each button then triggers a separate dialog. If specifically required, you can combine the dialogs into one with a segmented button acting as tabs to switch between the sort, filter and group options. Note: In a combined dialog, the Reset button resets all tabs.

    Use the view settings dialog if:

    • Users need to sort line items in a manageable list or table (up to about 20 columns).
    • You need to offer custom filter settings in a manageable list or table (up to about 20 columns).
    • Users need to group line items in a manageable list or table (up to about 20 columns).

    Do not use the view settings dialog if:

    • You have complex tables (more than about 20 columns).
    • Users need to rearrange columns within the table. Use the table personalization dialog instead.
    • Users need very specific sort, filter, or column sorting options within complex tables. Use the P13n dialog instead.

    Button Placement

    Use distinct icon buttons for the sort, filter, and group settings. Place the icons in the following order:   (Sort) (Filter)  (Group).

    Do not place Sort, Filter, or Group buttons in the footer toolbar if they refer to a table.

    For more information about the button placement, see Sort, Filter, Group (Generic) in the table toolbar article.

    Sort, Group, and Filter a List

    You can also offer the view setting features for a list.

    Responsiveness

    The popover dialog appears as a modal window on desktop and tablet screen sizes, but uses the full screen on smartphones.

    The view settings dialog is a composite control that consists of a modal dialog with a maximum of three tabs with lists of attributes. Each helps the user to either sort, filter, or group a table or list. If the use case requires only a sort feature, for example, you can hide the filter and group tabs.

    The dialog is triggered by one of the icon buttons in the table header
    The dialog is triggered by one of the icon buttons in the table header
    View settings dialog - Size S
    View settings dialog - Size S
    View settings dialog - Size M
    View settings dialog - Size M
    View settings dialog - Size L
    View settings dialog - Size L

    Behavior and Interaction

    The sort, filter, and group features can all be applied to a table simultaneously.

    Sort

    The sort dialog shows two groups of sort settings. The first group offers general Ascending and Descending sort options. The second group offers attributes that fit the use case, such as Product, Supplier, Weight, or Price. The attributes can match the table columns, but because a table column can also contain several data points, such as “Name” and “Surname”, the attributes allow an attribute to be shown for each data point.

    Users can select attributes using the radio buttons. Clicking OK closes the dialog and shows the table items in the selected order.

    If a combined dialog is used, the first tab is the sort feature.

    View settings dialog - Sort
    View settings dialog - Sort

    Filter

    The filter dialog can offer a single filter selection list, a multi-filter selection list, or a category list. The category list provides an overview, and allows the user to drill down to detailed filter selection lists.

    In a combined view settings dialog, filtering is on the second tab.

    Filter Selection List – Single Selection

    The dialog offers one selection list with radio buttons to select a filter. This list is useful for offering a list of preconfigured filters for a specific use, such as “Products with numbers ‘starting between 100 and 200’ with status ‘in stock’ and color ‘green’”.

    Filter Selection List – Multi-Selection

    You can also offer a multi-selection list. For example, a user might want to show all open items for both “Company A” and “Company D”.

    Show Selected Only

    If the user clicks the    button (Show Selected Only), only the selected filters are shown (for example, “Company A” and “Company D”). Clicking the button again shows all of the available filter values.

    Multiple filters selected
    Multiple filters selected
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown
    Multiple filters with 'Show Selected Only' option active - only selected filters are shown

    Category List

    The filter dialog shows a single list of general filter categories depending on the use case, like Price or Height. The user chooses a category by clicking the list item, such as Price. As this is a simple drilldown, these categories do not have radio buttons. The follow-on dialog shows a list of optional filter settings in the Price category. These filters, such as Less than 100, depend on the use case. The user chooses a specific filter setting by selecting one of the radio buttons offered in this list. Clicking OK closes the dialog and shows the table items filtered by the selected attribute. The infobar shows which filter has been set.

    Example: Filter Dialog with Category List

    1) Select a category
    1) Select a category
    2) Option to refine filters for the selected category (here: 'Weight')
    2) Option to refine filters for the selected category (here: 'Weight')
    3) Infobar showing the filter setting for a table view filtered by 'Weight'
    3) Infobar showing the filter setting for a table view filtered by 'Weight'

    Free-Form Apps

    You can also customize your own filter UIs, for example, to support date picking.

    Filter Values

    Filters can correspond to single values as well as groups, such as “<100.00 EUR”.

    Filter Reset

    The Reset button on the filter tab resets all filter settings.

    Removing Filters

    In single selection lists, offer a Not Filtered option. This enables users to remove existing filters.

    Group

    The group dialog shows two groups of attributes. The first group offers a general Ascending or Descending order, which allows the user to select the order in which the defined groups appear. The second group offers attributes that fit the use case, such as Type or Supplier.

    You can also offer an attribute like Price to group data in a table.

    Users can choose attributes using radio buttons or checkboxes. Clicking OK closes the dialog and shows the table with items grouped below headers.

    In a combined view settings dialog, the group feature is the third tab.

    Dialog for choosing an attribute from the group tab
    Dialog for choosing an attribute from the group tab
    Table view grouped by supplier – Group headers divide the list
    Table view grouped by supplier – Group headers divide the list

    Naming Group Headers

    Be sure to name the group headers as follows: <Category Name>: <Value/Range>

    Examples:

    • Category: Accessories
    • Supplier: Red Point Stores.

    Guidelines

    On the table toolbar, use different buttons for each function (sort, filter, group). With each button, open the View Settings dialog with just the corresponding tab.

    If possible, give users the option not to filter or group. For sorting, this is only necessary if the use case calls for an unsorted list. In all three cases, show this option as the first entry in the list of criteria (remember to include the brackets):

    • (Not Sorted)
    • (Not Filtered)
    • (Not Grouped)

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Category Navigation

    You can use the category navigation pattern to replace tree-like structures with only a few levels in a responsive environment. In this pattern, the breadcrumb control replaces the title control. The category navigation pattern is used only in rare cases.

    Usage

    Use category navigation if:

    • You need to show categorized data in a responsive environment.
    • You need to replace a tree table on tablets and smartphones, and the tree table has a maximum of five levels.
    • You need to show hierarchical data with different details at each level, which cannot be represented in a tree table.

    Do not use category navigation if:

    • You need only two levels, and the upper level identifies the category. In this case, use a grouped responsive table instead.
    • You need more than five levels. In this case, use a tree table.
      On a smartphone or tablet device, try to display the data on just five levels. You can do this in one of two ways:

      • Remove unnecessary root levels.
      • Offer the same items in different branches.

    Responsiveness

    The pattern is based on a responsive table. In contrast to the standard responsive table, the title is used to display a breadcrumb showing the current level.

    The breadcrumb control determines the text of the current/last element in the breadcrumb path. It only consists of text (string element).

    The responsiveness is handled by the control: As soon as the breadcrumb is truncated, it provides a dropdown menu to access further navigation levels.

    Category navigation - Size S
    Category navigation - Size S
    Category navigation - Size M
    Category navigation - Size M
    Category navigation - Size L
    Category navigation - Size L

    Layout

    The breadcrumb appears in the toolbar, and replaces the table title.

    At any given level, the responsive table contains the individual line items, including their column header, as well as the categories available for further drilldown.

    Category navigation - Layout
    Category navigation - Layout

    Components

    Use the breadcrumb control to implement the category navigation pattern. Display the navigation levels as text. Use links for the titles of all levels above the current level to enable fast navigation across the levels.

    A breadcrumb showing three levels
    A breadcrumb showing three levels

    If only the root level is displayed, there is no link.

    A breadcrumb showing the root level only
    A breadcrumb showing the root level only

    When the breadcrumb is truncated, breadcrumb control provides a dropdown menu with the hidden navigation levels. The breadcrumb shows the title of the currently selected level.

    Breadcrumb changes to a dropdown menu if there is insufficient space
    Breadcrumb changes to a dropdown menu if there is insufficient space

    Use one or several responsive tables to list the items for the different levels, depending on the columns shown on each level.

    Responsive table
    Responsive table

    Within the responsive table, use the item navigation mode for container items.

    Container item with navigation indicator
    Container item with navigation indicator

    Do not use the navigation mode for leaf items.

    Leaf item without navigation indicator
    Leaf item without navigation indicator

    Behavior and Interaction

    Initial State

    Initially, this pattern looks like a standard responsive table with control items.

    Navigation to Second Level (Drill-In)

    Clicking an item drills into it in one of the following ways:

    • The content of the responsive table is changed (if all columns are the same on the second level).
    • The entire responsive table is changed (if there are different columns on the second level).

    Navigation to Third Level

    You can offer further navigation at item level. The breadcrumb adapts accordingly.

    Leaves at the second level do not offer further navigation.

    Initial state
    Initial state
    State after navigating to the second level
    State after navigating to the second level
    State after navigating to the third level
    State after navigating to the third level

    Guidelines

    Navigation to Second Level (Drill-In)

    Change the title to a breadcrumb.

    Show navigation indicators if there are more levels.

    State after navigating to the second level
    State after navigating to the second level

    Navigation to Third Level

    Use control items to enable further navigation.

    Make sure that the breadcrumb adapts accordingly. Don’t show a navigation indicator for leaves.

    State after navigating to the third level
    State after navigating to the third level

    Enable backward navigation via the breadcrumb links. When the user navigates back to a higher level, show exactly the same state as before.

    If navigating back, show the former state
    If navigating back, show the former state

    If there is not enough space to show the entire breadcrumb, use the dropdown menu provided by the control to show the hidden navigation levels.

    Show a dropdown menu within the breadcrumb control on small screens
    Show a dropdown menu within the breadcrumb control on small screens

    Within the dropdown menu, show all parent nodes below the current node.

    Show the levels of the breadcrumb inside the dropdown menu (select)
    Show the levels of the breadcrumb inside the dropdown menu (select)

    When the user navigates between the different levels, change only the responsive table and the breadcrumb. Do not change anything else or navigate to another page.

    Placement

    Place the breadcrumb control in a way that makes sense to the user.

    • If you are using the breadcrumb in combination with segmented buttons, place the breadcrumb above the toolbar and display the segmented buttons on the very left. That way, the page navigation is on a higher level than the view switch.
    Breadcrumb with segmented buttons in hierarchy
    Breadcrumb with segmented buttons in hierarchy
    • If you are using the breadcrumb with a tab pattern, replace the table title with the breadcrumb and display it under the tabs.
    Breadcrumb with tabs
    Breadcrumb with tabs

    Related Links

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance. Examples include the master list and the attachment list.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - More items on the same screen real estate
    Analytical table in condensed mode - More items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering).

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Group total
    Group total

    The overall aggregation is shown at the bottom of the analytical table.

    Overal aggregation
    Overal aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).

    In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.

    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content In the default delivery
    Don't truncate the initial visible content In the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in brackets after the corresponding string. In this case, sorting, filtering and grouping is available for either the string or the ID. Use this format only if users don’t need to sort, filter, and group by both values.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping only by the text
    Text and ID in one column – Sorting, filtering, and grouping only by the text
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    Use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, drag and drop is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose, such as (toolbar) buttons.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control provides a dialog for tables that allows the user to personalize one or more of the following attributes:

    • Columns (visibility and order of columns)
    • Sort (sorting of table values)
    • Filter (filtering of table values)
    • Group (grouping for specific attributes)

    These tabs can be shown in any combination, as the use case requires.

    The P13n dialog is intended for complex tables with a large number of columns and the need for complex queries for sorting, grouping, and filtering.
    For simple tables, see view settings dialog and table personalization dialog.

    The P13n dialog can be triggered in the table toolbar using the corresponding buttons in the top right-hand corner of the table.

    The dialog is shown centered, either as a dialog (on desktop and tablet devices) or as a full-screen dialog (on mobile devices).

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • The user is able to personalize more than 20 or so columns.
    • You need several functions for sorting, grouping, and so on.
    • You are using the analytical table.
    • Complex queries have to be built for the relevant table.

    Do not use the P13n dialog if:

    • The user is able to personalize fewer than about 20 columns.
    • You only need a simple column show/hide feature.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), the dialog is shown as a dialog. For size S (smartphones), the P13n dialog is displayed as a full-screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The first tab is the Columns tab. It allows the user to change the table columns that are shown and the order in which they are displayed.

    The list contains all of the table’s possible columns in the form of list items with checkboxes. The checkboxes of the currently displayed columns are selected.

    Another button next to the search field in the table toolbar allows the user to toggle between showing all columns and only those that are currently selected in the list.

    Show/Hide

    To show or hide a column, select or deselect the appropriate checkbox.

    Reorder

    To change the order of the columns, simply mark one list item and use the buttons on the right-hand side of the table toolbar to move them up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    If the table has numerous columns, the user can use the search field in the table toolbar to find a specific column more quickly. As soon as the user enters the first letter, the resulting columns are displayed instantly.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    The second tab is the Sort tab, which allows the user to sort the table content according to the chosen attributes, and also in either ascending or descending order.

    The sort criterion consists of two input fields. In the first field, the user can choose a column by which the table is to be sorted. In the second field, the user chooses the sort order (ascending or descending).

    For more complex sorting needs, the user can add the required number of criteria by clicking the plus “ ” sign at the end of the line.

    The order of the criteria is exactly the same as the order in which sorting is applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature on column headers replaces ALL sort options in the dialog!

    Filter

    The third tab is the Filter tab, which allows the user to filter the table information according to specific criteria.

    The filter criteria can be included or excluded in the relevant section of the filter.

    Column

    In the first input field, the user selects the column to be filtered. Any of the columns can be selected; even those that are not currently visible.

    Option

    The second field offers an operator for specifying the filter in more detail. The operators that are available depends on the data type of the selected column.

    Filter tab in the P13n dialog
    Filter tab in the P13n dialog

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true / false)

    • equal to

    The only available operator for excluding values from the filter results is equal to.

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column.

    Two or even more fields can be provided as required by the use case.

    For more complex cases, the user can add filters by clicking the plus “ ” button or remove them by clicking the Remove button at the end of each filter item.

    Information
    If there is a filter bar, use its filter functionality and deactivate the filter feature of the P13n dialog.

    Group

    The last tab is the Group tab, which enables the user to group the table data by one or more columns.

    In the first selection field, all columns are provided for selection. The user can select a checkbox on the right of the column selection field if the selected field is to be displayed as a column anyway.

    For more complex grouping scenarios, the user can add more grouping options by clicking the plus “ ” button on the right-hand side of each grouping line. This option only works with the analytical table.

    The grouped table shows the selected field as the group header, which can be expanded or collapsed.

    Under the group headers, all subgroup headers and all applicable table entries are displayed.

    Group tab in the P13n dialog
    Group tab in the P13n dialog
    Information
    To group by a specific column, that particular column must be marked as visible on the Columns tab!

    Guidelines

    For opening the dialog from a table toolbar, use different buttons for each function (sort, filter, group, column settings). With each button, open the P13n dialog with just the corresponding tab. Do not display the other tabs.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table – Content Formatting Cheat Sheet

    A table often implies a “boring” layout. It contains plain text, one value per cell, and fails to catch the user’s attention. In contrast, the responsive table is much more flexible and eye-catching. It also contains many options for formatting the table content. Due to small screen widths on mobile devices, these options are necessary in order to reduce the number of visible columns.

    This cheat sheet shows you how you can transform a plain table into the cutting edge style of SAP Fiori. Take a look at the example below.

    Usage

    Use this cheat sheet if:

    Do not use this cheat sheet if:

    Guidelines

    Step
    01
    Starting point: A “traditional” table with one line of text per cell.

    Traditional table
    Traditional table
    Step
    02
    Change the alignment:

    • Left-align text, IDs, phone numbers, URLs, passwords, email addresses, and status information.
    • Right-align numbers (except IDs and phone numbers), dates, and times.

    Change the alignment
    Change the alignment
    Step
    03
    Use the object identifier control to display key identifiers.
    Use the object identifier control for key identifiers
    Use the object identifier control for key identifiers
    Step
    04
    Use the object number control (sap.m.ObjectNumber, property: emphasized) to emphasize the key attribute (usually the value of a value-unit combination).
    Use the object number control to display key attributes
    Use the object number control to display key attributes
    Step
    05
    To indicate status information, use an object status control with semantic text colors. For more information on semantic colors, see colors.
    Use the object status control to display status information
    Use the object status control to display status information
    Step
    06
    Remove columns by displaying the ID in brackets after the corresponding name.
    Use ID-formatting to reduce the number of columns
    Use ID-formatting to reduce the number of columns
    Step
    07
    To gain even more width per column, remove additional columns by combining them.
    Combine columns
    Combine columns

    And you’re done. With just a few simple steps, you can easily bring the SAP Fiori style to a plain table.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Smart Table

    Intro

    The smart table creates a responsive table, grid table, tree table, or analytical table based on an OData (Open Data Protocol) service and its annotations. The table toolbar comes with additional built-in features, such as personalization, export to spreadsheet, and variant management.

    When to Use

    Use the smart table if:

    • You use an OData service for your app (OData version 2 only).
    • The feature set of the smart table fits for your app. In this case, the smart table is faster to implement.
    • You need more than one of the major features of the smart table. Otherwise, you might not benefit from a shorter implementation time. For example, if you just need the export to spreadsheet feature, creating a responsive table directly is usually faster than using the smart table.

    Do not use the smart table if:

    • You use a different technology to OData version 2. Use the corresponding table control directly.
    • You need more flexibility in the content design, such as several different row templates or less complex personalization features. Use the responsive table directly.
    • You do not have complex data. Another control like a select, combo box, list, grid list, tree, or smart list might do the job better.
    • You have very complex data. Did you check the chart?
    • Users need to switch between a chart and table. The smart table is not designed to work inside an existing chart container. In this case, use either the smart chart or the corresponding table directly.
    • You need to layout different controls in a table-like grid. Use a flexible grid instead.
    • You need to layout different input fields with labels. Use a form, simple form, or smart form.

    Components

    The smart table consists of a table toolbar (1), an infobar (2), and a table (3).

    The components of a smart table
    The components of a smart table

    Table Toolbar

    Toolbar with all features provided by the smart table out-of-the-box
    Toolbar with all features provided by the smart table out-of-the-box

    The table toolbar is generated automatically. The following toolbar content is provided by the smart table out-of-the box:

    1. Title
    2. Item counter
    3. Variant management
    4. Show Details / Hide Details
    5. View Settings
    6. Export to Spreadsheet
    7. Maximize / Minimize

    In addition, you can add app-specific actions.

    Title

    The title is optional (property: header).

    Guidelines
    Add a title whenever the title is not indicated in the surrounding area.
    Developer Hint
    If you don’t provide a title, ensure that you support screen reader users: create a simple table in the XML view, use ariaLabelledBy to point to the corresponding text, and add this table to the smart table. Make sure that the table type within the smart table is set accordingly. The smart table will take care of the rest (creating columns, and so on).

    Item Counter

    The item counter is optional and only available if you show a title (property: showRowCount).

    Guidelines
    Show the item counter together with the table title, unless:

    Variant Management

    Variant management is optional (properties: useVariantManagement, currentVariantID, association: smartVariant).

    Guidelines
    Use variant management only if really needed.

    Show Details / Hide Details

    Show Details / Hide Details is mandatory with and only available for the responsive table. It shows/hides columns with low priority in the pop-in area (properties: demandPopin, showDetailsButton, annotation: UI.Importance). The button only appears if there are corresponding columns in the pop-in area.

    View Settings

    View Settings are optional. The button triggers a P13n Dialog (property: useTablePersonalisation). The View Settings dialog can also be opened with the shortcut Ctrl+Comma.

    Guidelines
    Offer view settings only if they are really needed. Tables with just a few columns and rows do not need to be sorted, filtered, or grouped.

    Sort and Filter

    Sorting, filtering, and column settings are automatically available for all columns in all tables. For single columns, you can remove the sort and filter settings (annotations: SortRestrictions, FilterRestrictions).

    • The current sort state and sort order is displayed as an icon in the column header of the sorted columns.
    • The current filter state is displayed as follows:
      • In the responsive table, an infobar is shown if filters have been set in the table personalization settings.
      • For all other tables, filtering is indicated by an icon in the column header of each filtered column.

    When amounts with different currencies appear in a single column, you can change the sort behavior to sort these columns first by currency, then by amount (annotation: ApplyMulitUnitBehaviorForSortingAndFiltering). This behavior is applied for all such columns in the smart table. It cannot be defined per column.

    Guidelines

    • Do not turn off the info bar (property: useInfoBar).
    • In the default delivery, sort items in a meaningful order. This works only for the grid table, tree table, and analytical table. You can also provide default filter settings (all tables) and grouping (responsive table and analytical table only) (annotation:
      PresentationVariant).
    • If the smart table is used together with a filter bar (property:
      smartFilterId), do not offer filtering for the smart table itself.

    Developer Hint
    The smart table can be linked to a smart filter bar. If linked, the filter bar settings are automatically applied to the smart table (sap.ui.comp.smarttable,SmartTable, property: smartFilterId).

    Group

    Group settings are only available for the responsive table (all columns, one level only) and the analytical table (dimension columns only, multiple levels).

    The following text is usually shown on the group header:
    [Label of the grouped column]: [Grouping value]

    Within the analytical table, the grouped column remains visible by default if it is grouped using the P13n Dialog. The column is hidden if it is grouped using the column header menu.

    Guidelines
    In some cases, the group header text may not be shown automatically as described. This applies to special cases in the analytical table (for example, if the displayed text is not taken directly from the data source), as well as custom columns in both responsive and analytical tables. In such cases, you must set and format the group header text yourself.

    Column Settings

    Column settings are used to show and hide columns. For the grid table, tree table, and analytical table, the column settings automatically enable resizing via the column header and size-to-fit for text-only columns (double-click on column separator line).

    Guidelines
    If sorting, grouping, and/or filtering are needed, also show the column settings (sap.ui.comp.smarttable.SmartTable, property: useTablePersonalisation).
    Developer Hint
    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    Export to Spreadsheet

    Export to Spreadsheet is optional. The button triggers either a front-end export using the export to spreadsheet utility, or a back-end export via Gateway (properties: useExportToExcel, exportType). The front-end export allows for additional settings and can also be triggered with the shortcut Ctrl+Shift+E.

    Guidelines

    • Only offer the Export to Spreadsheet option if your end users typically export the data shown in the table to work with it in a spreadsheet application.
      • This is usually the case if data is collected from several systems and analyzed in the spreadsheet application.
      • This is not usually the case for worklists, attachment lists, tables with only a few items, shopping carts, or data that does not need to be analyzed.
    • If you offer the Export to Spreadsheet button, use the front-end export.
    • If your table has columns with non-textual content, provide a textual equivalent for those columns. Non-textual content is not exported.

    Warning
    With both methods, the file size is limited by the available browser memory. As a result, exporting large tables can lead to memory overflows and crash the export process.

    Apply the following size restrictions as a rule-of-thumb:

    • For the front-end export, do not export more than 2 million table cells on desktop browsers or 100,000 table cells on tablets and phones.
    • For the back-end export, do not export more than 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    Maximize / Minimize

    Maximize / Minimize is optional. It allows users to show the table in full screen mode and to exit full screen mode (property: showFullScreenButton).

    Guidelines

    App-Specific Actions

    App-specific actions can only be added using a custom toolbar (aggregation: customToolbar).

    Developer Hint

    Infobar

    Infobar with filter information
    Infobar with filter information

    The infobar is only available for the responsive table. It indicates which filter settings are currently active. If no filters are set, the infobar is hidden (property: useInfoToolbar, value: Auto).

    Guidelines

    Table

    A responsive table within a smart table
    A responsive table within a smart table

    The table is generated automatically. The sections below describe the behavior and different possibilities:

    Table

    The table provides the following features:

    Guidelines

    • Use the responsive table wherever possible. Use the other table types only if really needed. If you use another table, provide a fallback solution for phones.
    • For the responsive table, the smart table initially loads 20 items and shows a More button for loading additional items. Change this behavior if:
      • You expect fewer than 200 items. Load all items from the start (sap.m.Table, property: growing).
      • You expect more than 200 items. Adapt the number of items initially loaded to cater for large screens, and load additional items automatically when the user scrolls down (sap.m.Table, property: growingScrolllToLoad).

    Developer Hint
    To change the growing behavior, create a responsive table with just the settings for the growing behavior, and hand it over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on).
    Developer Hint

    • The property tableBindingPath defines the path from which the data is fetched.
    • The property enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.

    Developer Hint
    To change the selection mode, add a navigation indicator to single rows, or add a highlight to specific rows, you need to create a table with the corresponding settings. You do not need to define anything else. Hand this table over to the smart table. The smart table then takes care of the rest (such as adding columns, and so on). This method allows you to use the multi-selection plug-in with the grid table, tree table, and analytical table.

    Column Visibility

    • Columns are created automatically. Items are rendered based on the properties and metadata of the underlying OData service (annotation: LineItem, properties: entitySet, tableBindingPath, initiallyVisibleFields, ignoreFields). A column is generated for each property.
    Developer Hint
    If a column needs to be in the model but should not be shown, you can hide it from both the table and the P13n dialog (property: ignoredFields, annotation: UI.Hidden).

    Use this option if:

    • A column is needed to provide an ID that is used for navigation purposes only. However, you only want to display the corresponding text on the UI, and not the ID.
    • The values of a column are needed to perform calculations, but only the results are shown on the UI.

    You can use the property requestAtLeastFields to request additional (technical) columns with every request, regardless of whether these columns are currently visible. This does not work with the analytical table.

    The property ignoreFromPersonalization is only available with the analytical table. It loads additional key fields that are needed for aggregations but are never visible.

    Developer Hint
    Columns can be removed at runtime. This is useful if the same table is used for similar, but slightly different objects. For one of the objects, specific columns need to be shown, for others they must be hidden, and users must not be able to add them in the personalization settings (function: deactivateColumn).
    • You can define which columns are initially visible when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleFields).
    Guidelines

    • Keep the number of initially visible columns to a minimum. Avoid pop-in behavior (responsive table) or horizontal scrolling (all other tables) on a tablet screen size in the default delivery (annotation: PresentationVariant/ LineItem).
    • Also keep the number of additional columns offered in the personalization settings to a minimum. You can use the P13n dialog to let users show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value: false).

    • For each column that is initially visible, the LineItem annotation includes a DataField record, which allows you to influence the content rendering of the smart table.
      For columns that are initially invisible, the content rendering can also be influenced via the annotation DataFieldDefault.
    Developer Hint
    If the same column is defined via LineItem and via DataFieldDefault, LineItem wins.

    Column Layout

    • For the grid table, tree table, and analytical table, a default column width is calculated for each column based on the data displayed in it (annotations: MaxLength, Precision, Scale). Apps can change this default width if it does not fit (annotation: CSSDefaults).
    • By contrast, the responsive table uses the same width for each column. To change this, use a custom column. End users cannot change the column width in the responsive table.
    Guidelines
    Choose a column width which avoids truncation for the initial data as well as for the column header label. If the default column width does not fit, change it.
    • If the automatically generated content does not fit for your use case, you can override the automatic behavior with your own column template.
      You can also add further columns. This allows you to provide columns with app-specific or inline actions, columns which show calculated values (based on more than one property), or – for responsive tables – columns that show more than one control.
    Developer Hint
    To add or override columns (“custom columns”):

    • Use an XML view to define the underlying table with just the columns to be added/overridden.
    • To override columns, provide the column key of the column you want to exchange.
    • Add this “unfinished” table to the smart table. The smart table adds all the automatically generated columns and additional features.

    Make sure that the sortProperty and the filterProperty are set (define p13nData via the aggregation CustomData). If you offer the export to spreadsheet option,  ensure that it works as expected.

    If you are using a responsive table, also make sure that the responsive behavior for this column works as expected (sap.m.Column, property: importance).

    Column Headers

    • You can specify a column header text for each column (annotation: sap:label).
    Guidelines
    Provide a column header text for each column. (annotation: sap:label).
    • The column headers contain the following settings:
      • Sort
      • Filter: Opens the P13n Dialog. If this does not fit for your use case, exchange this menu item (property: enableCustomFilter)
      • Group (only analytical table, only on dimension columns)
      • Total (only analytical table, only on measure columns): This setting is not persisted (annotation: sap:aggregation-role, value: measure).
        If a column contains entries with different units of measurement, a Show Details link appears instead of the total. Clicking the link opens a popover showing the subtotals per unit of measurement.
      • Freeze (only available for grid table, tree table, and analytical table): Must be added manually.
    Guidelines
    Offer column totals by default for all columns where totals make sense (annotation: PresentationVariant).
    Developer Hint
    To add a Freeze option manually, declare the corresponding table inside the smart table in the XML view, and use the corresponding settings for this inner table.
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a dimension column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table
    Column header menu for a measure column of an analytical table within a smart table

    Content

    The smart table provides two options for creating columns automatically:

    1. The smart table is rendered in either read-only or edit mode. In this case, the smart table renders the controls as described below. This is the default and recommended way to render content and fits for most use cases (property: editable).
    2. If users need to switch between read-only and edit mode at runtime, the smart table uses smart fields for both modes. This limits the rendering options (aggregation: customData, key: useSmartField, property: smartToggle), but also allows for:
      • Better control of the visibility of a field per row (smart field, annotation: FieldControl)
      • Use of value help for input fields

    For option 1, the following controls are used:

    Read-only Edit Annotations / Edm type Comment
    Static text Text Input field Edm.String
    Decimal numbers Text Input field Precision, Scale, Edm.Byte, Edm.Decimal, Edm.Double, Edm.Int16, Edm.Int32, Edm.Int64, Edm.SByte, Edm.Single
    Status information Object status or Icon Input field CriticalityType,
    CriticalityRepresentationType
    Key identifier Object identifier (responsive table)
    Text
    (all other tables)
    Input field for the ID SemanticKey,
    Common.EditableFieldFor
    Text and ID Text, object status, or object identifier Input field for the ID TextArrangement Use together with the annotation mentioned above for static text, status information, or key identifier.
    Links with/without quick view Smart link Smart link SemanticObject Smart links can be customized using the aggregation: semanticObjectController
    Dates Text Date picker sap:display-format, value: date,
    IsCalendarDate
    Dates and times Text Date/time picker Edm.DateTime, Edm.DateTimeOffset
    Times Text Time picker Edm.Time
    Fiscal periods Text Input field IsFiscalYear, IsFiscalPeriod, IsFiscalYearPeriod, IsFiscalQuarter, IsFiscalYearQuarter, IsFiscalWeek, IsFiscalYearWeek, IsDayOfFiscalYear
    Amounts with currencies Two text controls Input field for the amount sap:semantics, value: currency-code In edit mode, the currency is shown as static text next to the input field.
    Phone numbers Link Input field IsPhoneNumber Opens the system application for making phone calls.
    Email Link Input field IsEmailAddress Opens the system application for writing emails.
    Pictures Image Input field IsImageURL Only available for the responsive table. In edit mode, the input field contains the URL to the image.
    Boolean Text Checkbox Edm.Boolean For read-only, the displayed text is Yes or No.

    For option 2, the smart field is used in all cases.

    For both options, the smart table automatically takes care of the content alignment and formatting (except for custom columns).

    Input fields can be accompanied by a value help dialog (annotation: ValueList). If annotated, triggering the value help button opens a value help dialog. Within this dialog, you can provide a search field (annotation: ValueList, property: SearchSupported).

    If no ValueList annotation is provided, you can restrict the number of characters for an input field (annotation: MaxLength).

    You can provide additional controls, such as micro charts, rating indicators, progress indicators, and buttons, as custom columns (using an XML view). For custom columns, you must provide any read-only and editable content manually.

    Guidelines
    For inline actions, use a text-only or an icon-only button. Make sure the icon communicates the function clearly enough. Otherwise, use a text-only button.

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator on the left of the item (property: highlight).

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, export to spreadsheet, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Empty Tables

    If there is no data to show, the smart table renders a default text. This text can be overwritten by the app development team. The default texts are:

    • If a table is initially empty:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
      (property: initialNoDataText, value: $NO_FILTERBAR)
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
      (property: initialNoDataText, value: $FILTERBAR)
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.
      (aggregation: noData, changeable at runtime)
    • If the user has hidden all of the columns in the personalization settings, the following text is shown:
      Right now, there are no visible columns in the table. Please select the columns you need in the table settings.
      This text cannot be changed.
    Guidelines

    • For all other cases, provide instructions on how to fill the table with data (aggregation: noData).
    • The “no data” text can be exchanged at runtime. Use specific texts for different situations.
    • Avoid displaying a table without any items, especially when the app is initially loaded.

    An empty smart table
    An empty smart table

    Responsiveness

    The smart table acts exactly like the embedded controls. For details see:

    • Toolbar Overview
    • Infobar
    • Responsive Table via auto pop-in mode
      (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true).
      You can use the UI.Importance annotation to influence the priority of each column.
      You can provide a Show Details button to let users show/hide columns with low importance (property: showDetailsButton).
    • Grid Table, Tree Table, Analytical Table:
      These controls are not intended for use on smartphones. If you use a smart table with this configuration, ensure that you implement a fallback solution for small screens.
    Guidelines
    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true). Ensure that the most important columns stay in the tabular layout as long as possible (annotation: UI.Importance). The most important columns are those that contain the following information:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    Examples

    Responsive table within a smart table
    Responsive table within a smart table
    Grid table within a smart table
    Grid table within a smart table

    Top Tips

    • If you are using the responsive table, enable and configure the auto pop-in mode and use the Show Details / Hide Details button.
    • For custom columns, follow the guidelines of the respective table. If needed, use responsive paddings for aligning the content.
    • Enable only the features that are needed for your use case. Very small tables do not need to be sorted, filtered, grouped, and rarely exported. Don’t just add unnecessary features for consistency purposes.
    • If the page has a filter bar, don’t offer filtering for the table.
    • If you are using custom columns, make sure that any export and personalization features you are using also work for these columns.

    Properties

    The following properties are available for sap.ui.comp.smarttable.SmartTable:

    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.

    Related Links

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    1. Select All – The Select All checkbox selects or deselects all items.
    2. Column header – The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.
    3. Selector cells – The selector cells allow the user to select one or more items.
    4. Items – The collection of items, or rows, occupies the main part of the grid table.
    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scrollbar
    Scrollbar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering).

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    A group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in option to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    Don't truncate the initial visible content in the default delivery
    Don't truncate the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in brackets after the corresponding string. In this case, sorting, filtering and grouping is available for either the string or the ID. Use this format only if users don’t need to sort, filter, and group by both values.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    Use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (Ctrl+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering).

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scrollbar
    Tree table – Vertical scrollbar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Enable the shortcut Ctrl+Enter to trigger the Add and Create buttons.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.

    The collection of items, or rows, occupies the main part of the grid table.

    The selector cells allow the user to select one or more items.

    The Select All button selects or deselects all items.

    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering).

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Less columns than space available
    Less columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in possibility to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table first instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scroll bar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    In the default delivery, the initial visible content should not be truncated
    In the default delivery, the initial visible content should not be truncated
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in brackets after the corresponding string. In this case, sorting, filtering and grouping is available for either the string or the ID. Use this format only if users don’t need to sort, filter, and group by both values.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    Use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (CTRL+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid Table

    A grid table contains a set of data that is structured in rows and columns. It allows the user to scroll in both directions and can handle large numbers of items and columns.

    Usage

    Use the grid table if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the grid table is easier to handle. In contrast to the responsive table, the architecture of the grid table is optimized for handling large numbers of items. Note that a grid table is not fully responsive. It is only available for desktop and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, a grid table might be more appropriate than a responsive table. In the grid table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that a grid table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an analytical table, but you cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the grid table if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices, such as file browsing and a list of documents you want to act on, like purchase orders and purchase requisitions.
      • Selecting one or several items is the main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • Data needs to be structured in a hierarchical manner. Use a tree table instead. Note that neither the tree table nor the grid table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container such as HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The grid table is not optimized for form-like input navigation.

    Responsiveness

    A grid table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a grid table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Grid table shown on a desktop
    Grid table shown on a desktop
    Grid table shown on a tablet
    Grid table shown on a tablet

    Layout

    The column header allows the user to resize and rearrange columns. It also provides access to a menu with column-specific commands.

    The collection of items, or rows, occupies the main part of the grid table.

    The selector cells allow the user to select one or more items.

    The Select All button selects or deselects all items.

    Schematic visualization of the grid table
    Schematic visualization of the grid table

    Components

    A grid table does not consist of other elements. However, it is common to use a toolbar above the grid table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    A grid table is quite restricted in terms of its content.

    Table Level

    Scroll

    A grid table allows horizontal and vertical scrolling (sap.ui.table.Table, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the grid table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    The grid table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection Mode

    Selection for a grid table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    A non-selection grid table
    A non-selection grid table

    Single selection: One item in the grid table can be selected. A row selector column is shown. (property: selectionMode = Single)

    A single-selection grid table
    A single-selection grid table

    Multiple selection: One or more items can be selected. The grid table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and you can display a corresponding message (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.Table, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    A multiselection grid table
    A multiselection grid table
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the grid table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection grid tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection grid tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the grid table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons – one to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and the columns that follow are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. In case all columns together take up more width than the table control, a scrollbar appears. (sap.ui.table.Column, property: width)
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only if all or most of the columns shrink significantly. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.Table, property: enableColumnReordering).

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.ColumnMenu, property: visible):

    • Sort Ascending/Descending (sap.ui.table.Column, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.Column, property: showFilterMenuEntries)
    • Group (sap.ui.table.Table, property: enableGrouping)
    • Freeze from the first to the last specified column (sap.ui.table.Table, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table. Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table. Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.Column, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing Enter when the focus is on the filter input field, the grid table is filtered by the corresponding column and value (sap.ui.table.Table, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.Column, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.Column, property: enableGrouping).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header. The header text consists of the name of the value and the number of items in the specific group. Only one grouping level is possible.

    Group header
    Group header

    Once line items have been grouped, the corresponding column is hidden. There is no built-in possibility to ungroup the grid table again. Therefore, provide a view settings dialog or table presonalization dialog to offer an additional way to group by a column and a way to ungroup the complete table.

    An exception to this is when the table is grouped from the start and should not be ungrouped at all.

    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Group headers shown, the corresponding column hidden: no duplicates, but a confusing change
    Warning
    Note that grouping the grid table is experimental and currently works only on items loaded to the front end. Thus, scrolling down the table leads to data not being grouped as expected.

    Only use this feature if you have just a few line items, all of which are loaded to the front end. If this is the case, consider using a responsive table first instead of a grid table.

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.Table, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table. Table, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.Table, property: rowHeight).

    Line item
    Line item

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.Table, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Grid table with a context menu
    Grid table with a context menu

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Guidelines

    Data Density vs. Complexity

    The grid table can be used to display large amounts of data. Unfortunately, the grid table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • If you set a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    • In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.
    Don't
    Do not add checkboxes to the first data column in the default delivery
    Do not add checkboxes to the first data column in the default delivery

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.ui.table.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Grid table in busy state while loading data
    Grid table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    The grid table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scroll bar appears if the width of the table is not enough to show all columns. If the columns use less space than available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough for showing all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum.

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel / rem / em vs. percent / auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves the readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unexpected side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    In the default delivery, the initial visible content should not be truncated
    In the default delivery, the initial visible content should not be truncated
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align the following: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align numbers (except IDs).

    This ensures comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Locale Settings

    Be locale-aware: show dates, times, numbers, and so on in the format corresponding to the user’s locale settings.

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following options:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in brackets after the corresponding string. In this case, sorting, filtering and grouping is available for either the string or the ID. Use this format only if users don’t need to sort, filter, and group by both values.
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    Text and ID in two columns – Allows sorting, filtering, and grouping on both
    If displayed as a link, use only the text as the link, not the ID
    If displayed as a link, use only the text as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column – Sorting, filtering, and grouping only on the text
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)
    Text and ID in one column - If displaying a link, show the whole string as the link (text and ID)

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.Column, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bulletcomparisonstacked bar. When using micro charts, use them in size XS.

    Micro charts in a grid table
    Micro charts in a grid table

    Empty Tables

    Avoid empty grid tables. If necessary, provide instructions on how to fill the grid table with data (sap.ui.table.Table, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the grid table within the list report floorplan, show an overlay on the grid table and the corresponding toolbar (sap.ui.table.Table, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the grid table is has not yet been updated.

    Grid table with invalid data
    Grid table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string Modified in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    Number and Unit in Same Cell

    The number and the unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    Use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    Number and Unit in Separate Columns

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    Show the unit of measurment on the column header, if the unit of measurement is the same for all rows. If not, show the unit of measurement within the row.

    Drag and Drop

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Don't
    Do not combine rearranging items with sorting
    Do not combine rearranging items with sorting

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only as a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a mutliselection grid table (sap.ui.table.Table, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the grid table.

    Single Item

    To trigger actions on a single item (sap.ui.table. Table, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the grid table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more information, see Mass Editing.

    Interactive controls – In line
    Interactive controls – In line

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the grid table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Be persistent. When reopening the app, show the analytical table in the same view settings (sort/ filter/ group/ aggregation settings) as last defined by this user.

    Sort

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.Column, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header:

    [Grouping value] – [Item count for the group]

    Group headers
    Group headers

    In general, offer reasonable grouping by default if appropriate. Enable the user to ungroup via the view settings dialog or via the table personalization dialog.

    Personalization

    Only offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases.

    Persist the column layout. When a user reopens the app, show the grid table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column to the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    To freeze columns, offer the setting in the column header menu (sap.ui.table.Table, property: enableColumnFreeze). Selecing Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.Table, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using the analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    The browser paste function can be used to paste data from the clipboard to the table (CTRL+V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via the context menu does not work if a custom context menu is used.

    Properties

    sap.ui.table.Table

    The following additional properties are available for the grid table:

    • The property: width defines the width of the grid table.
    • The property: rowHeight defines the height of each row in the grid table. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the grid table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the grid table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the grid table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the grid table. The grid table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Do not use it. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Do not use it.
    • The property: enableGrouping turns the experimental grouping on or off. Handle with care.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event to which apps can react, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the grid table. Do not use this. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the grid table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.Column

    The following additional properties are available for the column:

    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Do not use this property.
    • The property: Tooltip does not have an effect. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Analytical Table (ALV)

    An analytical table contains a set of data that is structured in rows and columns. It provides several powerful possibilities for working with the data, including advanced grouping and aggregations.

    In contrast to other tables, the analytical data binding used by the analytical table allows an aggregated number to be shown automatically in a cell. This means that a number in such a summarized cell is a total sum of several lines in the database.

    Usage

    Use the analytical table (ALV) if:

    • The cell level and the spatial relationship between cells are more important than the line item. Examples include spreadsheet analyses and waterfall charts. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You have to work on more than 1,000 rows. In this case, the analytical table is easier to handle. In contrast to the responsive table, the architecture of the analytical table is optimized for handling large numbers of items. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, an analytical table might be more appropriate than a responsive table. In the analytical table, each cell contains only one data point. In contrast, the responsive table is more flexible regarding line items, including the ability to add more data points per cell and also the pop-in function. Both make comparisons more difficult. Note that an analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.

    Do not use the analytical table (ALV) if:

    • You need a table. The responsive table is the default table in SAP Fiori. Additional use cases where you might need the responsive table include:
      • You need to provide a total sum for one column. You can also add totals to the responsive table.
      • The focus is on working on line items, not on cells. The responsive table is optimized for displaying complete items on all devices (such as purchase orders and purchase requisitions).
      • Selecting one or more items is a main use case and details are needed to choose the correct item.
      • Line items are independent of each other and no operation across columns is needed.
      • You want to have only one implementation for all devices.
    • The main use case is choosing one item from a very small number of items with no additional details. A select or combo box might be more appropriate.
    • The main use case is choosing one out of several items with only a few details per item. A list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance. Examples include the master list and the attachment list.
    • You cannot provide an analytical binding on the technical side. In this case, a grid table will do the work. Note that the grid table provides only one level of grouping, no aggregation options, and is also not responsive.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain children. Note that neither the tree table nor the analytical table are responsive. You will need to take an adaptive approach by offering an additional UI for smartphones and tablets.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container like HBox or VBox.
    • You need read-only or editable field-value pairs. Use a form instead. The analytical table is not optimized for form-like input navigation.

    Responsiveness

    The analytical table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use an analytical table for desktop use cases, note that you must implement a fallback solution for mobile and touch devices. This fallback solution does not need to support all use cases.

    You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.

    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a desktop
    Analytical table (ALV) shown on a tablet
    Analytical table (ALV) shown on a tablet

    Components

    An analytical table does not consist of other elements. However, it is common to use a toolbar above the analytical table.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog or for the p13n dialog, as well as for view switches in the form of a segmented button, and buttons for Add, Edit, and other actions.

    Behavior and Interaction

    An analytical table is quite restricted in terms of its content, although it provides powerful features for working with the content.

    Table Level

    Scroll

    An analytical table allows horizontal and vertical scrolling (sap.ui.table.AnalyticalTable, property: navigationMode, value: Scrollbar).

    You can add any number of line items to the analytical table, which is known as “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.AnalyticalTable, property: rowHeight).

    The analytical table is optimized to allow faster scrolling within the first 1000 items.

    Scroll bar
    Scroll bar

    Select

    Selection for an analytical table depends on the chosen selection mode. The following options are available:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Analytical table without item selection
    Analytical table without item selection

    Single selection: One item in the analytical table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Analytical table with single selection
    Analytical table with single selection
    • Multiple selection: One or more items can be selected. The analytical table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range. For multiple selection, you can choose between two variants.
      • Multi-toggle mode (property: selectionMode = MultiToggle)
      • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

      These variants behave differently when the user selects more items than are currently loaded in the front end.

      Multi-toggle

      In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

      Multi-selection plug-in

      If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

      • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
      • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
        • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
        • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
      • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the analytcial table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.AnalyticalTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Analytical table with multiple selection
    Analytical table with multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the analytical table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Compact, Cozy, and Condensed

    Like all SAP Fiori controls, the analytical table is shown in compact mode on a desktop and in cozy mode on tablets.

    For desktop devices, you can fit even more rows onto the screen by using the condensed mode together with the compact mode. This renders less white space for each item.

    Note that the condensed content density must always be set in addition to the compact mode. Do not use the condensed mode on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable or unwanted results, such as cozy-sized controls in condensed-sized containers, missing padding, and so on.

    Note that neither compact mode nor condensed mode support touch interaction. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells with their fingers.

    For more information on cozy and compact modes, see content density.

     

     

     

     

    Analytical table in compact mode
    Analytical table in compact mode
    Analytical table in condensed mode - more items on the same screen real estate
    Analytical table in condensed mode - more items on the same screen real estate

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table.AnalyticalColumn, property: Resizable). Double-clicking the line optimizes the column according to the length of the data currently visible and the label of the column header (sap.ui.table.AnalyticalColumn, property: Autoresizable).
    • Touch interaction: The user clicks the column header to reveal two buttons: one to show the column header menu and one for resizing. The user drags the latter to resize the column.

    When the user resizes a column, the adaptation of the column width depends on how the column widths are set:

    • If column widths are set in pixel-based units (px, em, rem), the resized column is adapted and subsequent columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together do not use up the full width of the table control, empty space is added. If all the columns together exceed the width of the table control, a scrollbar appears.
    • If all column widths are set as percentages or “auto”, resizing one column automatically resizes one or more other columns. Resizing can also affect the position of the resized column. This option utilizes the full width of the table and ensures that no white space is added. A scrollbar appears only if all or most of the columns become to narrow. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this minimum width is only taken into account if columns are resized automatically. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    Users can rearrange columns by dragging the column header to another position (sap.ui.table.AnalyticalTable, property: enableColumnReordering).

    Column header
    Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Columns do not use up the available space
    Columns do not use up the available space

    Column Header Menu

    For each column, a menu can contain the following menu items (sap.ui.table.AnalyticalColumnMenu, property: Visible):

    • Sort Ascending/Descending (sap.ui.table.AnalyticalColumn, property: showSortMenuEntries)
    • Free text filter (sap.ui.table.AnalyticalColumn, property: showFilterMenuEntries)
    • Group
    • Totals
    • Freeze from the first to the last specified column (sap.ui.table.AnalyticalTable, property: enableColumnFreeze)

    For each column, the menu can be replaced by an app-specific menu.

    Column header menu
    Column header menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.AnalyticalColumn, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text (sap.ui.table.AnalyticalColumn, properties: filterProperty, showFilterMenuEntries).

    If the user enters a term in the input field and triggers the search by pressing ENTER when the focus is on the filter input field, the analytical table is filtered by the corresponding column and value (sap.ui.table.AnalyticalTable, properties: filtered, filterProperty, filterValue, filterOperator, sap.ui.table.AnalyticalColumn, property: filterType).

    Note that the filter may return zero results, in which case, the table might be empty.

    General recommendations for filtering:

    • If filtering is a main use case, choose the filter bar or any other filtering UI over the built-in free text filter.
    • Only use the free text filter if filtering is a secondary use case and if the filter bar is too heavy.
    Free text filter in column header menu
    Free text filter in column header menu

    Group

    The column header menu can provide the option to group by this column (sap.ui.table.AnalyticalColumn, property: sortProperty).

    One group collects all items with the same value within the corresponding column.

    Group setting in column header menu
    Group setting in column header menu

    If line items are grouped in a column, every group is provided with a collapsible or expandable group header (sap.ui.table.AnalyticalColumn, property: grouped). The header text consists of the column name and the value for the corresponding group (sap.ui.table.AnalyticalColumn, property: groupHeaderFormatter). Several grouping levels are possible.

    The corresponding column can be hidden to avoid duplicates (sap.ui.table.AnalyticalColumn, property: showIfGrouped). Exercise caution when using this option since hiding the column changes the table layout and may lead to confusion.

    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers and the corresponding columns are shown – The relevant data is duplicated
    Group headers shown, the corresponding column hidden – No duplicates
    Group headers shown, the corresponding column hidden – No duplicates

    Aggregation

    The column header menu can provide the option to show or hide aggregation totals for this column.

    Aggregation in column header menu
    Aggregation in column header menu

    Intermediate aggregations are shown at group level for the corresponding columns if the group contains more than one line item (sap.ui.table.AnalyticalColumn, property: summed).

    Group total
    Group total

    The overall aggregation is shown at the bottom of the analytical table.

    Overal aggregation
    Overal aggregation

    Freeze Columns

    The column header menu can provide the option to freeze columns (sap.ui.table.AnalyticalTable, property: enableColumnFreeze). Selecting Freeze freezes all columns up to the one in which the operation was triggered (sap.ui.table.AnalyticalTable, property: fixedColumnCount).

    When Freeze is triggered, the menu item changes to Unfreeze for the corresponding column.

    Freeze setting in column header menu
    Freeze setting in column header menu

    Line Item Level

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height.

    (sap.ui.table.AnalyticalTable, property: rowHeight)

    Line item
    Line item

    Drag and Drop

    One or several items can be moved to other UI elements using drag and drop operations (sap.ui.table.AnalyticalTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Cell Level

    A cell provides one data point.

    It can contain one of the following controls to display this data point:

    While it is technically possible to also use other controls, doing so could lead to issues with alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false). Do not wrap.

    Cell
    Cell

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    By default, the analytical table provides a context menu on the group headers (for example, Expand, Collapse, …). Otherwise, no default context menus are provided.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Analytical table with context menu
    Analytical table with context menu

    Guidelines

    Data Density vs. Complexity

    The analytical table can be used to display and work with large amounts of data. Unfortunately, the analytical table has a high data density and therefore conveys an immediate feeling of complexity.

    Only show tables with a lot of data as a last resort. To make the data easier to read, you should instead try the following:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Try to minimize the number of columns, especially if there is a large number of rows.

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area.

    Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534).

    The item count in the table title includes all the visible items that a user can reach by scrolling or expanding groups. Group headers are not included.

    Remove the item count in the table title if there are zero items.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Multiple Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).

    In multiple selection mode (multi toggle), do not show checkboxes in the first data column in the default delivery to avoid confusion.

    Don't
    Do not add checkboxes to the first column
    Do not add checkboxes to the first column

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.AnalyticalTable, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Columns – Best Practices

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery.

    By default, the analytical table assigns the same width to each column. We recommend overwriting this default to provide optimal space for your content (sap.ui.table.AnalyticalColumn, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the size of the browser window results in a scrollbar. If the user resizes a column, and the total width of all columns exceeds the table width, a scrollbar appears. If the columns do not take up the full table width, white space appears to the right of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Reducing the size of the browser window truncates the texts. This ensures that the columns fill up all the available space. A scrollbar appears only if width of all the columns still exceeds the table width after the automatic width adjustments. To avoid the side effect of undersized columns, you can set a minimum width per column. However, this this minimum width is only taken into account if columns are automatically resized. End users can still reduce the column width to below the defined minimum (sap.ui.table.Column, properties: width, minWidth).

    If you set the column width to “auto”, the behavior is the same as for “percentage”. However, unlike “percentage”, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that the values in the columns are not spread over the whole screen on wide screens, which improves the readability of the line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious when mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it can also cause even more side effects when resizing a column. If you are using percentage-based widths for one or more columns, consider not allowing end users to resize columns at all.

    Optimize the column width for its initial visible content, including the column header texts. If this is not possible (for example, if showing the full texts would result in extremely wide columns), let the texts truncate. End users can change the width of the column to read the full text, as needed.

    Maintain a constant column width and avoid adjusting it automatically when the content changes.

    Always keep to one line of text. Do not wrap.

    Don't
    In the default delivery, the initial visible content should not be truncated
    In the default delivery, the initial visible content should not be truncated
    Don't
    Never wrap texts
    Never wrap texts

    Column Headers – Best Practices

    For each column, provide a label in the column header. In the default delivery, do not truncate the column header texts. Only let the text truncate if showing the full text would make the column too wide. Never wrap the text.

    Content Alignment

    For alignment of cell content, follow the guidelines below.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers, except IDs, to ensure comparability of numbers and amounts.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align amounts with currencies to the cell and align them in terms of their respective decimal points.

    This ensures that amounts with different currencies are shown correctly, whether these currencies have 0, 2, or 3 decimals.

    For aligning to the decimal point, use the sap.ui.uinified.Currency control.

    Alignment to decimal point
    Alignment to decimal point

    Right-align dates and times.

    This ensures comparability for most formats and locales.

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Left-align micro charts.

    XS micro charts in condensed mode
    XS micro charts in condensed mode

    Content Formatting

    Key Identifier

    Use a bold label or an emphasized link as the key identifier of an item. In the default delivery, show the key identifier in the first column.

    Emphasized link
    Emphasized link

    For strings with IDs, use one of the following:

    • Show the ID in a separate column. Use this format if users need to sort, group, or filter by both the string and the ID.
    • Show the ID in brackets after the corresponding string. In this case, sorting, filtering and grouping is available for either the string or the ID. Use this format only if users don’t need to sort, filter, and group by both values.
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    Text and ID in two columns – Allows sorting, filtering, and grouping for both
    If displayed as a link, use only the string as the link, not the ID
    If displayed as a link, use only the string as the link, not the ID
    Text and ID in one column – Sorting, filtering, and grouping only by the text
    Text and ID in one column – Sorting, filtering, and grouping only by the text
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Truncation

    Avoid truncation of typical content in the default delivery (sap.ui.table.AnalyticalColumn, property: width). However, since the columns are resizable, do not worry too much if truncation occurs as columns can still be enlarged if necessary.

    To prevent adverse side effects when scrolling vertically, all line items must also have the same height. If you need to decide between truncation and different row heights, choose truncation. Do not wrap.

    Optimize column width for typical content, not all content
    Optimize column width for typical content, not all content

    Number of Links

    Are there too many links? Use subtle links to avoid a wall of links. Standard links are also emphasized more if they are surrounded by subtle links.

    For example, a financial table consists of several columns with summarized cells. A summarized cell shows the total sum of several database entries. Each sum should be a link to a report that shows details about which database entries produce the total sum. The line item identifier should also be a link that provides more detail about the line item itself. Use a standard or emphasized link for the item identifier, and subtle links for the summarized cells.

    Emphasized links, links, subtle links, and text
    Emphasized links, links, subtle links, and text

    Missing Value

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    In terms of numbering items:

    • If the item number is more like an ID with regard to its description, use ID formatting as described above.
    • In all other cases, use a separate column for the item number.
    Add a separate column for the item number
    Add a separate column for the item number

    Status

    For status information, use semantic colors on the foreground elements.

    For status information on text, use an object status.

    Semantic colors on text
    Semantic colors on text

    Micro Charts

    Use only the following micro charts: Bullet, comparison, stacked bar. When using micro charts, use them in size XS.

    Micro charts in an analytical table
    Micro charts in an analytical table

    Empty Tables

    Avoid empty analytical tables. If necessary, provide instructions on how to fill the analytical table with data (sap.ui.table.AnalyticalTable, properties: noDataText, showNoData).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).
    Provide meaningful instructions
    Provide meaningful instructions

    Invalid State

    To show an invalid state of the analytical table within the list report floorplan, show an overlay on the analytical table and the corresponding toolbar (sap.ui.table.AnalyticalTable, property: showOverlay). The overlay prevents user interactions.

    Use this within the list report floorplan if filter settings have been changed but the analytical table has not yet been updated.

    Analytical table with invalid data
    Analytical table with invalid data

    Item States

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) in an additional column with the label Editing Status.

    In the default delivery, add a column directly behind the key identifier.

    A modified item
    A modified item

    To show that a modified item contains an error, for example, within the global edit flow, add the string Contains errors in the Editing Status column and highlight the row accordingly. This string replaces the Modified string.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add a transparent-style button with the corresponding icon and the text Locked by [name] in the Editing Status column.

    A locked item
    A locked item

    To show that an item is in draft state, add a transparent-style button with the text Draft in the Editing Status column.

    Item in draft state
    Item in draft state

    Show only one state at a time.

    Numbers and Units

    Show the unit of measurement in one of the following ways:

    The number and unit are in the same cell. Do this if sorting, filtering, or grouping by the unit of measurement are not needed.

    Use a currency control to display the concatenated string.

    Number and unit of measurement in one cell
    Number and unit of measurement in one cell

    The number and unit are in separate columns. Do this if sorting, filtering, or grouping by the unit of measurement are a common use case.

    Note that this column can be hidden or moved independently of the column containing the corresponding number. Therefore, be sure to have clear labels for both columns to communicate the dependency.

    Number and unit of measurement in two columns
    Number and unit of measurement in two columns

    If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, drag and drop is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose, such as (toolbar) buttons.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    Do not use drag and drop for rearranging items in the analytical table. The analytical table is mainly used for grouping items and for calculating the totals per group and column. Moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. Because changing the value in this way doesn’t make sense, rearranging items is not permitted in analytical tables.

    Don't
    Do not use drag and drop for rearranging items in the analytical table
    Do not use drag and drop for rearranging items in the analytical table

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Actions

    Multiple Items

    To trigger actions on multiple items, use a multiselection analytical table (sap.ui.table.AnalyticalTable, property: selectionMode, value: MultiToggle). Offer the corresponding actions in the table toolbar.

    Do not offer action triggering on multiple items if the table is generally expected to have fewer than 10 items. In this case, try to use the responsive table instead of the analytical table.

    Single Item

    To trigger actions on a single item (sap.ui.table.AnalyticalTable, property: selectionMode, value: Single):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Single Cell

    To trigger actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    To trigger navigation on line item level choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation.
    • Add the RowActions column and show the navigation indicator (  ) at the end of the row. The navigation arrow triggers the navigation.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Use the RowActions column only for one or both of the following actions:

    • Navigate to details page ( )
    • Delete ( )

    The RowActions column does not provide a column header text. It is fixed and will not scroll away. Users also cannot personalize this column.

    Navigate to details page
    Navigate to details page

    Single Cell

    For triggering actions on a single cell, create the corresponding click event. Do not use the cell click event if the cell contains interactive controls, such as links.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Editable Content

    For editable content, only use the following controls, and only one control per cell:

    Only these controls are optimized for all viewing modes of the analytical table.

    If you need edit mode, change your text controls, such as label, text, link, object status, icons, and currencies, to editable controls as soon as you switch to edit mode, but not before. You can do this by exchanging the controls, for example, from sap.m.Text to sap.m.Input.

    For mass editing items:

    • Provide multiselection.
    • Provide an Edit button.
    • If several items are selected, clicking the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    This is similar to mass editing in the split-screen layout floorplan.

    Warning
    Do not offer editing for summarized cells. A summarized cell shows the total sum of several database entries. Changing the total sum does not make sense since it is unclear how this sum is divided between the different database entries.
    Interactive controls – Inline
    Interactive controls – Inline

    View Settings

    There are several ways to show Sort, Filter, and/or Group settings:

    • Column header menu: In all cases, show the corresponding settings in the column header menu.
    • View settings dialog: Simple and more flexible with regard to filter settings. No advantage for sorting. Allows the user to ungroup grouped columns.tables with a medium amount of items.
    • Table personalization dialog: Provides complex options for sorting items by several levels and allows the user to ungroup grouped columns. It also provides a query-builder-like approach for filter settings. The complexity of the options is also its downside. Use the table personalization dialog for tables with a large number of items.
    • If filtering is a main use case, use the filter bar. In this case, avoid offering additional filter settings on the table. If you do, the filter settings on the table work only on the result set provided by the filter bar.

    Always be careful when synchronizing the settings in the dialog with the settings from the column header menu.

    Trigger the dialogs in one of the following ways:

    • View settings dialog: Provide several buttons, one for each of these view settings. Each button opens the view settings dialog on the corresponding page.
    • Table personalization dialog: Provide a settings button, which opens the table personalization dialog containing all pages.

    Use only the view settings you really need. For example, do not offer grouping if it does not support your use case.

     

    Column header menu with view settings
    Column header menu with view settings
    Table toolbar with triggers for view settings dialog
    Table toolbar with triggers for view settings dialog
    Table toolbar with trigger for table personalization dialog
    Table toolbar with trigger for table personalization dialog

    Persist the view settings. When a user reopens the app, show the analytical table with the same sort, filter, group, and aggregation settings as last defined by this user.

    Sort

    To display the current sort state, an icon is shown in the column header of the last sorted column. This icon indicates the sort direction (sap.ui.table.AnalyticalColumn, properties: sorted, sortOrder, sortProperty).

    For the default sort setting, sort by the column that identifies the row, which is usually the first column in default delivery. Use a meaningful sort order, such as alphabetical order for text, numeric order for numbers, or chronological order for dates.

    Column, sorted ascending
    Column, sorted ascending
    Column, sorted descending
    Column, sorted descending

    The descending sort order must always be the exact reverse of the ascending sort order.

    For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, an icon is shown in the column header of the filtered column (sap.ui.table.AnalyticalColumn, properties: filtered, filterProperty, filterValue, filterOperator, defaultFilterOperator, filterType).

    Column, filtered
    Column, filtered

    Group

    To display the current group state, group headers are shown. Show the following text in the group header (sap.ui.table.AnalyticalColumn, properties: grouped, showIfGrouped, groupHeaderFormatter):

    [Label of the grouped column]: [Grouping value]

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

     

    Set the property collapseRecursive to “false” to keep subgroups expanded even after collapsing and expanding the parent group.

    Group headers, several levels
    Group headers, several levels

    On non-touch devices, right-clicking a group header opens the group header menu. On touch devices, the same menu is opened by using the menu icon on the right side of a group header.

    The group header menu provides several options:

    • Show/Hide: Shows or hides the column in the table layout, although it is grouped.
    • Ungroup: When the user ungroups a column, the corresponding group headers disappear. If the column was hidden, it is shown again as a separate column.
    • Ungroup All: The columns are shown again.
    • Move Up: Rearranges the grouping levels hierarchy by moving the selected group above the group that is one level higher up in the hierarchy.
    • Move Down: Rearranges the grouping levels hierarchy by moving the selected group below the group that is one level lower down in the hierarchy.
    • Collapse Level: Collapses all groups on the corresponding grouping level.
    • Collapse All: All groups are collapsed.
    Group header menu
    Group header menu
    Group header on touch devices
    Group header on touch devices

    In general:

    • Offer grouping on objects and attributes.
    • Do not offer grouping on measures.
    • If appropriate, offer reasonable grouping by default, but do not exaggerate. As a rule of thumb, use up to three group levels.
    • Provide more space for the first column. Grouping needs an indent per group level. Extra space in the first column prevents truncated text.

    Aggregate

    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.

    If items are grouped, an intermediate sum is shown:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    (sap.ui.table.AnalyticalColumn, property: summed)

    When aggregating amounts with different units of measurement, show an asterisk (*) in the aggregation rows.

    When sorting an aggregated column, only the leaf nodes of a group are included by default. If each measure column currently displays a single unit of measurement, the order of the groups can also be affected.

    For example:
    Let’s assume that table items are grouped by Country/Region and aggregated by Total Net Amount. If you sort the Total Net Amount column in descending order, the largest total net amount is shown first.

    Warning
    Only enable sorting by totals if each column has a single unit of measurement. This prevents inconsistencies in the sorting behavior, which depends on user settings, such as filter settings or the columns currently displayed.
    Developer Hint
    To allow sorting by totals, the following conditions must be met:

    1. For each measure column, multiple units must not occur in the displayed data, regardless of whether or not totals are shown.
    2. The autoExpandMode of the AnalyticalBinding must be set to Sequential. Note that the default is Bundled.

    In general:

    • Offer aggregation on measures, but not on objects or attributes.
    • Avoid aggregations on the first three columns for the default delivery. As soon as grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.
    • Where appropriate, offer reasonable aggregation by default.
    Aggregation and groups
    Aggregation and groups

    Personalization

    Only offer personalization if you need more columns than a tablet screen can display at any one time, which is usually five.

    Persist the column layout. When a user reopens the app, show the analytical table with the same column layout settings as last defined by this user.

    Add, Remove, and Rearrange Columns

    To add, remove, or rearrange columns, use one of the following:

    • The table personalization dialog: It offers some simple settings for column layout. Use this if you have only a few columns to choose from and/or you use the view settings dialog.
    • The p13n dialog: Besides various complex view settings, it also provides settings for column layout. Use this if you have a large number of columns to choose from and/or you use this dialog anyway for view settings.

    In both cases, trigger the dialog via the settings button in the table toolbar.

    You can also use drag and drop to rearrange columns (sap.ui.table.Table, property: enableColumnReordering). If you allow rearranging via drag and drop as well as via a dialog, keep both places in sync.

    Resize Columns

    Resizing columns works differently on touch and non-touch devices.

    • Non-touch devices: Drag and drop the column separator on the right side of the column. Double-clicking the column separator optimizes the width of the column for the data currently loaded into the front end, which is usually about 100 rows.
    • Touch devices: Clicking the column header reveals two buttons: one for opening the column header menu, another one for resizing the column. Drag and drop this second button to resize the column.

    Freeze Columns

    For freezing columns, offer the setting in the column header menu (sap.ui.table.AnalyticalTable, property: enableColumnFreeze).

    Selecting Freeze on a column freezes all columns from the first one to the one where Freeze is selected. On this column, the menu entry changes from Freeze to Unfreeze.

    Frozen column
    Frozen column

    Highlight Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.AnalyticalTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Properties

    sap.ui.table.AnalyticalTable

    The following additional properties are available for the analytical table:

    • The property: width defines the width of the analytical table.
    • The property: rowHeight defines the height of each row in the analytical table. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderHeight defines the height of the column headers. Since the height required is calculated automatically by the analytical table, this property is only needed rarely.
    • The property: columnHeaderVisible can be used to hide the column headers. Always show the column headers.
    • The property: showColumnVisibilityMenu provides an additional entry in the column header menu that allows columns to be shown or hidden. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: columnVisibilityMenuSorter is used for sorting the columns inside the column header menu if showing and hiding columns is provided in the menu. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Do not use this property.
    • The property: visibleRowCount defines the height of the analytical table. Show as many rows as fit on the screen.
    • The property: visibleRowCountMode defines whether the height of the analytical table is fixed or automatically calculated based on the space provided by the underlying container. For automatic calculation, make sure that all rows have the same height.
    • The property: minimumAutoRowCount defines the minimum number of rows that must be shown if the property: visibleRowCountMode is set to “auto”. Show at least three to five rows.
    • The property: firstVisibleRow defines the first row shown in the visible area of the analytical table. The analytical table is scrolled accordingly.
    • The property: allowColumnReordering is deprecated. Use the property: enableColumnReordering instead.
    • The property: editable does not have a visible effect. Please do not use it.
    • The property: threshold is used for optimizing lazy loading of items. In most cases, the default value is appropriate.
    • The property: enableGrouping is experimental and does not have a meaningful effect on the analytical table. Do not use it.
    • The property: sumOnTop shows additional aggregation values on the group header, even if the group is expanded. Do not use it.
    • The property: enableCustomFilter changes the filter entry in the column header menu from an edit box to Filter…. Selecting this entry throws an event that apps can react to, for example, by opening a dialog. In general, you should choose the built-in filter over your own implementation. Specifically, keep filtering via the column header menu simple, while offering more advanced options via the table personalization dialog.
    • The property: enableBusyIndicator has not yet been fully implemented. Do not use it.
    • The property: title adds a line of text on top of the analytical table. Do not use it. To add a title to the table, use a toolbar.
    • The property: footer adds a short text at the bottom of the table.
    • The property: Busy sets the analytical table to busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: Tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.ui.table.AnalyticalColumn

    The following additional properties are available for the analytical column:

    • The property: leadingProperty is used for data binding.
    • The property: inResult is used for data binding.
    • The property: visible defines whether a column is shown or hidden.
    • The property: name defines the name shown in the column header menu for showing and hiding columns. In SAP Fiori, columns are shown and hidden via the table personalization dialog or via the table personalization dialog. Please do not use this property.
    • The property: headerSpan defines whether one column header is used for one or several columns. To prevent adverse side effects, always use one column header for only one single column. Please do not use this property.
    • The property: Tooltip does not have an effect. Please do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table – Compact mode
    Tree table – Compact mode

    Condensed Mode

    Tree table – Condensed mode
    Tree table – Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering).

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Fewer columns than space available
    Fewer columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Collapse
    Tree table – Collapse
    Tree table – Expand
    Tree table – Expand

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scroll bar
    Tree table – Vertical scroll bar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Multi-selection plug-in with a limit
    Multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table – Freeze
    Tree table – Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid truncating the initial visible content in the default delivery
    Avoid truncating the initial visible content in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an item
    Drop target on an item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter infobar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter infobar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. Only use this mode if row clicks are being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header. Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).
    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item.

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable. If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event. Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    If the click area for the row is being used for another purpose (such as navigation), it cannot be used for selecting the row. In this case, use the “single select left” selection mode, which offers a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in default delivery.

    In all other single selection cases, use the selection mode “single select master”.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.m.Column, property: width).

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Don't truncate column headers
    Don't truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Horizontal Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-Align

    Left-align: Text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-align text
    Left-align text

    Left-align: Status information

    Left-align status information
    Left-align status information

    Right-Align

    Right-align: Dates and times (to ensure comparability for most formats and locales)

    Right-align dates
    Right-align dates

    Right-align: Numbers and amounts, except IDs, to ensure figures are comparable

    Right-align numbers
    Right-align numbers

    Center-Align

    Center-align: Icons, images, and avatars

    Keep the column name for center-aligned columns as short as possible to avoid excessive white space between columns. Alternatively, you can leave the column header empty on the visual UI, and use the invisible text control to provide information on the column content for screen reader listeners.

    Responsive table with an avatar and an action
    Responsive table with an avatar and an action

    Center-align: All actions in a line item that appear as buttons

    If you have more than one action, display them next to each other. Order the buttons based on importance. The most important action is on the left, the least important on the right. If there is not enough space to display them all in one line, move the actions from the right onto the next line one by one. We recommend a maximum of two buttons per line item.

    Responsive table with icon, avatar, and actions
    Responsive table with icon, avatar, and actions

    Vertical Content Alignment

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multi-line cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    • Don’t bundle inline actions that don’t belong together under an unspecific label, such as Misc, Actions, , or similar.
    Do
    Inline actions
    Inline actions
    Don't
    Don't combine unrelated inline actions
    Don't combine unrelated inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection
    Place actions near to the objects to which they belong
    Place actions near to the objects to which they belong

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut CTRL+ENTER to trigger the Add and Create buttons.

    There are three options for adding an item. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    A new item can have three different states:

    1. New: The item was just created and is in edit mode. It is highlighted with a visual indicator.
    2. Recent: The item was saved, but is still highlighted and displayed as the first item of the table. Current filter, sort and group criteria are ignored to keep the item visible.
    3. As soon as the responsive table is sorted, filtered, or grouped again, the action is also applied to the new item. It then also loses the visual highlight.

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery. From this column, use the primary data point.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the infobar below the table title. Clicking the infobar opens the view settings dialog on the filter page.

    Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the infobar is shown, provide an option to reset all corresponding filters on the infobar.

    Keep the infobar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (CTRL + V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in the master list for a master-detail scenario using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the master list for a master-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    Enable the shortcut Ctrl+Enter to trigger the Add and Create buttons.

    For more information, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid List

    As with the list and the responsive table, the grid list displays a set of items. In contrast to both controls, the grid list displays the items not in rows, but in a grid.

    The grid list is usually used as an alternative view for a list or table. It is ideal for displaying images, charts, object cards, and other content, which profit from more height (but less width).

    Grid List
    Grid List

    Usage

    Use the grid list if:

    • Your content is “visual” and profits from the rectangular format of the items. This is true for e.g. images, charts, and object cards.
    • The focus is on items, not on cells. The grid list shows complete items.
    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple data sets.
    • As an alternative view for tables or lists, if the content profits from the different format.

    Do not use the grid list if:

    • Your content is not appropriate for a card-like format. For example, do not use the grid list for displaying a wall of text. Use a table instead.
    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Data needs to be structured in a hierarchical manner. In this case, a tree might be more appropriate.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as the CSSGrid.
    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid. The underlying grid is defined by rows and columns. Columns can have a minimum and maximum or a fixed size. Whenever an additional column fits on the screen, it will be added. If a column does not fit on the screen anymore, it will be removed. Items are re-layouted accordingly.

    Optionally, there can be different configurations for the underlying grid based on breakpoints, for example based on the device types.

    To define the grid layout and behavior, you can use one of the pre-defined layouts:

    • Grid box layout: Adds a variable number of columns depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height, and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size L, and 16 for size XL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ pending on the screen width (“breathing”) or be fixed. The height can differ pending on the content of the item or be fixed. “Breathing” items make better use of the available screen space and is therefore recommended. Make sure, that the item adapts to the resulting width / height, for example by

    • Re-layouting the item content
    • Hiding less important information
    • Re-sizing content, such as images or charts.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Components

    • The title bar holds the title and, an item counter. Instead of a title bar you can use a toolbar, including title, counter, variant management and actions.
    • Optionally, a filter infobar should appear when the grid list is filtered and shows information on the filter settings.
    • The collection of grid list items, layouted on a grid, occupies the main part of the grid list.
    • A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button. Use More only, if content is shown below the grid list.
    • The footer can contain additional static text information.
    Schematic visualization of the grid list
    Schematic visualization of the grid list

    Title Bar

    The title bar contains the title of the grid list and an item counter

    Title Bar
    Title Bar

    Instead of the title bar, a toolbar can be used instead. If done so, use a title control to display the title and item count. Variant management and actions can be added in this case. The toolbar can contain entry points for the view settings dialog, as well as view switches in the form of a segmented button, and buttons for actions like for example Add, or Edit.

    Toolbar instead of title bar
    Toolbar instead of title bar

    For the title, keep the following in mind:

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    • Do not show the title bar at all, if all elements (title, item count, variant management, toolbar) are available in the surrounding area.
      Example: An object page (sub-)section contains only one grid list. In this case, add the item count and the toolbar to the (sub-)section header.
    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table. If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    For displaying the item count, use the following format:

    [title text] ([count])

    for example:

    Items (2,534)

    For the item count, keep the following in mind:

    • include all the items that a user can reach by scrolling except group headers.
    • Remove the item count if there are zero items.
    • Do not show a count on the title bar, if a More button is used. Show the count on the more button instead.

    If possible, keep the title bar sticky (sap.m.GridList, property: sticky).

    Filter Infobar

    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the grid list is filtered.

    Filter infobar
    Filter infobar

    Items

    The items (sap.f.GridListItem) are placed on a grid. To specify the design of items, it is recommend (but not mandatory) to follow the guidelines for object cards. Be aware that the item itself is responsible for its own responsiveness.

    Use the grid list only, if your content profits from the format. This can apply to images, charts, but also to object cards or quick views. Another option is to mimick the format (but not the visual) of existing objects (e.g. business cards).

    A grid list item can contain any content. This includes single controls, or a combination of controls (e.g. by using layout containers).

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Although the grid list can technically work with other list items (e.g. the standard list item), do not use them. They are not responsive enough for being used in a grid. In addition, selectors, navigation indicators and other elements are layouted differently (optimized for the list, not for the grid list).
    • Take care that an item can be identified, e.g. by adding a title, and if needed a sub title.
    • To show a string with an ID as identifier, use the title for the string, and the subtitle for the ID.
    • For status information, use semantic colors on foreground elements.
    • Avoid truncation. Use controls that wrap the text and configure them accordingly.
    • If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls, as soon as you switch to edit mode, but not before.
      You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    Not all items have to follow the same structure. This could be the case if one item is locked, but another item is in edit mode. Another example is to show a set of objects of different types in the same grid list.

    Example for a grid list item
    Example for a grid list item
    Another example for a grid list item
    Another example for a grid list item

    Highlight

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry- / process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users what exactly is wrong. Make sure that you provide this information within the item, ideally in the same color.

    For details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item

    States

    To show that an item is unread, use the corresponding flag (sap.m.GridList, property: showUnread, sap.f.GridListItem, property: unread). This shows most of the content in bold font.

    Unread item next to a read item
    Unread item next to a read item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) near the item identifier.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) near the item identifier. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error). In addition, highlight the item accordingly (sap.f.GridListItem, property: highlight).

    An item with an error
    An item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft near the item identifier. The user can click the button to open a popover showing the timestamp of the last change.

    An item with draft state
    An item with draft state

    Show only one state at any one time.

    “More” Button

    The More button loads more items to the front end if not all items have yet been loaded.

    "More" button

    Footer

    The footer can be used to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    Scroll

    The height of the grid list is defined by the number of items it contains. It does not have a scroll container on its own but is scrolled together with the page. When the user scrolls the page, the title bar and filter infobar can stick to the top of the surrounding layout container (sap.m.GridList, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.
    • If focus is set to a fixed column header, the grid list is automatically scrolled to top.

    Sticky toolbar
    Sticky toolbar

    Showing more items

    If the grid list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. This request can either be triggered by scrolling (preferred), or by clicking the More button. Use the latter one only if content follows below the grid list. Use the “growing mode”, if more than 200 items are expected to be displayed.

    If using the “More” button,

    • show the number of items already loaded and (if possible) the total number items below the text More.
    • do not show an item count on the title bar. Use the count on the More button instead.

    In any case, if the “growing mode” is used, do not show more than 1,000 items overall.

    Select

    A grid list can have one of the following selection modes (sap.m.GridList/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Items can still use the sap.m.ListType “navigation”, which allows click handling on specific items. Only use this option if the click triggers navigation to a corresponding item details page.
    • Single selection master: One item in the grid list can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from grid lists without selection (mode: None). Single select master is the preferred mode for single selection. (sap.m.ListMode.SingleSelectMaster).
    Selected item in
    Selected item in "single selection master"
    • Single selection left: One item in the grid list can be selected. For this, the grid list provides radio buttons on the left side of each item. Only use this mode if a click on the whole item is being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft). Even in this case, prefer single select master and synchronize the selection with the navigation, so that the navigated item is also the selected item.
    • Multi selection: Users can select one or more items. For this, the grid list provides checkboxes on the left side of each item. (sap.m.ListMode.MultiSelect). The Shift key can be used to select a range. Try to avoid combining multi selection with navigation.
    An unselected and a selected item in
    An unselected and a selected item in "multi selection"

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    Click an Item

    The whole item can be clickable. An event is fired by clicking the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a grid list in “single select master” mode.

    Drag and Drop

    One or several items can be repositioned within a grid list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    When using drag and drop, keep the following in mind:

    • Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.
    • If you offer drag and drop for rearranging items within the grid list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).
    • Be aware that due to the re-arrangement of the items which happens after an item is dropped, it is not always clear where the item will finally be placed.
    • When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item (sap.f.dnd.GridDropInfo, property: dropIndicatorSize).
    • Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.
    • When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on a specific data point, the dropped item needs to take on the value of the target group for the corresponding data point. If this is not wanted, do not allow users to rearrange items in grouped grid lists. Example:
      A grid list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Loading Data

    To indicate that the grid list is currently loading items, use the busy state. (sap.m.GridList, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Empty Grid Lists

    Try not to display an empty grid list. If there is no way around this, provide instructions on how to fill the grid list with data (sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a grid list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the grid list with data.
    • If a grid list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a grid list is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Context Menu

    You can attach a context menu to a grid list. The context menu gives users an alternative way to modify the whole grid list or an individual item by providing access to context-specific actions. A context menu is opened by right-clicking (mouse), long press (touch devices), or via keyboard using the context menu key or Shift+F10. If a control inside a grid list is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Be aware that using the context menu overrides the browsers context menu, which can no longer be opened.

    Group

    If grouped, a group header is displayed (sap.m.GroupHeaderListItem) above all items which belong to the corresponding group. The group header is not interactive.

    A grouped grid list
    A grouped grid list

    Guidelines

    Actions

    To trigger actions on multiple items, use a multi-selection grid list (sap.m.GridList, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the toolbar of the grid list. Keep the toolbar sticky (sap.m.GridList, property: sticky).

    In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only if the grid list is the only area on the screen to which actions can be applied and if the actions are finalizing.

    Do not offer actions for multiple items if the grid list is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.GridList, property: mode, value: sap.m.ListMode.SingleSelectMaster), the action can also be shown within the item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every item and thus use a lot of screen real estate, only do this for one or two actions at most. In this case, show the action trigger near the content to which it belongs. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    The following actions on single items must always be in-line:

    • Delete: Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the right side of an item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case.
      Delete is a mode of the grid list and therefore cannot be used together with single selection or multi-selection.
    Delete button
    Delete button
    • Navigation: Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the right side of an item and the entire item becomes clickable. Use this to navigate to a new page containing item details. In rare cases, you can also use this for the category navigation pattern without navigating to another page. By contrast, clicking an interactive control within an item does not trigger the navigation event. Instead, the corresponding control handles the click event.
      “Navigation” is an item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).
    Navigation Indicator
    Navigation Indicator
    • Edit: Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the right side of an item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.
      Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).
    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Add Items

    • Place the Add or Create text button on the toolbar of the grid list.
      • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
      • Use Add if the item already exists and is merely added or assigned to the current object.
    • Place new items always as the first item of the grid list.
    • Use highlight (information state) on the new item.
    • Enable the shortcut Ctrl+Enter to trigger the Add and Create buttons.

    There are three possibilities for adding an item, which should be considered in the following priority:

    • Add the item inline. Create an empty, editable item as the first item of the grid list. Show the Save button on the toolbar of the grid list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items where up to 8 input fields need to be filled. Save the new item at the dialog level.
    • Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the grid list.

    There are three different states of a new item:

    • New: The item was just created and is still in edit mode. It is highlighted with a visual indicator (information state).
    • Recent: The item was saved but is still highlighted and displayed as the first item of the grid list. Current filter, sort and group criteria are ignored since the item should remain visible.
    • As soon as the grid list is sorted, filtered, or grouped again, the new item is handled accordingly and loses the visual highlight, but not before.

    In the context of the draft handling new items are not saved on grid list level, but rather with the entire draft.

    Export to Spreadsheet

    Mass Editing

    • Provide multiselection (sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    Paste

    To paste data from the clipboard to the grid list, the browser functionality for paste can be used (Ctrl+V or browser context menu).

    If the focus is on item level, the app has to take the data from the clipboard and add it to the corresponding controls within the items.

    If the focus is on an editable control within an item, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the grid list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the grid list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the grid list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the grid list. Use the filter bar instead.
    • Always use only the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Persist the view settings. When a user reopens the app, show the grid list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort settings, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the toolbar of the grid list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.GridList, property: sticky).
    Guidelines
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).

    Group

    • To display the current group state, group headers are shown.
    • On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):
      [Label of the grouped data point]: [Grouping Value]
    • If there is no grouping value, show the following text:
      [Label of the grouped data point]: (Not Available)
      This is the case if you have a group of items that don’t have a value for the grouped data point.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection,

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action, if it can be applied to all selected items.
    • Enable the action, if it can be applied to a part of the selected items. If the action is triggered, show a message that informs the user about how many items will be affected. Provide the choice to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    To trigger actions that are independent of the selection, show the actions on the toolbar of the grid list. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, and group.

    To trigger a default action on the whole item, use the “Active” or “DetailAndActive” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Active).
    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event but are handled by the interactive control. Do not use Active for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Grid Lists in Object Pages

    A grid list with up to 20 expected items can be displayed right away, without lazy loading.

    If you expect the grid list to have more than 20 items, use one of the following 3 options:

    • Lazy loading (More button): Use this option if you expect to have up to 100 items.
    • Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the grid list on a dedicated tab.
    • Navigation to a list report: If you expect the grid list to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the grid list itself to a reasonable amount. To provide the user with a way to work with the entire grid list, offer navigation to a separate list report containing all items.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the grid list in the object page. Grouping should be avoided.

    For more information on the use of grid lists within the object page, see Object Page – Tables.

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • The property: inset adds a margin on all sides of the grid list.
    • The property: headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • variantManagement
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole grid list.
    • The property: includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used in combination with these two settings.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the grid list is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators does not have any effect. Do not use this property.
    • The property: swipeDirection does not have any effect. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are currently not visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the grid list to a busy state. While in busy state, the whole grid list cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the grid list has been set to this state. Use the default value.
    • The property: visible shows the grid list (“true”) or hides it (“false”).
    • The property: tooltip provides a tooltip for the whole grid list. Do not use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter shows a number on the right side of an item. This is used in cases like showing the number of subitems.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the master list for a master-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: only one item is selected.
    Single selection: only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, for example navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut Ctrl+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that Ctrl+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether Ctrl+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in 'delete' mode
    Tree in 'delete' mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with single select master.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or Shift+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - Context menu
    Tree - Context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Content Formatting

    To display object names with an ID, show the ID in brackets after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with 'Delete' button
    Items with 'Delete' button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    Enable the shortcut Ctrl+Enter to trigger the Add and Create buttons.

    For more details, see guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Information
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Don't use a responsive table as a form
    Don't use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a smartphone (size S)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed on a tablet (size M)
    Responsive table displayed in compact mode on a desktop computer (size L)
    Responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: Moving the data below the labels
    Pop-in area: Moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter info bar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter info bar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter info bar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter info bar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. Only use this mode if row clicks are being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header. Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).
    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item.

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'Delete' mode
    Responsive table in 'Delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable. If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event. Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    If the click area for the row is being used for another purpose (such as navigation), it cannot be used for selecting the row. In this case, use the “single select left” selection mode, which offers a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in default delivery.

    In all other single selection cases, use the selection mode “single select master”.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Don't
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Single selection left - Don't show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Multiple selection - Don't show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.m.Column, property: width).

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Don't truncate column headers
    Don't truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers and amounts, except IDs, to ensure comparability of such figures.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align: dates and times (to ensure comparability for most formats and locales).

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Vertical alignment:

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Don't use top alignment if it doesn't make sense
    Don't use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multiline cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Wrap text
    Wrap text
    Don't
    Don't truncate text
    Don't truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.
    Don't combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Offer the corresponding actions in the footer toolbar if the responsive table is the only area on the screen to which actions can be applied. This has the advantage that the actions on the footer toolbar are fixed on the screen and cannot be scrolled away.
    • In other cases, show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    Inline actions
    Inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection
    Place actions near to the objects to which they belong
    Place actions near to the objects to which they belong

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    There are three options for adding an item after the Add button is pressed. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    A new item can have three different states:

    1. New: The item was just created and is in edit mode. It is highlighted with a visual indicator.
    2. Recent: The item was saved, but is still highlighted and displayed as the first item of the table. Current filter, sort and group criteria are ignored to keep the item visible.
    3. As soon as the responsive table is sorted, filtered, or grouped again, the action is also applied to the new item. It then also loses the visual highlight.

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery. From this column, use the primary data point.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the info bar below the table title. Clicking the info bar opens the view settings dialog on the filter page.

    Show the info bar only if the filter settings are not shown somewhere else. For example, do not show the info bar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the info bar is shown, provide an option to reset all corresponding filters on the info bar.

    Keep the info bar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the info bar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (CTRL + V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the master list for a master-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: only one item is selected.
    Single selection: only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, such as for navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, such as for navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut CTRL+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that CTRL+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether CTRL+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete  button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in “delete” mode
    Tree in “delete” mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with single select master.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - context menu
    Tree - context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Content Formatting

    To display object names with an ID, show the ID in brackets after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.

    Items with Delete button
    Items with Delete button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    For more details, see guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.
    [/vc_row_inner]

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Grid List

    As with the list and the responsive table, the grid list displays a set of items. In contrast to both controls, the grid list displays the items not in rows, but in a grid.

    The grid list is usually used as an alternative view for a list or table. It is ideal for displaying images, charts, object cards, and other content, which profit from more height (but less width).

    Grid List
    Grid List

    Usage

    Use the grid list if:

    • Your content is “visual” and profits from the rectangular format of the items. This is true for e.g. images, charts, and object cards.
    • The focus is on items, not on cells. The grid list shows complete items.
    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple data sets.
    • As an alternative view for tables or lists, if the content profits from the different format.

    Do not use the grid list if:

    • Your content is not appropriate for a card-like format. For example, do not use the grid list for displaying a wall of text. Use a table instead.
    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Data needs to be structured in a hierarchical manner. In this case, a tree might be more appropriate.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as the CSSGrid.
    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.

    Responsiveness

    The responsiveness of the grid list results from the underlying grid. The underlying grid is defined by rows and columns. Columns can have a minimum and maximum or a fixed size. Whenever an additional column fits on the screen, it will be added. If a column does not fit on the screen anymore, it will be removed. Items are re-layouted accordingly.

    Optionally, there can be different configurations for the underlying grid based on breakpoints, for example based on the device types.

    To define the grid layout and behavior, you can use one of the pre-defined layouts:

    • Grid box layout: Adds a variable number of columns depending on the available screen width. Columns have either a fixed width or can “breathe” slightly. All rows have the same height, and all items are the same size.
    • Responsive column layout: The number of columns depends on breakpoints (4 columns for size S, 8 for size M, 12 for size L, and 16 for size XL). The width of the columns grows or shrinks with the available screen space until the next breakpoint is reached. The row height of the grid is determined by the height of the highest item in the row. The number of rows and columns taken up by an item can differ.

    Alternatively, you can define your own grid. This gives you much greater flexibility to influence both the layout and the (responsive) behavior of the grid.

    The underlying grid defines the available space per item. The width can differ pending on the screen width (“breathing”) or be fixed. The height can differ pending on the content of the item or be fixed. “Breathing” items make better use of the available screen space and is therefore recommended. Make sure, that the item adapts to the resulting width / height, for example by

    • Re-layouting the item content
    • Hiding less important information
    • Re-sizing content, such as images or charts.

    Items can use one ore more grid cells. Items can also be different sizes (for example, to allow for varying text lengths/wrapping in different items).

    Size S
    Size S
    Size M
    Size M
    Size L
    Size L

    Components

    • The title bar holds the title and, an item counter. Instead of a title bar you can use a toolbar, including title, counter, variant management and actions.
    • Optionally, a filter infobar should appear when the grid list is filtered and shows information on the filter settings.
    • The collection of grid list items, layouted on a grid, occupies the main part of the grid list.
    • A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button. Use More only, if content is shown below the grid list.
    • The footer can contain additional static text information.
    Schematic visualization of the grid list
    Schematic visualization of the grid list

    Title Bar

    The title bar contains the title of the grid list and an item counter

    Title Bar
    Title Bar

    Instead of the title bar, a toolbar can be used instead. If done so, use a title control to display the title and item count. Variant management and actions can be added in this case. The toolbar can contain entry points for the view settings dialog, as well as view switches in the form of a segmented button, and buttons for actions like for example Add, or Edit.

    Toolbar instead of title bar
    Toolbar instead of title bar

    For the title, keep the following in mind:

    • Use a title if you need the item count, toolbar actions, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    • Do not show the title bar at all, if all elements (title, item count, variant management, toolbar) are available in the surrounding area.
      Example: An object page (sub-)section contains only one grid list. In this case, add the item count and the toolbar to the (sub-)section header.
    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table. If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    For displaying the item count, use the following format:

    [title text] ([count])

    for example:

    Items (2,534)

    For the item count, keep the following in mind:

    • include all the items that a user can reach by scrolling except group headers.
    • Remove the item count if there are zero items.
    • Do not show a count on the title bar, if a More button is used. Show the count on the more button instead.

    If possible, keep the title bar sticky (sap.m.GridList, property: sticky).

    Filter Infobar

    Beneath the toolbar, display a filter infobar (which itself is a special toolbar) if the grid list is filtered.

    Filter infobar
    Filter infobar

    Items

    The items (sap.f.GridListItem) are placed on a grid. To specify the design of items, it is recommend (but not mandatory) to follow the guidelines for object cards. Be aware that the item itself is responsible for its own responsiveness.

    Use the grid list only, if your content profits from the format. This can apply to images, charts, but also to object cards or quick views. Another option is to mimick the format (but not the visual) of existing objects (e.g. business cards).

    A grid list item can contain any content. This includes single controls, or a combination of controls (e.g. by using layout containers).

    When designing an item,

    • Use the grid list item as starting point and make sure that the content adapts responsively to a changing item width / height.
    • Although the grid list can technically work with other list items (e.g. the standard list item), do not use them. They are not responsive enough for being used in a grid. In addition, selectors, navigation indicators and other elements are layouted differently (optimized for the list, not for the grid list).
    • Take care that an item can be identified, e.g. by adding a title, and if needed a sub title.
    • To show a string with an ID as identifier, use the title for the string, and the subtitle for the ID.
    • For status information, use semantic colors on foreground elements.
    • Avoid truncation. Use controls that wrap the text and configure them accordingly.
    • If an edit mode is needed, change your text controls (labels, text, and links) to input fields or other appropriate editable controls, as soon as you switch to edit mode, but not before.
      You can do this by changing the control or, in more complex cases, by exchanging the whole item.

    Not all items have to follow the same structure. This could be the case if one item is locked, but another item is in edit mode. Another example is to show a set of objects of different types in the same grid list.

    Example for a grid list item
    Example for a grid list item
    Another example for a grid list item
    Another example for a grid list item

    Highlight

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry- / process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users what exactly is wrong. Make sure that you provide this information within the item, ideally in the same color.

    For details on the usage of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted item
    Highlighted item

    States

    To show that an item is unread, use the corresponding flag (sap.m.GridList, property: showUnread, sap.f.GridListItem, property: unread). This shows most of the content in bold font.

    Unread item next to a read item
    Unread item next to a read item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) near the item identifier.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) near the item identifier. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error). In addition, highlight the item accordingly (sap.f.GridListItem, property: highlight).

    An item with an error
    An item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] near the item identifier. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft near the item identifier. The user can click the button to open a popover showing the timestamp of the last change.

    An item with draft state
    An item with draft state

    Show only one state at any one time.

    “More” Button

    The More button loads more items to the front end if not all items have yet been loaded.

    "More" button

    Footer

    The footer can be used to display additional static information relating to the content.

    Grid list footer
    Grid list footer

    Behavior and Interaction

    Scroll

    The height of the grid list is defined by the number of items it contains. It does not have a scroll container on its own but is scrolled together with the page. When the user scrolls the page, the title bar and filter infobar can stick to the top of the surrounding layout container (sap.m.GridList, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, filter infobar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the grid list is placed within the object page.
    • If focus is set to a fixed column header, the grid list is automatically scrolled to top.

    Sticky toolbar
    Sticky toolbar

    Showing more items

    If the grid list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. This request can either be triggered by scrolling (preferred), or by clicking the More button. Use the latter one only if content follows below the grid list. Use the “growing mode”, if more than 200 items are expected to be displayed.

    If using the “More” button,

    • show the number of items already loaded and (if possible) the total number items below the text More.
    • do not show an item count on the title bar. Use the count on the More button instead.

    In any case, if the “growing mode” is used, do not show more than 1,000 items overall.

    Select

    A grid list can have one of the following selection modes (sap.m.GridList/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Items can still use the sap.m.ListType “navigation”, which allows click handling on specific items. Only use this option if the click triggers navigation to a corresponding item details page.
    • Single selection master: One item in the grid list can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from grid lists without selection (mode: None). Single select master is the preferred mode for single selection. (sap.m.ListMode.SingleSelectMaster).
    Selected item in
    Selected item in "single selection master"
    • Single selection left: One item in the grid list can be selected. For this, the grid list provides radio buttons on the left side of each item. Only use this mode if a click on the whole item is being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft). Even in this case, prefer single select master and synchronize the selection with the navigation, so that the navigated item is also the selected item.
    • Multi selection: Users can select one or more items. For this, the grid list provides checkboxes on the left side of each item. (sap.m.ListMode.MultiSelect). The Shift key can be used to select a range. Try to avoid combining multi selection with navigation.
    An unselected and a selected item in
    An unselected and a selected item in "multi selection"

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    Click an Item

    The whole item can be clickable. An event is fired by clicking the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.f.GridListItem, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a grid list in “single select master” mode.

    Drag and Drop

    One or several items can be repositioned within a grid list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    When using drag and drop, keep the following in mind:

    • Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.
    • If you offer drag and drop for rearranging items within the grid list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).
    • Be aware that due to the re-arrangement of the items which happens after an item is dropped, it is not always clear where the item will finally be placed.
    • When dropping items from outside the grid list, adapt the size of the drop indicator to match the target layout of the item (sap.f.dnd.GridDropInfo, property: dropIndicatorSize).
    • Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.
    • When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on a specific data point, the dropped item needs to take on the value of the target group for the corresponding data point. If this is not wanted, do not allow users to rearrange items in grouped grid lists. Example:
      A grid list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Loading Data

    To indicate that the grid list is currently loading items, use the busy state. (sap.m.GridList, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Empty Grid Lists

    Try not to display an empty grid list. If there is no way around this, provide instructions on how to fill the grid list with data (sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a grid list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the grid list with data.
    • If a grid list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a grid list is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Context Menu

    You can attach a context menu to a grid list. The context menu gives users an alternative way to modify the whole grid list or an individual item by providing access to context-specific actions. A context menu is opened by right-clicking (mouse), long press (touch devices), or via keyboard using the context menu key or SHIFT+F10. If a control inside a grid list is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Be aware that using the context menu overrides the browsers context menu, which can no longer be opened.

    Group

    If grouped, a group header is displayed (sap.m.GroupHeaderListItem) above all items which belong to the corresponding group. The group header is not interactive.

    A grouped grid list
    A grouped grid list

    Guidelines

    Actions

    To trigger actions on multiple items, use a multi-selection grid list (sap.m.GridList, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the toolbar of the grid list. Keep the toolbar sticky (sap.m.GridList, property: sticky).

    In rare cases, you can also offer the corresponding actions in the footer toolbar. Do this only if the grid list is the only area on the screen to which actions can be applied and if the actions are finalizing.

    Do not offer actions for multiple items if the grid list is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.GridList, property: mode, value: sap.m.ListMode.SingleSelectMaster), the action can also be shown within the item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every item and thus use a lot of screen real estate, only do this for one or two actions at most. In this case, show the action trigger near the content to which it belongs. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    The following actions on single items must always be in-line:

    • Delete: Use the “Delete” mode of the grid list (sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the right side of an item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case.
      Delete is a mode of the grid list and therefore cannot be used together with single selection or multi-selection.
    Delete button
    Delete button
    • Navigation: Use the “Navigation” item type (sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the right side of an item and the entire item becomes clickable. Use this to navigate to a new page containing item details. In rare cases, you can also use this for the category navigation pattern without navigating to another page. By contrast, clicking an interactive control within an item does not trigger the navigation event. Instead, the corresponding control handles the click event.
      “Navigation” is an item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).
    Navigation Indicator
    Navigation Indicator
    • Edit: Use the “Detail” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the right side of an item. Clicking the button triggers the edit event. Use this event to switch the corresponding item to edit mode.
      Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).
    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Add Items

    • Place the Add or Create text button on the toolbar of the grid list.
      • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
      • Use Add if the item already exists and is merely added or assigned to the current object.
    • Place new items always as the first item of the grid list.
    • Use highlight (information state) on the new item.

    After pressing the Add button, there are three possibilities for adding an item, which should be considered in the following priority:

    • Add the item inline. Create an empty, editable item as the first item of the grid list. Show the Save button on the toolbar of the grid list. This option is recommended for simple scenarios where just a few input fields have to be filled.
    • Open a dialog for items where up to 8 input fields need to be filled. Save the new item at the dialog level.
    • Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, creating complex objects). When the user presses Save in the footer toolbar of the create page, navigate back to the grid list.

    There are three different states of a new item:

    • New: The item was just created and is still in edit mode. It is highlighted with a visual indicator (information state).
    • Recent: The item was saved but is still highlighted and displayed as the first item of the grid list. Current filter, sort and group criteria are ignored since the item should remain visible.
    • As soon as the grid list is sorted, filtered, or grouped again, the new item is handled accordingly and loses the visual highlight, but not before.

    In the context of the draft handling new items are not saved on grid list level, but rather with the entire draft.

    Export to Spreadsheet

    Mass Editing

    • Provide multiselection (sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    Paste

    To paste data from the clipboard to the grid list, the browser functionality for paste can be used (CTRL + V or browser context menu).

    If the focus is on item level, the app has to take the data from the clipboard and add it to the corresponding controls within the items.

    If the focus is on an editable control within an item, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    View Settings

    • Provide individual buttons for each of the following settings on the toolbar of the grid list: sort, filter, group.
    • Clicking one of these buttons opens the view settings dialog or P13nDialog dialog with just the relevant page inside.
    • When closed, apply the settings to the grid list accordingly.

    Keep the following in mind:

    • Do not offer any of these features if the grid list is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering on the toolbar of the grid list. Use the filter bar instead.
    • Always use only the view settings which are really needed. For example, do not offer grouping if it does not support your use case well.
    • Persist the view settings. When a user reopens the app, show the grid list with the same sort, filter, and group settings as last defined by this user.

    Sort

    • For the default sort settings, sort by the item title, which is usually the identifier of an item.
    • If you offer sorting, offer it for each data point available in the item. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.
    • For each data point, provide a meaningful sort order. For example:
      • Sort text alphabetically
      • Sort numbers by their value
      • Sort status information by the severity of the status:
        • Ascending: Sort status information from positive to negative, with neutral last.
        • Descending: Sort status information from negative to positive, with neutral first.
        • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
        • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Filter

    • To display the current filter state, use the infobar below the title. Clicking the infobar opens the filter page of the corresponding dialog.
    • Show the infobar only if the filter settings are not shown somewhere else. For example, do not show the infobar for settings taken in the filter bar or in a select placed in the toolbar of the grid list.
    • If the infobar is shown, provide an option to reset all corresponding filters on the infobar.
    • Keep the infobar sticky (sap.m.GridList, property: sticky).
    Developer Hint
    To display the current filter settings on the infobar, consider using the list formatter (sap.ui.core.format.ListFormat).

    Group

    • To display the current group state, group headers are shown.
    • On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):
      [Label of the grouped data point]: [Grouping Value]
    • If there is no grouping value, show the following text:
      [Label of the grouped data point]: (Not Available)
      This is the case if you have a group of items that don’t have a value for the grouped data point.

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection,

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action, if it can be applied to all selected items.
    • Enable the action, if it can be applied to a part of the selected items. If the action is triggered, show a message that informs the user about how many items will be affected. Provide the choice to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    To trigger actions that are independent of the selection, show the actions on the toolbar of the grid list. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, and group.

    To trigger a default action on the whole item, use the “Active” or “DetailAndActive” list item type (sap.f.GridListItem, property: type, value: sap.m.ListType.Active).
    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event but are handled by the interactive control. Do not use Active for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Grid Lists in Object Pages

    A grid list with up to 20 expected items can be displayed right away, without lazy loading.

    If you expect the grid list to have more than 20 items, use one of the following 3 options:

    • Lazy loading (More button): Use this option if you expect to have up to 100 items.
    • Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the grid list on a dedicated tab.
    • Navigation to a list report: If you expect the grid list to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the grid list itself to a reasonable amount. To provide the user with a way to work with the entire grid list, offer navigation to a separate list report containing all items.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the grid list in the object page. Grouping should be avoided.

    For more information on the use of grid lists within the object page, see Object Page – Tables.

    Properties

    sap.f.GridList

    The following additional properties are available for the grid list:

    • The property: inset adds a margin on all sides of the grid list.
    • The property: headerText is a simple way to set the title for the grid list. However, this excludes the following:
      • A separate toolbar
      • variantManagement
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole grid list.
    • The property: includeItemInSelection uses a click on the whole item to select the corresponding item if the grid list is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used in combination with these two settings.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the grid list is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators does not have any effect. Do not use this property.
    • The property: swipeDirection does not have any effect. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are currently not visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the grid list to a busy state. While in busy state, the whole grid list cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the grid list has been set to this state. Use the default value.
    • The property: visible shows the grid list (“true”) or hides it (“false”).
    • The property: tooltip provides a tooltip for the whole grid list. Do not use it.

    sap.f.GridListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter shows a number on the right side of an item. This is used in cases like showing the number of subitems.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole item. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in the master list for a master-detail scenario using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the master list for a master-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut CTRL+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether CTRL+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more information, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    P13n Dialog

    Intro

    The p13n dialog control provides a dialog for tables that allows the user to personalize one or more of the following attributes:

    • Columns (visibility and order of columns)
    • Sort (sorting of table values)
    • Filter (filtering of table values)
    • Group (grouping for specific attributes)

    These tabs can be shown in any combination, as the use case requires.

    The P13n dialog is intended for complex tables with a large number of columns and the need for complex queries for sorting, grouping, and filtering.
    For simple tables, see view settings dialog and table personalization dialog.

    The P13n dialog can be triggered in the table toolbar using the corresponding buttons in the top right-hand corner of the table.

    The dialog is shown centered, either as a dialog (on desktop and tablet devices) or as a full-screen dialog (on mobile devices).

    Dialog buttons within the table toolbar
    Dialog buttons within the table toolbar

    Usage

    Use the P13n dialog if:

    • The user is able to personalize more than 20 or so columns.
    • You need several functions for sorting, grouping, and so on.
    • You are using the analytical table.
    • Complex queries have to be built for the relevant table.

    Do not use the P13n dialog if:

    • The user is able to personalize fewer than about 20 columns.
    • You only need a simple column show/hide feature.

    Responsiveness

    The P13n dialog is available for all display sizes. For sizes L/XL (desktop) and M (tablet), the dialog is shown as a dialog. For size S (smartphones), the P13n dialog is displayed as a full-screen dialog.

    Size S – Columns
    Size S – Columns
    Size M
    Size M
    Size L
    Size L

    Components

    The P13n dialog consists of four different tabs that can be used separately or combined, as required by the use case:

    • Sort
    • Filter
    • Group
    • Columns

    App developers can add more tabs manually.

    Behavior and Interaction

    Columns

    The first tab is the Columns tab. It allows the user to change the table columns that are shown and the order in which they are displayed.

    The list contains all of the table’s possible columns in the form of list items with checkboxes. The checkboxes of the currently displayed columns are selected.

    Another button next to the search field in the table toolbar allows the user to toggle between showing all columns and only those that are currently selected in the list.

    Show/Hide

    To show or hide a column, select or deselect the appropriate checkbox.

    Reorder

    To change the order of the columns, simply mark one list item and use the buttons on the right-hand side of the table toolbar to move them up or down. The order of the columns from top to bottom corresponds to the order on the table from left to right.

    Search

    If the table has numerous columns, the user can use the search field in the table toolbar to find a specific column more quickly. As soon as the user enters the first letter, the resulting columns are displayed instantly.

    Column settings in the P13n dialog
    Column settings in the P13n dialog

    Sort

    The second tab is the Sort tab, which allows the user to sort the table content according to the chosen attributes, and also in either ascending or descending order.

    The sort criterion consists of two input fields. In the first field, the user can choose a column by which the table is to be sorted. In the second field, the user chooses the sort order (ascending or descending).

    For more complex sorting needs, the user can add the required number of criteria by clicking the plus “ ” sign at the end of the line.

    The order of the criteria is exactly the same as the order in which sorting is applied to the table.

    Sort settings in the P13n dialog
    Sort settings in the P13n dialog
    Information
    Using the sort feature on column headers replaces ALL sort options in the dialog!

    Filter

    The third tab is the Filter tab, which allows the user to filter the table information according to specific criteria.

    The filter criteria can be included or excluded in the relevant section of the filter.

    Column

    In the first input field, the user selects the column to be filtered. Any of the columns can be selected; even those that are not currently visible.

    Option

    The second field offers an operator for specifying the filter in more detail. The operators that are available depends on the data type of the selected column.

    Filter tab in the P13n dialog
    Filter tab in the P13n dialog

    String (Text)

    • between
    • contains
    • equal to
    • begins with
    • ends with
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Number

    • between
    • equal to
    • greater than
    • greater than or equal to
    • less than
    • less than or equal to

    Date

    • between
    • equal to
    • after
    • on or after
    • before
    • before or on

    Boolean (true / false)

    • equal to

    The only available operator for excluding values from the filter results is equal to.

    Value

    The last field contains the value by which the selected column is filtered. The kind of input field that is provided depends on the data type of the selected column.

    Two or even more fields can be provided as required by the use case.

    For more complex cases, the user can add filters by clicking the plus “ ” button or remove them by clicking the Remove button at the end of each filter item.

    Information
    If there is a filter bar, use its filter functionality and deactivate the filter feature of the P13n dialog.

    Group

    The last tab is the Group tab, which enables the user to group the table data by one or more columns.

    In the first selection field, all columns are provided for selection. The user can select a checkbox on the right of the column selection field if the selected field is to be displayed as a column anyway.

    For more complex grouping scenarios, the user can add more grouping options by clicking the plus “ ” button on the right-hand side of each grouping line. This option only works with the analytical table.

    The grouped table shows the selected field as the group header, which can be expanded or collapsed.

    Under the group headers, all subgroup headers and all applicable table entries are displayed.

    Group tab in the P13n dialog
    Group tab in the P13n dialog
    Information
    To group by a specific column, that particular column must be marked as visible on the Columns tab!

    Guidelines

    For opening the dialog from a table toolbar, use different buttons for each function (sort, filter, group, column settings). With each button, open the P13n dialog with just the corresponding tab. Do not display the other tabs.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Smart Table

    Warning
    This guideline was written for release 1.52 and is no longer updated. For the latest design guidelines, see the corresponding table articles (Responsive TableGrid TableAnalytical TableTree Table).

    Background:
    As of guideline release 1.54, the SAP Fiori Design Guidelines contain only general guidelines for all implementations. These guidelines also apply for implementations using smart controls. You can still use the smart table, but the exact features will no longer be updated in the design guidelines.

    Intro

    The smart table is a wrapper around existing tables, and can be used together with the responsive table, grid table, analytical table, or tree table.

    The smart table creates columns automatically based on the underlying OData service plus corresponding annotations. It also adds some generic functionality, such as a toolbar, complex personalization settings, variant management, and export to spreadsheet.

    Everything that can be done using the smart table can also be achieved using the responsive table, grid table, analytical table, or tree table directly, but with more development effort. Therefore, the main purpose of the smart table is to reduce development effort. However, this comes at the expense of decreased flexibility.

    Usage

    Use the smart table if:

    • Data is fed into the table through OData services.
    • You need a simple table with limited flexibility to display its content. In this case, the smart table reduces development effort.
    • You need a table in which some columns provide flexible content. In this case, use the smart table together with a responsive table, and provide app-specific column definitions for these columns.

    Do not use the smart table if:

    • You create your own UI coding, whereby the data is not fed through OData services. In this case, use the underlying table control directly.
    • The main use case involves selecting one item from very few items, with no additional details. In this case, a select or combo box might be more suitable.
    • The main use case involves selecting one item from several items, with only a few details per item. In this case, a list might be more suitable. Pay attention to the layout of the list item to provide a pleasant appearance (see, for example, the master list and the feed list item).
    • The table is displayed together with a chart inside a chart container. The smart table is not designed to work inside an existing chart container. In this case, use the underlying table control directly.
    • You need an overview of a large amount of data. In this case, use charts.
    • You just need it for layout reasons. In this case, use a layout container, such as the grid layout, instead.
    • You need read-only or editable field value pairs. In this case, use a form instead. Tables are not optimized for form-like input navigation.

    Responsiveness

    The responsiveness of the smart table depends on the encapsulated table. The table toolbar uses the overflow mechanism for adapting to the screen width.

    Using the responsive table

    The smart table offers generic responsive behavior (sap.ui.comp.smarttable.SmartTable, property: demandPopin, value: true):

    • For every 10 rem of screen width, one column stays in the tabular layout. All others are moved to the pop-in area. The columns are moved to the pop-in area from right to left, so the column furthest to the right moves to the pop-in first.
    • Exception: The first two columns always stay in the tabular layout. This works best if the smart table uses the whole screen width. It might not work well if the smart table uses far less space.

    Using the grid table, analytical table, or tree table

    • The smart table works only on desktop and tablets, but not on smartphones. It supports touch devices, but is not optimized for small screens.
    • If you use a smart table in this configuration, ensure that you implement a fallback solution for small screens. This fallback solution does not need to support all use cases. You could create a fallback by using a responsive table. However, a completely different solution, such as showing charts in a read-only case, might be more suitable.
    Size S with responsive table
    Size S with responsive table
    Size M with responsive table
    Size M with responsive table
    Size L with responsive table
    Size L with responsive table
    Size M with grid table
    Size M with grid table
    Size L with grid table
    Size L with grid table

    Layout

    The title bar contains the title of the smart table, the item count, variant management, and the toolbar itself. All of these elements are optional.
    The table area shows the corresponding table (responsive table, grid table, analytical table, or tree table).

    Schematic visualization of the smart table
    Schematic visualization of the smart table

    Components

    The title bar consists of a toolbar.

    This can be the standard toolbar or a custom toolbar. The standard toolbar can contain a title text with or without item count, variant management, view switch (switching the table to edit mode), an entry point for the P13n dialog, and an Export to Spreadsheet action.

    If you require additional functionality, you can use an app-specific toolbar. All toolbar options provided by the smart table can also be added to the app-specific toolbar. (Aggregation: customToolbar)

    The table area consists of any of the following tables: responsive table, grid table, analytical table, or tree table.

    Standard toolbar with everything enabled
    Standard toolbar with everything enabled
    Standard toolbar just with title and item count
    Standard toolbar just with title and item count

    Behavior and Interaction

    The behavior is generally inherited from the underlying table, toolbar, variant management, and P13n dialog (see the corresponding articles for details.) Note that the smart table provides limited options and not all settings of the underlying controls are available.

    Table Level

    Table Type

    The smart table can encapsulate the responsive table, grid table, analytical table, or tree table. (sap.ui.comp.smarttable.SmartTable, property: tableType)

    Automatic Rendering of the Table

    The smart table automatically creates columns and renders all items based on the metadata of the underlying OData service (sap.ui.comp.smarttable.SmartTable, property: smartFilterId).

    To be more flexible in the table layout, the smart table also offers app-specific column templates for some or all columns. In this case, app developers must provide the definition for the underlying table and for the corresponding (but not necessarily for all) columns in the XML view. For this, the app development team must provide the column keys of the overridden columns via custom data.

    Additional columns can also be added. Columns that are defined in this way retain all the options of the underlying table. This is especially useful with the responsive table, which offers complete flexibility in content design. Any columns that are not defined by the app development team are still rendered automatically by the smart table.

    No Data

    If there is no data to show, the smart table renders default text. This text can be overwritten by the app development team (aggregation: NoData).

    Initially Visible Columns

    The smart table enables you to define which columns are initially shown. Here, initially means that these columns are shown when the app is first launched. All other columns are initially hidden (annotation: PresentationVariant/ LineItem, property: initiallyVisibleColumns).

    Persistency

    End users can show additional columns if table personalization is provided. In this case, column settings are persisted. On consecutive startups, the columns are shown with the same settings as last defined by the user (property: persistenceKey).

    Removing Columns

    The smart table always shows all columns from the OData model. In some cases, columns needs to be in the model but should not be available on the front end at all. Examples of this include:

    • A column is needed to provide an ID which is used for navigation purposes, but the front end should only display the corresponding text, not the ID.
    • The values of a column are needed to perform calculations, but only the results should be shown on the UI.

    In these cases, you can define which columns should not be available at all on the UI. These columns are not shown and are not available in the P13n dialog. You can also do this for columns that are added manually in the XML view (annotation: sap:visible, value:false).

    P13n/personalization dialog
    P13n/personalization dialog

    Filter Settings

    The “Show Field as Column” option for newly added filters is switched on by default.

    Sorting and Filtering

    The smart table allows you to add sort and filter settings for each column. These settings enable the corresponding pages in the P13n dialog. For the grid table, analytical table, and tree table, sorting and filtering are also enabled on the column header. (Annotations: sap:sortable and sap:filterable)

    Column header menu of the grid table
    Column header menu of the grid table

    Smart Table and Smart Filter Bar

    The smart table can be linked to a smart filter bar. If linked, filter bar settings are automatically used on the smart table. (sap.ui.comp.smarttable,SmartTable, property:smartFIlterId)

    Aggregation

    If used with the analytical table, the smart table allows total sums of measure columns to be calculated. The totals are shown in the usual way:

    • As the last row of the analytical table.
    • As the last row of each group if the group is expanded.
    • On the group header of each group if the group is collapsed.

    Aggregation settings are not persisted (annotation: sap:aggregation-role, value:measure).

    The total can be hidden via the column header menu.

    Aggregation entry in column header menu of the grid table
    Aggregation entry in column header menu of the grid table

    Aggregation of Different Currencies

    If used with the analytical table, the smart table also allows you to display totals for amount columns with different currencies.

    In this case, a Show Details link is displayed instead of the total. Clicking the link opens a popover showing the subtotals per currency.

    Exception: If a group contains only one currency, the total is shown directly.

    Totals for a column which contains amounts in different currencies
    Totals for a column which contains amounts in different currencies

    Column Width

    A default column width is calculated for each column based on the data displayed in it. Important: end users cannot change the column width in the responsive table (annotations: MaxLength, Precision, Scale).

    Column Header

    A column header text can be specified for each column (annotation: sap:label).

    Persistence

    The smart table allows you to persist sort, group, and filter column settings (such as by hidden columns) as well as variants (sap.ui.comp.smarttable.SmartTable, Property:persistenceyKey).

    Content

    The smart table provides two options to create columns automatically:

    1. The smart table is rendered in either read-only or edit mode. In this case, the smart table renders the controls as described below. This is the default way of rendering content (property: editable)
    2. If users need to switch between read-only and edit mode at runtime, the smart table allows smart fields to be rendered instead. You should use this if the edit button is added to the toolbar of the smart table (aggregation: customData key: useSmartField, property: smartToggle).

    For option 1, the following controls are used:

    • To show currency amounts, the smart table allows the amount and the currency code to be displayed in a single cell. For read-only mode, the currency control is used. For edit mode, a single input field is used, and the currency itself is shown next to the input field as non-editable text (annotation: sap:semantics, value: currency-code).
    • To show links that open a quick view, the smart table supports the smart link.
    • To show static text, the smart table uses an input field in edit mode, and a text in read-only mode.
    • To show dates, the smart table uses a date picker in edit mode, and a text in read-only mode (annotation: sap:display-format, value:Date).
    • To show decimal numbers, the smart table uses an input field in edit mode, and a text in read-only mode (Annotations:Precision, Scale).
    • The smart table also provides an object status and object identifier control. For more information, see object display components.
    • Pictures and microcharts, as well as rating indicators and progress bars are available.
    Amount formatting
    Amount formatting
    Link formatting
    Link formatting
    Date formatting
    Date formatting

    Value Help

    The smart table supports value help in the following ways (annotation: ValueList):

    • Input fields can show a value help button. Triggering this button opens a value help dialog. Within this dialog, you can provide a search field (annotation:ValueList, property: SearchSupported).
    • You can restrict the number of characters for the input field. Use this if no ValueList annotation is provided (annotation:MaxLength).

    Toolbar Level

    Table Title

    The smart table can provide a title for the table within the toolbar (sap.ui.comp.smarttable.SmartTable, Property:header).

    Table title
    Table title

    Item Count

    Next to the table title, an item count can be shown (sap.ui.comp.smarttable.SmartTable, Property:showRowCount).

    Table title with item count
    Table title with item count

    Edit

    The table toolbar can contain a button for toggling the table between read-only and edit modes. If smart fields are used, the smart table handles both modes automatically (sap.ui.comp.smarttable.SmartTable, properties:editTogglable, smartToggle, aggregation: customData, key: useSmartField).

    If used with the responsive table, the edit button also switches the keyboard behavior accordingly.

    Edit button
    Edit button

    View Settings

    The table toolbar can contain a button for opening the P13n dialog. This dialog provides extensive sort, group, and filter settings. It also allows columns to be shown, hidden, or rearranged (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).

    Settings button
    Settings button

    Export to Spreadsheet

    The table toolbar can contain a button for exporting the table data to a spreadsheet (sap.ui.comp.smarttable.SmartTable, Property:useExportToExcel). The spreadsheet file can be created using back-end functionality (if available) or in the front-end (sap.ui.comp.smarttable.ExportType):

    • With the back-end export, the following columns are exported: currently visible columns, “technical columns” that are in the data model but not visible to the user, and usually some (but not all) of the columns that are currently hidden. In the spreadsheet file, neither the columns nor the rows are in the same order as in the exporting app. The exported file might also show different column header texts.
      When the user triggers the export, the corresponding file is created in the background and offered for download automatically. The export process cannot be canceled. This option is only available if the back-end export is supported in the corresponding back-end system.
    • With the front-end export (default and recommended), only visible columns are exported. In the exported file, columns are in the same order and have the same header texts as in the exporting app. During the export, the system displays a progress dialog that blocks the UI. The export can be canceled at any time. As soon as the file has been created, it is offered for download automatically. The front-end export is always available.

    In both cases, the export works only with simple text-only cell content. Non-text elements, such as icons, images, micro charts, or controls like checkboxes and buttons are not supported. Formatters are not taken into account (for example, for numbers, amounts, dates, and times) .

    Warning
    With both methods, the file size is limited by the available browser memory. Exporting large tables can therefore lead to memory overflows and browser crashes.

    For the front-end export, the recommended maximum table size for using the built-in export functionality is 1 million table cells for desktop browsers or 100,000 table cells on tablets and phones. The limitation for the back-end export is even worse: even on a desktop device, the recommended maximum table size is only around 100,000 table cells.

    For larger tables, consider using custom-built, specialized export solutions instead.

    'Export to Spreadsheet' button
    'Export to Spreadsheet' button
    Exporting to Spreadsheet
    Exporting to Spreadsheet

    Full Screen Mode

    Applications can implement a maximize button to run the table in full screen (Property: showFullScreenButton).

    Maximize button
    Maximize button

    Footer Toolbar Level

    Use button styles only to help the user and not for decoration. For instance, emphasize the most important action. Use only one emphasized button, and never mix emphasized and semantic buttons.

    Guidelines

    In general, the guidelines for the underlying table, toolbar, variant management, and P13n dialog also apply to the smart table (see the corresponding articles for details). However, because the smart table does not offer the complete flexibility of the underlying controls, there are certain differences.

    Table Type

    The responsive table is the standard table for SAP Fiori. Use the responsive table whenever possible. It is the most flexible table in terms of how its content is displayed, it is fully responsive, and it can handle up to 1,000 line items.

    If you cannot use the responsive table, consider using the grid table instead. The grid table can handle a large number of line Items. Compared to the responsive table, however, it is more restricted content-wise (only certain controls can be used to show the data, and only one control per cell), and it does not run on smartphones. If you use the grid table, you need to provide a fallback solution for smartphones, for example, by using the responsive table.

    The analytical table is similar to the grid table, but adds several grouping levels and offers total sums on measure columns. The analytical table can also handle a large number of line Items. Compared to the responsive table, however, it is more restricted content-wise (only certain controls can be used to show the data, and only one control per cell), and it does not run on smartphones. If you use the analytical table, you need to provide a fallback solution for smartphones, for example, by using the responsive table.

    The tree table is the only table for displaying hierarchical data. Like the grid table, it can handle a large number of line items, although it is restricted content-wise (only certain controls can be used to show the data, and only one control per cell), and it does not run on smartphones. If you use the tree table, you need to provide a fallback solution for smartphones, for example, by using the responsive table.

    For more information about the different table controls, see the corresponding articles.

    Table Title, Item Count, and Variant Management

    Always show the item count together with the table title, unless this is expected to cause performance problems.
    If used with the responsive table and if more than 200 items are generally expected, do not show the item count. In this case, the smart table displays a More button to load additional rows. Using the item count together with the More button might lead to confusion (sap.ui.comp.smarttable.SmartTable, Property:showRowCount).

    Even if variant management is easy to implement, use it only if it is really needed. The variant management saves the whole page, including filter settings and table layouts.

    Empty Tables

    Try not to display an empty table. If there is no way around this, provide instructions on how to fill the table with data (aggregatrion: noData).

    The following default texts are provided automatically:

    • If the smart table is used standalone (without an attached smart filter bar) and it is initially empty (not yet bound), the default text is:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If the smart table is used with a smart filter bar attached, and it is initially empty (not yet bound), the default text is:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a smart table is bound but there is no data to display from the binding, the default text is:
      No items found. Check the search and filter settings.
      Overwrite this whenever this text is either not precise enough (for example, only search is offered) or misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Columns – Best Practices

    Keep the number of initially shown columns to a minimum. Avoid the need to scroll horizontally on a tablet screen size in default delivery (annotation: PresentationVariant/ LineItem).

    Keep the number of additional (initially hidden) columns to a minimum. You can use the P13n dialog to show/hide the columns. Select the columns offered in the P13n dialog carefully. Do not just show all columns available in the backend tables (annotation: sap:visible, value:false).

    For the grid table, analytical table, and tree table, the column widths are calculated automatically if the corresponding OData annotations are provided (annotations: MaxLength, Precision, Scale).

    In contrast, the responsive table uses the same width for all columns.

    If used with the responsive table, enable the pop-in behavior (sap.ui.comp.smarttable.SmartTable, property: smartFilterId, value: true).

    Show the most important column on the left and the least important on the right. This ensures that the most important columns stay in the tabular layout as long as possible. The most important columns are those that contain the following information:

    • The column that identifies the line item
    • The column that contains the key attribute

    (Annotation: PresentationVariant/ LineItem, Property: initiallyVisibleColumns)

    Email column in the pop-in area of the responsive table
    Email column in the pop-in area of the responsive table

    Provide a column header text for each column. Do not truncate the column header text in default delivery (annotation: sap:label).

    Column header text
    Column header text

    Content Alignment and Formatting

    The smart table automatically takes care of content alignment and formatting in standard use cases. For this, the OData metadata needs to provide the correct information about the data types, semantics of, and value help for the data.
    (Annotations such as: sap:semantics, value: currency-code, edm types, Annotation: sap:display-format, value:Date, Annotation:Precision, Annotation: Scale, Annotation: ValueList, Annotation: ValueList:semantics, value:fixed-values)

    Highlight Items

    If the smart table is used with the responsive table, you can show the status of an item by displaying a highlight indicator in front of the item (property: highlight). The highlight indicator can be used to show:

    • A semantic state, such as red or orange for an error or warning
    • A neutral highlight, such as blue to highlight newly added items
    Highlighted items
    Highlighted items

    Actions

    To trigger actions on multiple items, use a mutliselection smart table. Do not offer action triggering on multiple items if the table is expected to have fewer than 10 items in most cases.
    While the grid table, analytical table, and tree table are multiselectable by default within the smart table, the responsive table is single-selectable. The selection mode can be changed (XMLView).

    The following actions can be shown on the standard toolbar of the smart table:

    • Edit
      Toggles the table between edit and read-only mode. This only works if smart fields are used inside the smart table (sap.ui.comp.smarttable.SmartTable, properties:editTogglable, smartToggle, aggregation: customData, key: useSmartField).
    • View Settings
      This button opens the P13n dialog. Note that the P13n dialog is quite complex. Neither the simpler view settings dialog nor the table personalization dialog can be used without the app development team developing the entire view settings handling (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).
    • Export to Spreadsheet
      Only use this option if your end users typically export the data shown in the table in order to work with it in a spreadsheet application. This is usually the case if data is collected from several systems and analyzed in the spreadsheet application. This is not usually the case for worklists, attachment lists, lists with only a few items, shopping carts, or data that does not need to be analyzed. This option is only available if the corresponding back end supports exporting to spreadsheet (sap.ui.comp.smarttable.SmartTable, property: useExportToExcel).

    If additional actions are needed, use a custom toolbar for the table. The smart table can also add integrated functionality such as a table title, item count, variant management, edit and view settings, and export to spreadsheet to the custom toolbar (aggregation: customToolbar).

    For navigation to line item details:

    • If used with the responsive table, use the navigation mode of the responsive table.
    • If used with the grid table, analytical table, or tree table, use a link for the attribute that identifies the row. The user can click this link to trigger the navigation.

    Clicking a table row can trigger drill-in navigation to a deeper level of the object, as well as cross-navigation to another SAP Fiori app or even to another system.

    Inline Actions

    Actions that belong to single items can be placed within the row. They can be displayed as text or icons. Make sure the icon communicates the function clearly enough. Otherwise, use a textual button.

    Editable Content

    The smart table can be editable or read-only (sap.ui.comp.smarttable.SmartTable, property: editable).

    The smart table selects the corresponding editable controls automatically based on the data type, semantic annotations, and value list annotations (annotations such as: sap:semantics, value: currency-code, edm types, Annotation: sap:display-format, value:Date, Annotation:Precision, Annotation: Scale, Annotation: ValueList, Annotation: ValueList:semantics, value:fixed-values).

    If an edit mode is needed, the controls are automatically switched from read-only controls (such as text) to editable controls (such as input field or date picker) if smart fields are used inside the smart table (sap.ui.comp.smarttable.SmartTable, Property:editTogglable, smartToggle, aggregation: customData, key: useSmartField). The keyboard behavior is switched accordingly, if this is used together with the responsive table.

    Only use this if you need to toggle between both modes. In any other case, show only the mode you need (read-only or edit), but do not offer the switch.

    View Settings: Sort, Filter, Group, and Column Settings

    If view settings are enabled on the smart table, a settings button is available on the table toolbar. This button opens the P13n dialog. Neither the simpler view settings dialog nor table personalization dialog can be used without extra effort (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).

    The P13n dialog always enables the user to show, hide, and rearrange columns. Alternatively, it can contain settings for sorting, grouping, and/or filtering (annotations: sap:sortable, sap:filterable)

    If the smart table uses the grid table, analytical table, or tree table, sort, filter, and group settings are also available in the column header menu.

    Offer view settings only if they are really needed. For example, these settings do not make sense if the table contains only a few items and just a few columns.

    Note that the P13n dialog is quite complex. It is ideal for tables with a vast number of items, but is quite cumbersome for handling just a few hundred items. Therefore, show only the settings (sort, group, filter) you really need. For example, do not offer grouping if it does not support your use case well.

    If filtering is a main use case, do not offer filtering in the P13n dialog. Use the filter bar instead (annotation: sap:filterable)

    Be persistent: When the app is reopened, the smart table is shown with the same view settings as last defined by the user (sap.ui.comp.smarttable.SmartTable, property: persistenceKey).

    Sort

    The current sort state is displayed as follows:

    In default delivery, sort items in a meaningful order by the row-identifying column (usually the first column in default delivery). For example, use an alphabetical order for text, a numeric order for numbers, and a chronological order for dates (annotations: sap:sortable, PresentationVariant – SortOrder).

    Filter

    The current filter state is displayed as follows:

    Group

    Group headers display the current group state and are shown automatically. The following text should be shown on the group header:

    [Label of the grouped column]: [Grouping value]
    This can be done by the smart table, but only if the raw data from the model can be used. In other cases, app development teams must format the group header text. For example, the raw data carries IDs, while the table displays the corresponding names, which are provided by another data source. In this case, app developers must provide the formatting for the group header texts.

    Within the responsive table, the grouped column keeps its visibility to reduce confusion after the group settings have been changed. If visible, it stays in the tabular layout even if grouped.

    If used with the analytical table, grouping is not offered on measures. Therefore, you can have aggregations or grouping for a specific column.

    Reasonable grouping can be offered by default via the property GroupBy.

    Responsive table grouped by sales order ID
    Responsive table grouped by sales order ID

    Aggregate

    If used with the analytical table, aggregation settings can be provided on measure columns. These settings are only available in the column header menu.
    To display the current aggregation state, the total sum of the corresponding column is shown at the bottom of the table.
    If items are grouped, an intermediate sum is shown per group:

    • At the bottom of each group if the group is expanded.
    • In the group header if the group is collapsed.

    Aggregations are only available on measures, but not on objects or attributes. If aggregation is enabled for a column, this column cannot be grouped.

    Avoid aggregations on the first three columns for the default delivery. When grouping is used together with aggregations, collapsing a group shows the aggregation on the group header. This conflicts with the group name.

    Where appropriate, offer reasonable aggregation by default (annotation: sap:aggregation-role, value: measure).

    Column Settings

    Only offer column settings if you need more columns than a tablet screen can display at a time (usually more than five).

    If sorting, grouping, and/or filtering are needed, column settings must also be shown (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).

    Add, Remove, Rearrange Columns

    Use the P13n dialog to add, remove, and rearrange columns.

    When used with the grid table, analytical table, or tree table, columns can also be rearranged by dragging and dropping the column header (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).

    Resize Columns

    When used with the grid table, analytical table, or tree table, columns can be resized on the column header (sap.ui.comp.smarttable.SmartTable, Property:useTablePersonalisation).

    Freeze Columns

    When used with the grid table, analytical table, or tree table, app developers must manually add the options for freezing columns to the column header menu if necessary. They can do this by declaring the corresponding table inside the smart table in the XML view, and by using the corresponding settings on this inner table.

    Selecting Freeze on a column freezes all columns from the first one to the one on which Freeze is selected. The menu entry on this column changes from Freeze to Unfreeze.

    Properties

    The following properties are available on sap.ui.comp.smarttable.SmartTable:

    • The property: ignoreFields defines the columns that are not available on the UI – neither in the initial visible columns nor in the P13n dialog.
    • The property: requestAtLeastFields can be used for requesting additional technical columns.
    • The property: ignoreFromPersonalization removes columns from the P13n dialog.
    • The property: toolbarStyleClass is deprecated. Do not use it.
    • The property: enableCustomFilter allows the filter menu item in the column header menu to be exchanged.
    • The property: useOnlyOneSolidToolbar is deprecated. Do not use it.
    • The property: currentVariantId defines the currently used variant.
    • The property: enableAutoBinding fetches the data automatically as soon as the corresponding OData model is initialized and the smart table is created.
    • The property: tableBindingPath defines the path from which the data is fetched.
    • The property: smartToggle influences the way on which controls are displayed in the smart table if smart fields are used.

    The following aggregations are available:

    • The aggregation: semanticObjectController is used to customize smart links inside the smart table.
    • The aggregation: noData provides a text in case the table contains no line items. For example, this can be the case if the table is filtered. The text should provide context-specific instructions on how to get data into the table.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Do not use a responsive table as a form
    Do not use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    The responsive table displayed on a smartphone (size S)
    The responsive table displayed on a smartphone (size S)
    The responsive table displayed on a tablet (size M)
    The responsive table displayed on a tablet (size M)
    The responsive table displayed in compact mode on a desktop computer (size L)
    The responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth).

    To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none”, which is handled like the “medium” priority (sap.m.Column, property: importance).

    Instead of moving columns to the pop-in area, you can also hide columns of one or more priority levels (property: hiddenInPopin).

    In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: moving the data below the labels
    Pop-in area: moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter info bar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter info bar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter info bar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter info bar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. Only use this mode if row clicks are being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header. Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).
    Responsive table without selectable items
    Responsive table without selectable items
    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item.

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'delete' mode
    Responsive table in 'delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable. If the user clicks on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event. Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    If the click area for the row is being used for another purpose (such as navigation), it cannot be used for selecting the row. In this case, use the “single select left” selection mode, which offers a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in default delivery.

    In all other single selection cases, use the selection mode “single select master”.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Don't
    Single selection left - Do not show radio buttons in the first column in the default delivery
    Single selection left - Do not show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Do not show checkboxes in the first column in the default delivery
    Multiple selection - Do not show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.m.Column, property: width).

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Do not truncate column headers
    Do not truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers and amounts, except IDs, to ensure comparability of such figures.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align: dates and times (to ensure comparability for most formats and locales).

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Vertical alignment:

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Do not use top alignment if it doesn't make sense
    Do not use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multiline cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Do: wrap text
    Do: wrap text
    Don't
    Do not: truncate text
    Do not: truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Offer the corresponding actions in the footer toolbar if the responsive table is the only area on the screen to which actions can be applied. This has the advantage that the actions on the footer toolbar are fixed on the screen and cannot be scrolled away.
    • In other cases, show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    Inline actions
    Inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection
    Place actions near to the objects to which they belong
    Place actions near to the objects to which they belong

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    There are three options for adding an item after the Add button is pressed. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    A new item can have three different states:

    1. New: The item was just created and is in edit mode. It is highlighted with a visual indicator.
    2. Recent: The item was saved, but is still highlighted and displayed as the first item of the table. Current filter, sort and group criteria are ignored to keep the item visible.
    3. As soon as the responsive table is sorted, filtered, or grouped again, the action is also applied to the new item. It then also loses the visual highlight.

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery. From this column, use the primary data point.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the info bar below the table title. Clicking the info bar opens the view settings dialog on the filter page.

    Show the info bar only if the filter settings are not shown somewhere else. For example, do not show the info bar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the info bar is shown, provide an option to reset all corresponding filters on the info bar.

    Keep the info bar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the info bar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (CTRL + V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree Table

    A tree table contains a hierarchical set of data structured in rows and columns and grouped into nodes. The analytical table (also know as ALV) can provide additional details in several non-hierarchical columns per line item. 

    Usage

    Trees are used to display and work with large amounts of hierarchical data. They have a high data density and therefore convey an immediate feeling of complexity. Ideally, you should only show trees with a lot of hierarchical data as a last resort. Try the following instead:

    • Break down the data into manageable chunks and allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Responsiveness

    A tree table is available for desktops and tablets, but not in smartphone sizes. It supports touch devices, but is not optimized for small screens.

    If you use a tree table, note that you have to implement a fallback solution for small screens. This fallback solution does not need to support all use cases.

    Possible fallback solutions are as follows:

    • Use navigation to different pages instead of a tree structure. This works well for structures that are no more than four levels deep.
    • Remove levels until only one or two remain. Replace a single-level tree by a table, and a two-level tree by a grouped table or a split-screen layout.
    • Use filtering instead of a tree structure.

    You can try to create a fallback based on these ideas, but a completely different solution, such as showing charts in a read-only case, might be more appropriate.

    Tree table shown on a desktop
    Tree table shown on a desktop
    Tree table shown on a tablet
    Tree table shown on a tablet

    Types

    Like all SAP Fiori controls, the tree table is shown in compact mode on a desktop and in cozy mode on tablets.

    For a desktop, you can also display even more rows on the same screen height by adding the condensed mode in addition to the compact mode. This renders less white space for each item.

    Note that the condensed content density has always to be set in addition to compact. Do not use condensed on its own. Do not mix condensed with cozy. Doing so could lead to unpredictable and / or unwanted results, e.g. cozy sized controls in condensed sized containers, missing padings, etc.

    Note that neither compact mode nor condensed mode can be interacted with via touch. Even on a desktop with a touch screen, users will have difficulty selecting rows or using controls inside the cells when using their fingers.

    Furthermore, condensed mode is not available for Internet Explorer 9. If condensed mode is to be used, please provide a fallback.

    For more information on cozy and compact modes, see content density.

    Compact Mode

    Tree table - Compact mode
    Tree table - Compact mode

    Condensed Mode

    Tree table - Condensed mode
    Tree table - Condensed mode

    Components

    Column Header

    The column header provides the label for the corresponding column and access to the column header menu.

    Resizing columns works in the following ways:

    • Mouse interaction: Dragging the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable).
    • Touch interaction: The user taps the column header to reveal two buttons: one for showing the column header menu and one for resizing. Drag the latter to resize the column.

    After resizing a column, the adaptation of the column widths depends on how the column width is set:

    • If column widths are set in pixel-based units (px, em, rem), the corresponding column is adapted and following columns are moved accordingly. The width of all other columns is not affected.
      If all the columns together take up less width than the table control, an empty space is added. If all the columns together take up more width than the table control, a scrollbar appears.
    • If all column widths are set in percentage or “auto”, resizing one column might also lead to the automatic resizing of some or all other columns. The position of the resized column might also be affected. This is done to ensure that the whole table width is used and no white space is added. A scrollbar appears only, if all or most of the columns get very small. To avoid the unintended side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    Columns can be rearranged by dragging the column header to another position (sap.ui.table.TreeTable, property: enableColumnReordering).

    Tree table – Column header
    Tree table – Column header
    Opening the column header menu on touch devices
    Opening the column header menu on touch devices
    Less columns than space available
    Less columns than space available

    Line Item

    A line item contains a set of cells and provides options for selecting the item.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    Tree table – Line item
    Tree table – Line item

    In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. Provide a separate column per action. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.

    Tree Column

    The first colum (tree column) provides the hierarchical structure.

    Tree table – Tree column
    Tree table – Tree column

    Expand/Collapse Button

    The expand/collapse button is offered on container nodes to allow the child items of the corresponding container to be shown or hidden.

    Tree table – Expand/collapse
    Tree table – Expand/collapse

    Container Node

    A container node is a line item that contains child elements.

    Tree table – Container node
    Tree table – Container node

    Leaf Node

    A leaf node is a line item that does not contain child elements.

    Tree table – Leaf node
    Tree table – Leaf node

    Cell

    Each cell provides one data point. It can contain one of the following controls to display the data point:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Tree table – Cell
    Tree table – Cell

    Tree Cell

    A tree cell is a cell inside the tree column. Besides its data point, it provides a collapse/expand button on container nodes, and it indents the different hierarchy levels.

    Tree table – Tree cell
    Tree table – Tree cell

    Column Header Menu

    For the tree column, the column header menu can contain the menu item Freeze and a Filter field, in which the user enters free text.
    For all other columns, only the free text filter is available.

    Tree table – Tree column header menu
    Tree table – Tree column header menu

    Selection Cells

    For multiselection tree tables, the first column contains checkboxes for selecting line items. Besides multiselection, the tree table offers a single-selection mode and also a read-only mode, in which line items are not selectable.

    Tree table – Selection cells
    Tree table – Selection cells

    Select All

    For multiselection tree tables, the column header can contain a checkbox above the selection cells for selecting or deselecting all line items.

    Tree table – Select all
    Tree table – Select all

    Scrollbar

    The tree table allows horizontal and vertical scrolling. You can add any number of line items to the tree table, which uses “lazy loading”.

    To prevent adverse side effects when scrolling vertically, all line items must have the same height (sap.ui.table.TreeTable, property: rowHeight).

    The tree table is optimized to allow faster scrolling within the first 1000 items.

    Tree table – Vertical scroll bar
    Tree table – Vertical scroll bar

    Behavior and Interaction

    Selection

    The tree provides the following possibilities:

    No selection: Items cannot be selected. (property: selectionMode = None)

    Tree table – No selection
    Tree table – No selection

    Single selection: One item in the tree table can be selected. A row selector column is shown. (property: selectionMode = Single)

    Tree table – Single selection
    Tree table – Single selection

    Multiple selection: One or more items can be selected. The tree table provides a column with checkboxes on the left-hand side. Clicking a checkbox toggles the state of the corresponding row from deselected to selected and back. The Shift key can be used to select a range.

    For multiple selection, you can choose between two variants.

    • Multi-toggle mode (property: selectionMode = MultiToggle)
    • Multi-selection plug-in (sap.ui.table.plugins.MultiSelectionPlugin)

    These variants behave differently when the user selects more items than are currently loaded in the front end.

    Multi-toggle

    In multi-toggle mode, you can offer a Select All checkbox to the left of the column header (property: enableSelectAll). Selecting this checkbox selects or deselects all items that are currently loaded in the front end. All other items are not selected/deselected. If the application data is stored in the back end, scrolling down further can reveal additional unselected items. The same can happen with range selections if not all items in the selected range have been loaded to the front end.

    Multi-selection plug-in

    If you use this plug-in instead of the multi-toggle selection mode, the behavior for range selection and Select All changes:

    • By default, a dedicated Deselect All button replaces the Select All checkbox. There is no default UI element for selecting all items.
    • You can set a limit for the number of items that can be selected (sap.ui.table.plugins.MultiSelectionPlugin, property: limit). This limit has the following effect:
      • The range that can be selected using the Shift key is limited to the specified number of items (default = 200). The table automatically scrolls back to the last selected item and a message can appear (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification). Users can select more items by selecting additional ranges (the specified limit applies each time).
      • If the selection limit is set to 0, a Select All checkbox is shown. There is also no limit on the number of items that can be selected in a range. All selected items are loaded, which can lead to performance issues for large data sets.
    • If selected items are not already available in the front end, they are loaded automatically by the plug-in and set as selected.
    Information
    When setting a limit for the number of items that can be selected, keep the following boundaries in mind:

    • The performance of your service: How many items can be loaded at once in a reasonable time? Does this also apply if an end-user shows all available columns?
    • The “minimum limit”: Internally, the grid table loads blocks of items as the user scrolls down. Because this block size (sap.ui.table.TreeTable, property: threshold) is usually also based on the performance of the service, it should be safe to assume that the minimum selection limit is twice this size. In this case, loading the data would take as long as scrolling down and loading exactly one more block. Nevertheless, we recommend using larger limits if your service allows.

    Tree table – Multiple selection
    Tree table – Multiple selection
    Using the multi-selection plug-in with a limit
    Using the multi-selection plug-in with a limit

    Selection Behavior

    An item can be selected in different ways, depending on the configuration of the tree table (sap.ui.table.Table, property: selectionBehavior):

    • Row: An item is selected by clicking the checkbox or the row. Use this option for multi-selection tree tables if clicking a row or a cell is not used for anything else.
    • RowSelector: An item is selected only by clicking the checkbox in the selector cell. Use this option if clicking the row (or a cell inside the row) is used for something else, such as navigation.
    • RowOnly: An item is selected only by clicking the row, and not using checkboxes in the selector cells. Use this for single-selection tree tables if clicking a row or a cell is not used for another purpose, such as navigation.

    Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.ui.table.TreeTable, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position  (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and Drop
    Drag and Drop

    Column Header Menu

    Sort

    The column header menu can provide two sort options (sap.ui.table.Column, properties: sortProperty, showSortMenuEntry):

    • Sort Ascending
    • Sort Descending

    The user selects one of these options to sort the corresponding column accordingly (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    Sort settings in column header menu
    Sort settings in column header menu

    Filter

    The column header menu can provide a search field for entering free text. If the user enters a term in the input field and triggers the search by pressing Enter, the tree is filtered by the tree column and the corresponding value. If no items match the filter values, the filtered tree table may be empty.

    Tree table – Filter
    Tree table – Filter

    Freeze Columns

    The Freeze/Unfreeze option is provided in the column header menu of all columns. Using Freeze on one column freezes all columns from the first one to the selected one.

    Tree table–- Freeze
    Tree table–- Freeze

    Column Handling

    Show/Hide Columns

    Columns can be shown and hidden. If the tree column is hidden, the following column is the tree column.

    Rearrange Columns

    The user rearranges columns by dragging and dropping the corresponding column header. The tree column is always the first column and cannot be dragged.

    Resize Columns

    Columns are resized as follows:

    • Mouse interaction: The user drags the separator line between two columns (sap.ui.table. Column, property: Resizable). Double-clicking the line optimizes the column according to the length of the currently visible data and the label of the column header (sap.ui.table.Column, property: Autoresizable). Note that auto-resizing works only if the cells in this column contain one of the following controls: text, label, link, or input.
    • Touch interaction: The user clicks or taps the column header to reveal two buttons: One to show the column header menu, and one for resizing. The user drags the latter to resize the column.

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column) or special rows (like group headers). Context menus can be implemented for a specific table, row, or cell (not recommended for editable cells).

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree table with context menu
    Tree table with context menu

    Cell Content

    The tree is traditional in that each cell can contain only one data point in one single line.

    Apart from plain read-only text, cells can contain the following:

    While it is technically possible to also use other controls, doing so could lead to issues in regards to alignment, condensed mode, screen reader support, and keyboard support.

    If you use text, use only single-line text to keep the same row height. Truncate if necessary as this prevents adverse side effects when scrolling vertically (sap.m.Text, property: wrapping, value: false).

    Guidelines

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree table displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    Where nodes need to be filtered, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree table itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.

    Sorting

    First of all: Is sorting meaningful in your tree? If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    To display the current sort state, an icon is shown in the column header of the most recently sorted column. This icon indicates the sort direction (sap.ui.table.Column, properties: sorted, sortOrder, sortProperty).

    The descending sort order must always be the exact reverse of the ascending sort order. For each column, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Loading Data

    To indicate that the table is currently loading items, use the busy state (sap.ui.table.TreeTable, property: busy). Do not show any items or text. As soon as the data has been loaded, remove the busy state and show all items.

    Initital Display

    Think of the initial expand / collapse state of a tree: If your structure contains many items on the root level, it might make sense to collapse the whole tree in the beginning.

    In contrast, if the main items to work with are displayed on a deeper level (e.g. the parent nodes are just some kind of categorization), the tree should be expanded up to the first level where the needed items appear.

    Selection

    • We strongly recommend using the multi-selection plug-in. This ensures that all items selected using Select All or as part of a range are included – even if some items were not initially loaded in the front end. This is not the case if you use the multi-toggle option.
    • Do not limit the range selection for the multi-selection plug-in unless you have to.
      • If the dataset is small and/or completely available in the front-end, set the limit property to 0 to enable the Select All option and allow users to select any range.
      • If you have a large dataset, set a limit on the number of selected items to avoid performance issues. Also bear in mind that some actions won’t be helpful if the dataset is too big (for example, a delete operation on 2 million database entries).
    • When setting a limit, also display the corresponding message when the user selects more items at once than the limit allows (sap.ui.table.plugins.MultiSelectionPlugin, property: enableNotification).
    • In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion.

    Empty Table

    Try to avoid empty tables. If necessary, provide instructions on how to fill the tree table with data.

    Remove the item count in the table title if there are zero items.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the tree table or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    For more details, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let the user choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Columns

    Minimize the number of columns. Avoid the need to scroll horizontally in the default delivery. In the first column, show the hierarchical data, which should identify the line item. Choose the name over the ID, but if both are needed, show the name first, then the ID.

    The tree table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.ui.table.Column, property: width).

    If you define the column width in pixels or rems, resizing a column affects only the width of this specific column. Reducing the browser window size results in a scrollbar. After resizing a column, a scrollbar appears if the width of the table is not enough to show all columns. If the columns use less space than is available, white space appears on the right side of the last column.

    If you define the column width as a percentage, resizing one column affects the width of several or all columns. Text becomes truncated when the browser window size is reduced. This is done to make sure that all columns together fill the space of the table. A scrollbar appears only in case the automatic change of the column widths is not enough to display all columns. To avoid the side effect of undersized columns, a minimum width can be set per column. Please be aware that this minimum width is only taken into account if columns are automatically resized. End users are still able to reduce the column width below the provided minimum. (sap.ui.table.Column, properties: width, minWidth)

    If you define the column width as “auto”, the behavior is the same as for “percentage”. In contrast to percentage, “auto” distributes the columns equally.

    To decide on how to set the column width (pixel/rem/em vs. percent/auto), keep the following tips in mind:

    • For tables with only 2 to 3 columns, use pixel-based units. This ensures that on wide screens the values in the columns are not spread over the whole screen, which improves readability of line items.
    • For tables with many columns, where a horizontal scrollbar is usually needed, use pixel-based units. This avoids unintended side effects when resizing columns.
    • For all other tables, use whatever fits your case better.

    Be cautious with mixing columns with pixel-based and percentage-based widths. While this can be helpful in some cases, it could also cause even more unintended side effects when resizing a column. When using percentage-based widths for one or more columns, think of the possibility to not allow end users to resize columns at all.

    Alignment of Cell Content

    Align column headers according to their cell content:

    • Texts are left-aligned.
    • Numbers (except for IDs), dates, and times are right-aligned.
    • Icons are centered.
    • Micro charts are left-aligned.

    In addition, align amounts with currencies to the decimal point. You can do this with the sap.ui.unified.Currency control.

    Note that most currencies have two digits after the decimal point, but there are exceptions, for example:

    • The Tunisian dinar has three digits.
    • The Japanese yen has no digits.

    In tree tables with mixed currencies, all amounts still have to be aligned to the decimal point.

    To enable positive and negative values to be identified more easily, position the minus sign to the right of the number. It is placed in the same position in every row.

    For more information, see currency.

    Formatting Cell Content

    • Note that there are different locale formats, so show dates, times, and numbers in the correct format for the user’s language/country.
    • If you show both a a text and an ID, consider the requirements for sorting, grouping and filtering:
      • If users need to sort, group, and/or filter by both text and ID, show the text and ID in two separate columns.
      • If users only need to sort, group, and/or filter by either text or ID, show the ID in parentheses after the corresponding text.
    • If the unit of measurement is the same for all rows, show the unit of measurement in the column header. Otherwise, show the unit of measurement within the row.
    • If you want to let users sort, filter, or group by amount and by unit of measure independently, put both in different columns. If you combine them in one column, offer only sorting, filtering, and grouping by amount.

    Tree vs. Table

    Trees are more complex than tables due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Do
    Example of an acceptable use of tree tables
    Example of an acceptable use of tree tables
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in the hierarchy
    Favor breadth over depth in the hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid single root nodes. A single root node is often used to provide a Select All feature. Since the tree control provides an extra space for a Select All feature, the root node is not usually needed.
    • When you use only two levels, choose a grouped table or grouped ALV over a tree table control. Expand all groups for the default delivery.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.

    Design Concepts

    The tree table can be used to display large amounts of hierarchical data. Unfortunately, tree tables have a high data density and therefore convey an immediate feeling of complexity. Ideally, tree tables with large amounts of data should only be shown if there is no other option. You should instead try the following:

    • Flatten the data. A list, table, or ALV is still complex, but less so than a tree table.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Try to avoid horizontal scrolling in the default delivery.

    Navigation

    To trigger navigation on line item level, choose one of the following options:

    • Use a link for the attribute that identifies the row. Clicking the link triggers the navigation. This is the preferred option.
    • Add the RowActions column and show the navigation arrow (  ) at the end of the row. No column header text is required. The navigation column is fixed and will not scroll away. Users also cannot personalize this column. The navigation arrow triggers the navigation.
      Do not use the RowActions column for actions other than navigation and deletion.

    Special case: Multi-selection in a master-detail scenario
    When a multi-selection table is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case, you can display a “navigated” indicator to show which item is currently open.

    Examples of Incorrect and Correct Usage

    When you use trees:

    • Choose breadth over depth.
    • Emphasize important values. Do not let the user run into a wall of text without guidance. You can use bold text for this.
    • Try to minimize the number of columns, especially if there is a large number of rows.
    • Optimize column width for its initial visible content. Do not automatically adjust column width based on content changes.
    • Do not wrap content, truncate it. End users can easily change the column width to see the full text.
    Don't
    Avoid: The initial visible content should not be truncated in the default delivery
    Avoid: The initial visible content should not be truncated in the default delivery
    Don't
    Never wrap texts
    Never wrap texts
    • Maintain a fixed layout, except when the user wants to change it.
    • In the default layout, use the tree column for the item name or data that identifies the row. This helps the user to choose between different items.
    • Create a clear and immediately understandable hierarchy. Use clear parent-child relationships. If this is not possible, add a child in different nodes to help the user find the element.
    Do
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items
    • Consider persisting the layout settings. When a user reopens the app, show the tree table with the same column sizes, column order, and view settings as last defined by this user.
    • Use the Select All feature only if it makes sense. Note that selecting a lot of data also takes time and might not be appropriate for all use cases. For example, a delete operation on two million database entries might not be very helpful in many cases.
    • Set the property collapseRecursive to “false” in order to keep the selection on subnodes even after collapsing and expanding the root node.

    Empty Tree Tables

    Avoid empty tree tables. If necessary, provide instructions on how to fill the tree table with data (sap.ui.table.TreeTable, properties: noDataText, showNoData).

    Examples:

    • If a tree table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree table with data.
    • If a tree table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree table is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.ui.table.TreeTable, aggregation: rowSettingsTemplate)

    Highlighted items
    Highlighted items

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree table, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop target on an Item
    Drop target on an Item

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Don't
    Do not combine rearranging items on the same level with sorting
    Do not combine rearranging items on the same level with sorting

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up / the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar). Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the table, row, or cell. However, we do not recommend using context menus for cells: because the content of a cell is a different touch target than the cell itself, opening a cell context menu via touch is quite hard, even in cozy mode.

    Do not combine context menus with condensed mode: editable controls fill the entire space inside a cell. Because of this, context menus cannot be opened at all with touch or mouse interaction.

    Tables in Object Pages

    In the object page, we advise against using analytical, grid, and tree tables. Instead, use a responsive table and offer navigation to a list report with the table types mentioned above.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Tree

    Within SAP Fiori, we distinguish between tree tables and trees. Both usually allow the user to display and work with a hierarchical set of items. While tree tables are usually used for more complex data, trees are generally used for rather basic data. Trees are mostly used in the master list for a master-detail scenario using the flexible column layout and in popovers or dialogs. In certain use cases, they can also be used in the dynamic page layout.

    In the case of tree tables and trees, items that contain additional items are called nodes, while items that do not contain any other items are called leaves. If available, a single topmost node is called a root node. Apart from the hierarchical structure of its nodes and leaves, a tree is quite similar to a list.

    Usage

    Use the tree if:

    • You need to display the key identifier of hierarchically structured items (for example in the first column of the flexible column layout).
    • Selecting one or more items out of a set of hierarchically structured items is a main use case.
    • The hierarchy has a restricted number of levels (up to about 12, depending on the content) and items (around 200).
    • You want to have only one implementation for all devices.

    Do not use the tree if:

    • The main use case is to select one item from a very small number of non-hierarchical items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • Items are not structured hierarchically. Use a list instead.
    • The hierarchy turns out to have only two levels. In this case, use a grouped list.
    • The hierarchy turns out to be just a categorization based on several details of the item. In this case, an analytical table provides multi-level grouping. Note that the analytical table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need to display very deep hierarchies with additional data per item. In this case, use a tree table. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • The structure contains more than around 200 items. In this case, use the tree table. It is optimized for large item sets and provides better performance. Note that the tree table is not fully responsive. It is only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.

    Check out the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The tree is like a list containing hierarchical data. It acts as a container for items, with the possibility to expand and collapse nodes. When reducing the width, item texts wrap to ensure that the tree adapts to the new size.

    In addition, the tree changes the indentation per level dynamically when the user expands a node, based on number of levels currently showing.

    Tree displaying 2 levels
    Tree displaying 2 levels
    Tree displaying 3 levels
    Tree displaying 3 levels
    Tree displaying 4 levels
    Tree displaying 4 levels

    Layout

    The title bar (optional) contains the title of the tree. In addition, an item counter and toolbar items can be placed on the title bar.
    The collection of hierarchical items occupies the main part of the tree.

    Schematic visualization of the tree
    Schematic visualization of the tree

    Components

    The title bar consists of a toolbar. The toolbar can contain a title, an item count, and other toolbar items such as actions or view settings, for example.

    The standard tree item consists of:

    • A highlight indicator (optional)
    • An expand/collapse button for nodes
    • A selector in form of a checkbox or a radio button (optional)
    • An icon (optional)
    • text
    • A counter (optional)
    • Additional buttons with actions such as Edit, Navigate, or Delete (optional)

    If additional controls are needed, use a custom tree item. The custom tree item allows you to use any combination of controls inside the tree.

    Standard tree item
    Standard tree item

    Behavior and Interaction (incl. Gestures)

    Tree Level

    Scrolling

    The height of the tree is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    Same tree, with different expand state
    Same tree, with different expand state

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.Tree, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a sticky area, the tree is automatically scrolled to top.

    Sticky title
    Sticky title

    Selection Modes

    A tree can have one of the following selection modes (sap.m.Tree / sap.m.ListBase, property: mode):

    None: Items cannot be selected (sap.m.ListMode.None).
    Beware: Items can, nevertheless, use the sap.m.ListType “navigation” which allows click-handling on specific items. This should only be used when the click triggers a navigation to a corresponding item details page.

    Tree without selectable items
    Tree without selectable items

    Single select master: One item of the tree can be selected. To select an item, click anywhere on the item. Single select master does not add any visual indication to the tree and therefore cannot be differentiated from trees without selection if no item is selected. Therefore, always keep one item selected. For single selection, this is the preferred mode. (sap.m.ListMode.SingleSelectMaster)

    Single selection: only one item is selected.
    Single selection: only one item is selected.

    Single select left: One item of the tree can be selected. For this, the tree provides radio buttons on the left side of each line item. Use this selection mode only if clicking on the item triggers something else, such as a navigation. Ideally, always keep one item selected, even in initial state (sap.m.ListMode.SingleSelectLeft).

    Single selection with radio buttons. Use only if row clicks are used for something else, such as for navigation.
    Single selection with radio buttons. Use only if row clicks are used for something else, such as for navigation.

    Multiple selection: Allows the selection of one or more items. For this, the tree provides checkboxes on the left side of each line item. Each item is selected independently of the others. The Shift key can be used to select a range (sap.m.ListMode.MultiSelect).

    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut CTRL+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    Also note that CTRL+A only (de)selects items within expanded nodes.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether CTRL+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Multiple selection
    Multiple selection

    Deleting

    To delete single items, use the tree in “delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds a Delete   button to each item. Clicking this button triggers the deletion of the corresponding item. Do not use this mode if deleting multiple items at once is the preferred use case. Delete is a mode of the tree and  therefore cannot be used together with single selection or multi selection.

    Tree in “delete” mode
    Tree in “delete” mode

    Line Item Level

    Expandable and Collapsible Nodes

    An Expand/Collapse button is provided automatically for each node.

    Expand/collapse button
    Expand/collapse button

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.TreeItemBase, properties: highlight).

    Highlighted item
    Highlighted item

    Navigating

    To allow navigation from an item, set type to “navigation” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This will create an indicator at the end of the line (“>”) and the entire item will become selectable. Clicking the line triggers the navigation event. However, clicking a selectable area or an expandable/collapse node does not. Use the navigation event to navigate to a new page containing item details.
    If no navigation is possible, set type to “inactive”.
    Navigation is an item type and therefore cannot be used together with “edit” or in combination with click events for the entire item (“active”).

    Tree items with navigation indicator
    Tree items with navigation indicator
    Navigation indicators can be set per item
    Navigation indicators can be set per item

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection tree with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.TreeItemBase, property: navigated).

    Navigated item
    Navigated item

    Editing Items

    To allow the user to edit an item, set type to “detail” within the corresponding item (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an edit  button at the end of the line. Clicking the button triggers the edit event. Use this event to either open a dialog or a details page where the item can be edited.
    Edit is an item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Clicking an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere except when triggering a selection or when expanding/collapsing a node). Apps can react to the event, such as by opening a dialog (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).
    Active elements do not have a visual indication and therefore cannot be differentiated from non-active elements.
    “Active” is an item type and  therefore cannot be used together with “navigation” or “edit”. In addition, “active” uses the entire item as a clickable area and thus cannot be used together with single select master.

    Active items
    Active items

    Context Menu

    You can attach a context menu (sap.m.Menu) to a tree. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    The context menu can be triggered for the tree or per item.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a tree is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Tree - context menu
    Tree - context menu

    Drag and Drop

    One or several items can be repositioned within a tree or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Guidelines

    Tree vs. List

    Trees are more complex than lists due to their hierarchical view. Users tend to have more problems finding items in hierarchical views than in flat lists, except where the hierarchical view is natural. By natural we mean that every child node should be part of only one parent, and this relationship between the child and parent is clear and well known.

    Example of an acceptable use of trees
    Example of an acceptable use of trees
    Do
    A clear parent-child relationship
    A clear parent-child relationship

    Broad vs. Deep Hierarchies

    When you use trees, you should choose broad hierarchies over deep hierarchies. Deep hierarchies make finding items more complicated. So try to reduce hierarchical levels where possible, especially if the hierarchy is not natural. Ideally, a tree should have a maximum of four levels, the first two of which should contain the most important items.

    Don't
    Avoid unnecessary depth in the hierarchy
    Avoid unnecessary depth in the hierarchy
    Do
    Favor breadth over depth in a hierarchy
    Favor breadth over depth in a hierarchy

    You can use the following methods to reduce hierarchy levels:

    • Avoid a single root node. It is usually not needed.
    • Container nodes at the top level can usually be replaced by tabs or value pickers.
    • Eliminate unnecessary mid-level containers, for example, by combining redundant ones.
    • Exercise care when using a tree due to its overall complexity. The hierarchical structure of the data does not necessarily mean that a tree control is required.
    Acceptable: repeat entries to optimize finding items
    Acceptable: repeat entries to optimize finding items

    Design Concepts

    The tree can be used to display hierarchical data. Unfortunately, trees convey an immediate feeling of complexity. Ideally, show trees only if there is no other option. You should instead try the following:

    • Flatten the data. A list is still complex, but less so than a tree. A combo box might also fit in some use cases.
    • When only two levels are needed, a grouped list control can be used. This works well, where group nodes are used for categorizing their children and where the group nodes themselves do not need to be selectable.
    • Break down the data into manageable chunks. Allow the user to navigate or drill down between them.
    • Use charts with drilldown functionality until the amount of data is more manageable.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the tree. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Title

    Use a title only if the title of the tree is not indicated in the surrounding area. If needed, implement the title text by adding a title to a toolbar. Place the toolbar above the tree.

    Do not use a title if it simply repeats text that is already above the tree. For example:

    • Beverages tree is the only control on a tab labeled Beverages.
    • A section or subsection on an object page contains only one tree.

    Use a title if you need the item count, toolbar, or variant management. To avoid repeating text, feel free to use generic text as a title, such as Items.
    Exception: If the surrounding area contains the title, and both the item count and toolbar can be added to the surrounding area, no additional title is needed.
    Example: An object page (sub-)section contains only one tree. In this case, add the item count and the table toolbar to the (sub-)section header.

    If you use a title, be sure to include the following:

    • A title text for the tree.
    • An (optional) item count using the following format: Title (Number of Items). For example, Items (17). Depending on the use case, either count all items or only leaves (for example, if nodes are mainly used for categorization).

    Remove the item count in the title if there are zero items.

    If possible, keep the toolbar sticky (sap.m.Tree, property: sticky).

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the tree.

    If you don’t use a title (for example, to avoid repetition), make sure that the tree is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    Title
    Title
    Title with item count
    Title with item count

    Loading Data

    To indicate that the tree is currently loading items, use the busy state (sap.m.Tree, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Tree in busy state while loading data
    Tree in busy state while loading data

    Initial Display

    Think of the initial expandable/collapsible state of a tree. If your structure contains many items on the root level, it might make sense to collapse the whole tree in its initial state.

    In contrast, if the most important items are displayed on a deeper level (if, for example, the parent nodes are simply a kind of categorization), the tree should be expanded up to the first level where the most important items immediately appear.

    Content Formatting

    To display object names with an ID, show the ID in brackets after the corresponding object name.

    Place the ID in brackets after the corresponding object name
    Place the ID in brackets after the corresponding object name

    Try not to display an empty tree. If there is no way around this, provide instructions on how to fill the tree with data (sap.m.Tree / sap.m.ListBase, properties: showNoData, noDataText).

     

    Examples:

    • If a tree is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the tree with data.
    • If a tree is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a tree is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Provide meaningful instructions within an empty tree
    Provide meaningful instructions within an empty tree

    Highlighting Items

    To show that an item needs attention, you can display a highlight indicator in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items
    Highlighted items

    Item States

    To show that an item has been modified, for example within the global edit flow, add the string (Modified) to the text of the item.

    A modified item
    A modified item

    To show that a modified item contains an error, for example within the global edit flow, add the string (Contains errors) to the text of the item and highlight the row accordingly.

    A modified item with an error
    A modified item with an error

    To show that an item is locked, add the string (Locked by [name]) to the text of the item.

    A locked item
    A locked item

    To show that an item is in a draft state, add the string (Draft) to the text of the item.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Actions

    To trigger actions on items, show the actions on a toolbar above the tree. Do not offer action triggering on multiple items if the tree is expected to have fewer than 10 items in most cases.
    The following actions on single items must always be in-line:

    Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a delete  button at the end of each item.

    Items with Delete button
    Items with Delete button

    Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.

    Items with navigation indicator
    Items with navigation indicator

    Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an edit   icon at the end of the corresponding items.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation. Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the tree. For example: AddCollapse AllExpand All, …

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). Active items trigger an event when clicked, which can be handled by apps, for example, to open a dialog. Selection and expanding/collapsing a node does not trigger the event, but are handled by the tree. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.
    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection master.

    Add Items

    For adding items, place an Add or Create text button on the toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the tree or node:

    • If nothing is selected, add the new item to the root.
    • If a single node is selected, add the new item to the selected node.
    • If a single leaf is selected, add the new item as a child of this leaf. The original selected item becomes a node.

    If your tree doesn’t support adding items to the root, selected node, or selected leaf, disable Create or Add for the corresponding levels.

    Disable Create or Add if more than one item is selected.

    For more details, see guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that tells the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection

    Editing Items

    To edit items, add an Edit button either in-line on the toolbar above the tree. Triggering the button either opens a dialog or navigates to an editable details page.

    For mass editing:

    • Provide multiselection (sap.m.Tree/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button on the toolbar above the tree.
    • If several items are selected, triggering the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For more details, see mass editing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. Also, because there is no generic keyboard interaction, drag and drop isn’t accessible. Moreover, drag and drop is not available on all browsers. For these reasons, offer drag and drop only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within a tree, use the following options:

    • For dropping items as a child, use whole nodes as drop targets (sap.ui.core.dnd.DropPosition.On).
    • For dropping items on the same level, use the space between items as drop targets (sap.ui.core.dnd.DropPosition.Between).
    • If you want to allow users to drop items as a child or sibling, offer both drop targets (sap.ui.core.dnd.DropPosition.OnOrBetween).

    This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Do not combine rearranging items within one level and sorting. If you really need to do so, make sure there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    Moving items from one node to another can be combined with sorting without any issues.

    Drop targets in between items
    Drop targets in between items

    Visible Alternatives to Drag and Drop

    Depending on the functionality you need, use one or more of the following alternatives:

    • To move items up or down within a node:
      Use the  Move Up and  Move Down buttons on the toolbar. These buttons move the selected items until the first selected item can’t be moved up or the last selected item can’t be moved down any further.
      Depending on your tree, this can make sense for both leaves and nodes, only for leaves, or only for nodes. When moving a node, move the whole node and (if applicable) all its children up or down to the next position within the parent node.
      Always make sure that when the user moves an item in one direction and then moves it back, the order is the same as it was before.
      Do not combine the option to move items up and down with sorting.
    • To move items to another node:
      Use Copy and Paste buttons on the toolbar.
      Alternatively, offer a Move To button. Clicking Move To opens a dialog that shows all the nodes of the tree, but no leaves. Selecting an item in this dialog closes the dialog and moves the corresponding items to the selected node.
    • To change the level of an item:
      In some trees, such as document structures, users can change the level of an item without affecting the level of parent or child items. In this case, use left and right arrow buttons (   ).

    Filtering

    What exactly needs to stay or be removed is highly dependent on the kind of structure and data your tree displays. For many trees, the following approach works well if you want to apply filters only to the leaves of a tree:

    • Remove all leaves that don’t fit the filter criteria
    • Remove empty nodes

    If you also apply filters to nodes, keep the following in mind:

    • A node may or may not fit the filter criteria.
    • A node can contain items (nodes and/or leaves) that fit the filter criteria.

    Because of this, the results might contain more nodes than those that are relevant for the filter criteria.

    Developer Hint
    The tree control itself has no influence on the filter result. It sends a filter request and displays whatever comes back. Make sure that the result set is meaningful.
    [/vc_row_inner]

    Sorting

    Before you start, ask yourself if sorting is meaningful in your tree. If so, decide on a meaningful default sort order.

    If sorting is meaningful, is it meaningful on all levels? Or does the tree structure need to be stable? In the latter case, sort only leaves, but not nodes.

    The descending sort order must always be the exact reverse of the ascending sort order. Use a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting the tree data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    Responsive Table

    The responsive table is the default table in SAP Fiori. It contains a set of line items and is fully responsive. Depending on the scenario, users can also navigate from the line items to further details.

    A line item contains several data points sorted into columns. A data point refers to a unit of information, such as a number, a text, a unit of measurement, and so on, which can be used to form the content of a tableform or other control. One data point is usually displayed by a control, such as a text, object status, or input field. A control can display more than one data point, for example, by concatenating text.

    In contrast to traditional tables, a “cell” of the responsive table is not limited to displaying only one control, and therefore a single cell can present far more than one data point.

    Responsive table
    Responsive table

    Usage

    Use the responsive table if:

    • You need a table. The responsive table is the default table in SAP Fiori.
    • You need to use various controls inside a line item, such as micro charts. By contrast, the analytical table supports only a very limited set of controls.
    • The focus is on line items, not on cells. The responsive table is optimized for viewing complete items on all devices.
    • Selecting one or more items is a main use case and details are needed to choose the correct item.
    • Line items are independent of each other and no operation across columns is needed.
    • You want to have only one implementation for all devices. As the name suggests, the responsive table is responsive.

    Do not use the responsive table if:

    • The main use case is to select one item from a very small number of items, without viewing additional details. In this case, a select or combo box might be more appropriate.
    • The main use case is to select one item from several items, with the possibility of viewing only a few details per item. In this case, a list might be more appropriate. Pay attention to the layout of the list item to ensure that it has a pleasant appearance.
    • The cell level and the spatial relationship between cells is more important than the line item. In this case, use the analytical table or grid table. Examples include spreadsheet analyses and waterfall charts. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You expect the table to contain more than around 1,000 rows. Try using the analytical table or grid table instead; they are easier to handle, perform better, and are optimized for handling large numbers of items.
      Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Comparing items is a major use case. In this case, the analytical table or grid table might be more appropriate because each cell contains only one data point. By contrast, the responsive table offers greater flexibility within line items, including the ability to add more data points per cell and the pop-in function. Both make comparisons more difficult. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • Data needs to be structured in a hierarchical manner. In this case, a tree table might be more appropriate. Although the analytical table can have several grouping levels, it is not as flexible when nodes at several levels contain child nodes. Note that neither the analytical table nor the grid table are fully responsive. Both are only available for desktops and tablets, so you will need to take an adaptive approach by offering an additional UI for smartphones.
    • You need an overview of a large amount of data. In this case, use a chart.
    • You just need it for layout reasons. In this case, use a layout container such as a horizontal layout or a vertical layout instead.
    • You need read-only or editable field-value pairs. In this case, use a form instead. The responsive table is not optimized for form-like input navigation.
    Don't
    Do not use a responsive table as a form
    Do not use a responsive table as a form

    See the table overview to decide which SAP Fiori table is most suitable for your needs.

    Responsiveness

    The responsive table is optimized for viewing one line item at a time with no scrolling or only vertical scrolling, irrespective of the display width.

    On smartphones, only the most important data remains in the one-column or two-column table, while all other data is moved to the space between two item rows, known as the “pop-in area”.

    In this area, data for the corresponding cell is provided as a label/value pair. The label is defined by the column header, and the value is taken from the corresponding cell. Labels can be displayed next to the value or above the value.

    Within the pop-in area, the label/value pairs can be displayed in the following ways (sap.m.Table, property: PopinLayout):

    • Block: Label/value pairs are listed one below the other.
    • GridSmall: Label/value pairs are displayed next to each other in equally spaced grid cells. An additional column is shown for each 13 rem of available width (208 px with default browser settings). If the number of grid cells exceeds the available width, the grid cells wrap. On S size, this layout transforms automatically to a block layout.
    • GridLarge: The display logic is the same as for GridSmall,, but grid columns come with a larger minimum width (26 rem instead of 13 rem).

    In all layouts, you can show the labels next to or above (recommended) the corresponding data.

    The responsive table uses all the available space, and does not provide any padding. If there is space around the table, it comes from the spacing defined for the surrounding layout container.

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.
    The responsive table displayed on a smartphone (size S)
    The responsive table displayed on a smartphone (size S)
    The responsive table displayed on a tablet (size M)
    The responsive table displayed on a tablet (size M)
    The responsive table displayed in compact mode on a desktop computer (size L)
    The responsive table displayed in compact mode on a desktop computer (size L)

    The responsive behavior is optional. If it is not used, the responsive table just minimizes all visible columns until they are no longer readable.

    There are two ways to configure responsiveness: auto pop-in mode and manual pop-in mode (sap.m.Table, property: autoPopinMode).

    The auto pop-in mode ensures responsiveness automatically and is sufficient in most cases. You can still influence the behavior per column, but only to a limited extent.

    The manual mode is more flexible, but needs are more configuration. This configuration becomes more cumbersome when table columns can be shown/hidden or re-ordered. On the other hand, only the manual mode allows you to:

    • Let more than one column stay in the tabular layout
    • Move more than one column into the pop-in area at once
    • Hide columns instead of moving them to the pop-in area

    In both modes, the responsive table ensures that at least one column always remains in the table layout.

    Auto Pop-In Mode

    The auto pop-in mode handles responsiveness automatically. You can optimize this to a certain extent by adapting the behavior per column.

    Columns have a minimum width. As soon as the width of all the visible columns exceeds the table width, the right-most column moves to the pop-in. The default minimum width per column is 8 rem. You can change this value for each column (sap.m.Column, property: autoPopinWidth). To further influence the behavior, you can assign columns a priority. Low-priority columns move to the pop-in first (right-most low priority column first), medium-priority columns next, and high-priority columns last. The default priority is “none” which is handled like the “medium” priority (sap.m.Column, property: importance). In auto pop-in mode, all other pop-in-related column settings are ignored.

    Manual Pop-In Mode

    The manual pop-in mode allows more flexibility but also requires more effort if you want it to work in a meaningful way. You also need to invest additional effort if table columns can be shown/hidden or re-ordered.

    You need to configure each column manually. Depending on the width of the table (in pixels), the column needs to know which of the following responses is required:

    • Stay in the table layout (in auto pop-in mode, only one column stays in the table layout).
    • Move to the pop-in (sap.m.Column, with the properties: demandPopin, minScreenWidth, popinHAlign, popinDisplay).
    • Hide (not possible in auto pop-in mode)

    By default, the table width is assumed to be the screen width. If the table does not use the full width of the screen, app developers must configure the table accordingly (sap.m.Table, property: contextualWidth).

    Because you configure the pop-in response for each column individually, you can also handle more than one column at a given breakpoint. This allows you to move several columns to the pop-in area at once, which isn’t possible in auto pop-in mode

    Each of the three device types has a predefined value for the screen width. However, you will get better results if you offer more breakpoints by using pixel values instead of the predefined values.

    For the smallest screen width, keep the following information in the table layout:

    • The identifier of the line item
    • The key attribute

    Example for Block Layout

    A typical responsive table.

    A typical responsive table
    A typical responsive table

    Hide the information column for a width smaller than 570 px.

    Hiding the information column
    Hiding the information column

    Move the column “vendor” to the pop-in area for a width smaller than 460 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the vendor column to the pop-in area
    Moving the vendor column to the pop-in area

    Move the column “limit” to the pop-in for a width smaller than 350 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the limit column to the pop-in area
    Moving the limit column to the pop-in area

    Move the column “price” to the pop-in area for a width smaller than 270 px (sap.m.Column, properties: demandPopin, minScreenWidth).

    Moving the price column to the pop-in area
    Moving the price column to the pop-in area

    If you still need to support smaller screens, values can be moved below the corresponding labels inside the pop-in area. In these examples, this happens for a width smaller than 220 px (sap.m.Column, property: popinDisplay).

    Pop-in area: moving the data below the labels
    Pop-in area: moving the data below the labels

    Example for GridLarge Layout

    A more complex responsive table.

    A more complex responsive table (full screen without pop-in)
    A more complex responsive table (full screen without pop-in)

    In this example, the Average Occupancy Rate and Available In columns move to the pop-in area if the screen width is less than 1900 pixels.

    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area
    GridLarge layout - 'Average Occupancy Rate' and 'Available In' columns move to the pop-in area

    If the width is less than 1500 pixels, the Average Stay column moves to the pop-in area.

    GridLarge layout - 'Average Stay' column moves to the pop-in area
    GridLarge layout - 'Average Stay' column moves to the pop-in area

    If the width is less than 1100 pixels, the Description column moves to the pop-in area. Since all four columns in the pop-in area do not fit into one row, the pop-in wraps.

    GridLarge layout - 'Description' column moves to the pop-in area
    GridLarge layout - 'Description' column moves to the pop-in area

    If the width is reduced even further, the Details column moves to the pop-in area. On this narrow screen, only one column fits into one pop-in row, so it looks exactly like the block layout.

    GridLarge layout - 'Details' column moves to the pop-in area
    GridLarge layout - 'Details' column moves to the pop-in area

    Layout

    The optional title bar consists of the title of the responsive table, an item counter, variant management, and the toolbar.

    The filter info bar appears when the responsive table is filtered, and shows information on the filter settings.

    The column header shows the label for each column.

    The collection of items, or rows, occupies the main part of the responsive table.

    You can add aggregation information (such as totals) on the table footer.

    A More button can be shown if you do not want all items to be loaded at the start (known as “lazy loading”). Ideally, you should use scrolling to load more items instead of choosing the More button.

    Schematic visualization of the responsive table
    Schematic visualization of the responsive table

    Components

    The title bar contains the title of the responsive table, an item counter, variant management, and the toolbar.

    The toolbar can contain entry points for the view settings dialog and the table personalization dialog, as well as view switches in the form of a segmented button, and buttons for AddEdit, and other actions.
    Beneath the toolbar, display a filter info bar (which itself is a special toolbar) if the responsive table is filtered.
    To format within items, apply the guidelines for formatting data. Controls commonly used inside items are the object identifier and the object number. For more information about these controls, see object display components.
    You can use the table footer to display additional static information relating to the table content.
    The More button loads more items to the front end if not all items have yet been loaded.
    Components of the responsive table
    Components of the responsive table

    Behavior and Interaction

    The responsive table is quite flexible with regard to its content.

    Table Level

    Scroll

    The height of the table is defined by the number of items it contains. It does not have a scroll container on its own, but is scrolled together with the app (in contrast to the grid table and the analytical table).

    If the table works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    Same table, different number of items
    Same table, different number of items

    When the user scrolls, the title bar, column headers, and filter info bar can stick to the top of the surrounding layout container (sap.m.Table, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas (title bar, column headers, filter info bar) are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the table is placed within the object page.
    • If focus is set to a fixed column header, the table is automatically scrolled to top.

    Sticky table title and sticky column header
    Sticky table title and sticky column header

    Merge Duplicates

    To simulate the behavior of row spanning, you can merge cells of consecutive rows inside one or more columns automatically if they contain the same value (sap.m.Column, properties: mergeDuplicates, mergeFunctionName).

    Use the merge feature if you expect the column to contain duplicate entries, and it makes sense to group them. In the example screenshot, the Supplier, Product, and Dimensions columns reflect a hierarchical structure: Suppliers have products, which in turn have dimensions. Because suppliers typically have multiple products, merging duplicate entries for the supplier column makes the table easier to read. Note, however, that when the user sorts the table by another field, the hierarchy changes and the merged items are regrouped accordingly.

    Do not use the merge feature:

    • If duplicate entries are not part of the design. If consecutive table rows happen to have the same values at runtime, this alone isn’t a valid reason to group them.
    • If the corresponding column can contain blank cells. Otherwise, it is cumbersome to differentiate between blank values and merged values.
    Supplier column merges duplicates in consecutive rows
    Supplier column merges duplicates in consecutive rows
    Merged columns with multiselection
    Merged columns with multiselection

    Select

    A responsive table can have one of the following selection modes (sap.m.Table/ sap.m.ListBase, property: mode):

    • None: Items cannot be selected (sap.m.ListMode.None).
      Beware: Line items can still use the sap.m.ListType “navigation”, which allows click handling on specific line items. Only use this option if the click triggers navigation to a corresponding line item details page.
    • Single selection master: One item in the responsive table can be selected. Items are selected by clicking or tapping the whole row. The single select master mode has no obvious visual cues, such as checkboxes or radio buttons. It only provides a light blue background for the selected state. Because of this, it can barely be differentiated from tables without selection (mode: None). Single select master is the preferred mode for single selection (sap.m.ListMode.SingleSelectMaster).
    • Single selection left: One item in the responsive table can be selected. For this, the responsive table provides radio buttons on the left side of each line item. Only use this mode if row clicks are being used for something else, such as navigation. (sap.m.ListMode.SingleSelectLeft).
    • Multiple selection: Users can select one or more items using the checkboxes on the left side of each line item. The Shift key can be used to select a range. Users can (de)select all items using the Select All checkbox to the left of the column header. Select All should (de)select all items that the user can reach by scrolling.  (sap.m.ListMode.MultiSelect).
    Responsive table without selectable items
    Responsive table without selectable items
    Single selection master
    Single selection master
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    SIngle selection left, with radio buttons. Use only if row clicks are used for something else.
    Multiple selection
    Multiple selection

    Group

    For grouping items, a group header is displayed (sap.m.GroupHeaderListItem). The group header is not interactive.

    Group headers
    Group headers

    Show Aggregations

    Show aggregations (such as totals) on the table footer (sap.m.Column, aggregation: footer).

    Do not show aggregations in “growing” mode. It is not clear, if an aggregation will only aggregate the items loaded into the front end, or all items.

    Table footer displays aggregated total
    Table footer displays aggregated total

    Load Items

    To show more than 200 items, use the “growing” mode (sap.m.Table/ sap.m.ListBase, properties: growing, growingThreshold, growingScrollToLoad, growingTriggerText). The growing mode allows the user to load only the first few items. Additional items are only loaded (and rendered) on request, which improves performance. The “request” can either be done via scrolling (preferred), or by clicking the More button.

    If using the More button, show the number of items already loaded and the total number items below the text More, if possible.

    Do not show more than 1,000 items overall, even in growing mode. Use the grid table instead.

    Do not show aggregations in growing mode. Also, do not display an item count on the table toolbar if growing mode is used. Use the count on the More button instead.

    Load on scroll
    Load on scroll

    Line Item Level

    Delete Single Item Rows

    To delete single item rows, use the table in the mode “delete” (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This adds Delete buttons to each line item. Clicking this button triggers the deletion of the corresponding line item.

    Do not use this mode if deleting multiple lines at once is the preferred use case.

    Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection.

    Responsive table in 'delete' mode
    Responsive table in 'delete' mode

    Highlight an Item

    To highlight an item, use the “highlight” indicator (sap.m.ColumnListItem, properties: highlight).

    Highlighted item
    Highlighted item

    Navigate

    To allow navigation from a line item, use an item with the type “navigation” (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This creates an indicator at the end of the line (“>”) and the entire line item becomes clickable. If the user clicks or taps on the line, navigate to a new page containing line item details. In rare cases, you can also use the navigation mode for category navigation, without navigating to another page.

    By contrast, clicking an interactive control within a line item does not trigger the navigation event. Instead, the corresponding control handles the click event.

    If no navigation is possible, set sap.m.ListType to “inactive”.

    “Navigation” is a list item type and therefore cannot be used together with “edit”, or in combination with click events for the entire item (“active”).

    Navigation indicator
    Navigation indicator

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection table with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ColumnListItem, property: navigated).

    Navigated item
    Navigated item

    Edit Line Items

    To allow editing for a line item, set sap.m.ListType to “detail” within the corresponding item (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail or sap.m.ListType.DetailAndActive). This will create an Edit button at the end of the line. Clicking the button triggers the edit event. Use this event to switch the corresponding line item to edit mode.

    Edit is a list item type and therefore cannot be used together with “navigation” or in combination with click events for the entire item (“active”).

    Edit button
    Edit button

    Click an Item

    Items as a whole can be clickable. An event is fired by clicking on the item (anywhere where there is no interactive control inside the item). Apps can react on the event, for example, by opening a dialog (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active or sap.m.ListType.DetailAndActive).

    Active elements do not have a visual indication and can therefore not be differentiated from non-active elements.

    Active is a list item type and can therefore not be used together with “navigation” or “edit”. In addition, “active” uses the whole item as a clickable area and therefore cannot be used together with a single-selection table.

    Active element
    Active element

    Drag and Drop

    One or several items can be repositioned within a table or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Context Menu

    You can attach a context menu (sap.m.Menu) to a table. The context menu gives users an alternative way to modify the focused elements by giving them access to context-specific functions.

    When opened, the context menu gets the row and column context, except for special columns (such as the selection column). Context menus can be implemented for a specific table or row.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    If a control inside a table is the “click target”, and the control also provides a context menu, the control context menu “wins”.

    Responsive table with a context menu
    Responsive table with a context menu

    Cell Level

    Showing Information

    In contrast to traditional tables (such as the analytical table or the tree table), a cell can contain more than just one line of text.

    Several lines of text within one cell
    Several lines of text within one cell

    Add Controls

    Alongside textual elements, you can also add any control to a table cell, such as input fields, microcharts, buttons, and so on.

    Controls inside cells
    Controls inside cells
    Any control can be placed inside cells
    Any control can be placed inside cells

    A cell can contain more than one control and more than one data point.

    With the View Settings dialog, users can sort, filter, and group by each of these data points.

    Several controls per cell
    Several controls per cell

    You can also have different controls in different rows in the same column. This could be the case if one item is locked, but another item is in edit mode, for example.

    Different controls per column
    Different controls per column

    Guidelines

    Responsiveness

    In most cases, the auto pop-in mode is sufficient. If you need to optimize further, first try to adapt the columns to influence the automatic behavior (sap.m.Column, properties: autoPopinWidth, importance). For example, set the priority for the two or three most important columns to “High” (identifying column, key attribute).

    While the pop-in layouts GridLarge and GridSmall make better use of the available width, they also only look good with content that is specifically designed for these pop-in layouts. If you have text-only tables with only one value per column, use the Block layout (sap.m.Table, property: popinLayout).

    Place the column header labels in the pop-in area above the corresponding values (sap.m.Column, property: popinDisplay, value: Block). This avoids alignment issues with different content. Be aware that the labels get top-aligned with the adjacent content.
    Only place the label next to the corresponding value under the following conditions (sap.m.Column, property: popinDisplay, value: Inline):

    • The values are text-only (no input fields, icons, images, micro charts, and so on)
    • The available space is at least the double the width of size S.

    This avoids truncation or “over-wrapping” of the labels and content.

    If a column does not have a column header text (for example, if it always contains the same button with its own label), do not show the header text as a label in the pop-in area either (sap.m.Column, property: popinDisplay, value: withoutHeader). If you forget this setting, you will see an empty space followed by a colon (“:”).

    Information
    The GridSmall and GridLarge layouts are not available in all browsers. If the chosen layout is not available, it is automatically changed to Block layout.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the responsive table. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Table Title

    Implement the table title by using a title control in a toolbar.

    Use a table title only if the title of the table is not indicated in the surrounding area. Do not use a table title if it simply repeats text that is already above the table. For example:

    • A pricing conditions table is the only control on a tab labeled Pricing Conditions.
    • A section or subsection on an object page contains only one table.

    Use a table title if you need the item count, table toolbar, or variant management. To avoid repeating text, feel free to use generic text as a table title, such as Items.
    Exception: If the surrounding area contains the table title, and both the item count and toolbar can be added to the surrounding area, no additional table title is needed.
    Example: An object page (sub-)section contains only one table. In this case, add the item count and the table toolbar to the (sub-)section header.

    Developer Hint
    Assistive technologies (such as screen readers) use the title to create a hierarchical site map for faster navigation. In addition, screen readers use the title as the label for the table.

    If you don’t use a title (for example, to avoid repetition), make sure that the table is connected to another meaningful on-screen text that can be used as a label for assistive technologies. You can do this using the method addAriaLabelledBy.

    If you use a table title, show either a title for the table, with or without variant management, or an item count in the following format:

    Items (2,534)

    The item count in the table title includes all the visible items that a user can reach by scrolling. Group headers are not included.

    Remove the item count in the table title if there are zero items. Do not use an item count together with “growing mode”.

    If possible, keep the title bar sticky (sap.m.Table, property: sticky).

    Table title with item count
    Table title with item count

    Selection

    If the click area for the row is being used for another purpose (such as navigation), it cannot be used for selecting the row. In this case, use the “single select left” selection mode, which offers a radio button as an additional click area for each row. To avoid confusion, make sure that the first data column does not contain radio buttons in default delivery.

    In all other single selection cases, use the selection mode “single select master”.

    For all single selection modes, make sure that one item is initially selected. Otherwise, the user cannot return to the initial state. A selected item can only be deselected by selecting another item.

    In multiple selection mode, do not show checkboxes in the first data column in the default delivery to avoid confusion. Offer the Select All checkbox for (de)selecting all items the user can reach by scrolling.

    Don't
    Single selection left - Do not show radio buttons in the first column in the default delivery
    Single selection left - Do not show radio buttons in the first column in the default delivery
    Don't
    Multiple selection - Do not show checkboxes in the first column in the default delivery
    Multiple selection - Do not show checkboxes in the first column in the default delivery
    Do
    Use the selection mode
    Use the selection mode "single select left" if clicking the row is used for something else (such as navigation)
    Do
    Use the selection mode
    Use the selection mode "single select master" in all other single-selection cases
    Developer Hint
    Select All is only applied to items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded, such as items added via lazy loading with growingScrollToLoad. This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its selectAll flag. This indicates whether the Select All checkbox was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    Loading Data

    To indicate that the table is currently loading items, use the busy state. (sap.m.Table, property: busy). Do not show any items or text. As soon as the data is loaded, remove the busy state and show all items.

    Table in busy state while loading data
    Table in busy state while loading data

    Columns – Best Practices

    Minimize the number of columns:

    • On a smartphone, use only one or two columns, depending on the content.
    • On a tablet or desktop, use three to five columns if the responsive table is shown within the flexible column layout. Use about eight columns if using the full screen width, depending on the content.

    If the responsive table does not fit into the width provided:

    • Hide columns to reduce the width of the table.
    • Use pop-in areas to show the whole content by increasing the height of the line items (sap.m.Column, properties: demandPopin, minScreenWidth).

    At the smallest size, keep the following information in the table layout:

    • The column that identifies the line item.
    • The column that contains the key attribute.

    If both of these do not fit into the width provided, keep just the column with the line item identifier in the tabular layout.

    The responsive table assigns the same width to each column by default. It is recommended that you overwrite this default to provide optimal space for your content (sap.m.Column, property: width).

    Optimize column width for its initial content (sap.m.Column, property: width). If the content is dynamic, optimize column width for typical content.

    If you need more columns than those that fit on a tablet screen (usually five) to fulfill 80% of your main use cases, offer an option to add, remove, and rearrange columns via the table personalization dialog. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    Column Headers – Best Practices

    Within the column header, provide a label for each column (sap.m.Column, aggregation: header). The column header label is reused as a label in the pop-in area.

    Exception: If the column does not pop in, no column header label is needed as long as at least one column still has a column header label.

    Use controls that wrap and support wrapping with hyphenation, such as text (with wrapping and hyphenation enabled). Do not use controls that truncate.

    Keep column headers sticky.

    Do
    Wrap column headers
    Wrap column headers
    Don't
    Do not truncate column headers
    Do not truncate column headers

    Column headers (sap.m.Column, aggregation: header) usually contain links or text-based controls.

    Column headers can also contain other kinds of SAP Fiori controls. However, the column header cannot be aligned vertically, making it difficult to use many controls in the column header. Using other kinds of controls also creates problems with pop-in behavior and could thus lead to accessibility issues. Therefore, exercise caution when using them in a column header.

    Accepted: Link as column header text (rarely used)
    Accepted: Link as column header text (rarely used)
    Accepted if responsiveness is taken into account: Text plus search field
    Accepted if responsiveness is taken into account: Text plus search field

    If a column cell contains several fields, use an umbrella term in the column header (such as Address for fields like Street, ZIP Code, and City).

    For text and ID fields, use a generic label (for example, Employee for Name and ID).

    If none of these are possible, separate the labels with “/” (for example, Name / Status).

    For boolean values, such as checkboxes, find a descriptive text for the column header.

    Content Alignment

    For alignment of cell content, follow the guidelines below (sap.m.Column, properties: halgin, valign, sap.m.ColumnListItem, property: VAlign). Align the column header horizontally according to the content of the cell.

    Exception: Secondary information in a column always follows the alignment of the main information.

    Left-align: text, IDs, phone numbers, URLs, passwords, and email addresses.

    Left-alignment of text
    Left-alignment of text

    Right-align: numbers and amounts, except IDs, to ensure comparability of such figures.

    Right-alignment of numbers
    Right-alignment of numbers

    Right-align: dates and times (to ensure comparability for most formats and locales).

    Right-alignment of dates
    Right-alignment of dates

    Left-align status information.

    Left-align status information
    Left-align status information

    Center-align icons.

    Vertical alignment:

    Top-align where possible to facilitate reading the content on one line.

    Do not use top-alignment if it results in a peculiar layout. This usually happens when controls that need more vertical space are combined with text-only controls, such as input fields. In this case, try center-alignment instead and fine tune it until the layout fits.

    Do
    Use top-alignment where possible
    Use top-alignment where possible
    Don't
    Do not use top alignment if it doesn't make sense
    Do not use top alignment if it doesn't make sense

    Content Formatting

    The responsive table provides flexibility, including multiline cells, by enabling every control to be put into a cell.

    As a key identifier of an item, use an object identifier. Show the key identifier in the first column. For more information, see object display components.

    If the table width is small, do not hide this column or move it to the pop-in area.

    Object identifier
    Object identifier

    Strings with IDs: If the responsive table contains more single-line data, show the ID in brackets after the corresponding string.

    This minimizes the line height.

    For items with a small line height, place the ID in brackets after the corresponding string
    For items with a small line height, place the ID in brackets after the corresponding string
    If displayed as a link, use the whole text as the link
    If displayed as a link, use the whole text as the link

    Strings with IDs: If line height is already large, show the ID below the corresponding string. Use the object identifier to do so.

    For items with a large line height, place the ID below the corresponding string
    For items with a large line height, place the ID below the corresponding string
    Is displayed as a link, use only the first line as the link
    Is displayed as a link, use only the first line as the link

    If there is more than one key identifier (for example, First Name and Last Name), display these columns first and show the values in bold text.

    Several key identifiers
    Several key identifiers

    For status information, use semantic colors on the foreground elements.

    For status information on text: If the status is actionable, add a transparent icon button next to the text.

    Semantic colors on text
    Semantic colors on text

    Avoid truncation. Use controls that wrap the text and support hyphenation.

    For example, use text.

    Do
    Do: wrap text
    Do: wrap text
    Don't
    Do not: truncate text
    Do not: truncate text

    For editable content, use input fields and other interactive controls within the table cells. If you need to offer edit mode, change your text controls (labels, text, and links, to input fields or other appropriate controls) as soon as you switch to edit mode, but not before.

    You can do this by changing the control or, in more complex cases, by exchanging the whole responsive table.

    Interactive controls – Inline
    Interactive controls – Inline

    If there is no value for a cell, leave it blank. Do not display text as N/A.

    Leave empty fields blank
    Leave empty fields blank

    Numbering Items

    • If the item number has four digits/letters or less and is equally important as the corresponding description, concatenate the item number with the description and show it in one column.
    • If the item number has five digits/letters or more, or if it is more important than the corresponding description, for example, when no description is available, use a separate column for the item number.
    • If the item number is more like an ID in regards to its description, use ID formatting, like Description (ID).
    For short numbers, add the item number to the description
    For short numbers, add the item number to the description

    Flag and Favorite

    Place the flag or favorite marker in the first column (in the default delivery). To change the settings, users need to drill down into the object itself.

    Item marked as a favorite
    Item marked as a favorite

    Empty Tables

    Try not to display an empty responsive table. If there is no way around this, provide instructions on how to fill the table with data (sap.m.Table/ sap.m.ListBase, properties: showNoData, noDataText).

    Examples:

    • If a table is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the table with data.
    • If a table is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      To start, set the relevant filters.
    • If a table is used together with a filter bar and the filter does not return results, use the following text:
      No data found. Try adjusting the filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, a search is also offered, or only the search is offered).
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of filter settings).

    Remove the item count in the table title if there are zero items.

    Provide meaningful instructions
    Provide meaningful instructions

    Item States

    To show that an item is unread, use the corresponding flag (sap.m.Table, property: showUnread, sap.m.ColumnListItem/ sap.m.ListItemBase, property: unread). This shows most of the content in bold font.

    An unread item
    An unread item

    To show that an item has been modified, for example, within the global edit flow, add the string (Modified) at the bottom of the column that identifies the line item.

    A modified item
    A modified item

    To show that a modified item contains an error (for example, within the global edit flow), add the string (Contains errors) at the bottom of the column that identifies the line item. To do this, use an object status control with the error state (sap.m.ObjectStatus, property: state, value: sap.ui.core.ValueState.Error).

    In addition, highlight the row accordingly (sap.m.ListItemBase, property: highlight).

    A modified item with an error
    A modified item with an error

    To show that an item is locked, use a transparent button with the corresponding icon and the text Locked by [Name] at the bottom of the identifying column. The user can click or tap the button to open a quick view of the person.

    A locked item
    A locked item

    To show that an item is in a draft state, use a transparent-style button with the text Draft at the bottom of the identifying column. The user can click or tap the button to open a popover showing the timestamp of the last change.

    Item in draft state
    Item in draft state

    Show only one state at any one time.

    Highlight Items

    To show that an item needs attention, you can show a highlight indicator next to the item. The highlight indicator can indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It doesn’t tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using industry-specific (indication) colors
    Highlighted items using industry-specific (indication) colors

    Numbers and Units

    If the following conditions all apply, show the unit of measurement in the column header:

    • The unit of measurement is the same for all rows
    • A single cell contains only one amount with the unit of measurement
    • The column header does not scroll away

    In all other cases, show the unit of measurement together with the corresponding amount within the row.

    Show the unit of measurement in the same column as the corresponding amount.

    For numbers with units, show the correct formatting by using the object number control.

    Object number
    Object number

    For the most important number with its unit, show the correct formatting by using the object number control and the emphasized flag.
    Exception: If all numbers are of equal importance, emphasize none of them.

    If the table width is narrow, do not hide this column or move it to the pop-in area.
    Exception: If the column containing the object identifier and the column containing the key attribute do not fit together on the screen, move the column containing the key attribute to the pop-in area.

    Object number (emphasized)
    Object number (emphasized)

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the table, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values in a column, the dropped item needs to take on the value of the target group for the corresponding column. If this is not wanted, do not allow users to rearrange items in grouped tables.

    Example:
    A table is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.
    Do not combine rearranging items with grouping, unless you know exactly what you're doing.

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    The context menu can be triggered for the whole table or per row.

    Actions

    To trigger actions on multiple items, use a multiselection table (sap.m.Table, property: mode, value: sap.m.ListMode.MultiSelect), and offer the corresponding actions on the table toolbar. Keep the table toolbar sticky (sap.m.Table, property: sticky).

    Do not offer actions for multiple items if the table is expected to have fewer than 10 items in most cases.

    To trigger actions on a single item only (sap.m.Table, property: mode, value: sap.m.ListMode.SingleSelectMaster):

    • Offer the corresponding actions in the footer toolbar if the responsive table is the only area on the screen to which actions can be applied. This has the advantage that the actions on the footer toolbar are fixed on the screen and cannot be scrolled away.
    • In other cases, show the actions on the table toolbar.
    • In rare cases, show the actions within the line item. One example would be an Add to Cart button in a shopping application. Since these actions are repeated in every line and thus use a lot of screen real estate, do this only for a maximum of one or two actions. In this case, show the action trigger near the content to which it belongs. Do not add a specific column for actions. Use a button, unless the action trigger belongs to a link. Hide the action in rows for which it is not applicable.
    Inline actions
    Inline actions

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Give users the option to apply the action anyway or to cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied, and if the items are still available, keep them selected.

    Message for an action that applies to a part of a selection
    Message for an action that applies to a part of a selection
    Place actions near to the objects to which they belong
    Place actions near to the objects to which they belong

    The following actions on single items must always be in-line:

    Delete: Use “Delete” table mode (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete button at the end of each row.

    Delete button
    Delete button

    Navigation: Use the “Navigation” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a Navigation indicator at the end of each row.

    Use this to navigate to a new page containing line item details. In rare cases, you can also use this for navigation within the table without navigating to another page.

    Navigation indicator
    Navigation indicator

    Edit: Use the “Detail” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit icon at the end of each row.

    Edit button
    Edit button

    From these three actions (delete, navigation, and edit), you can combine delete and edit, or delete and navigation.

    Edit and navigation cannot be combined.

    To trigger actions that are independent of the selection, show the actions on the table toolbar. Examples of such actions are add, edit (in the sense of changing the whole table to edit mode), sort, filter, group (or view settings), and table personalization.

    To trigger a default action on the whole line item, use the “Active” or “DetailAndActive” column list item type (sap.m.ColumnListItem/ sap.m.ListItemBase, property: type, value: sap.m.ListType.Active).

    Active items trigger an event when clicked, which can be handled by apps (for example, to open a dialog). Clicks on interactive controls within the item do not trigger the event, but are handled by the interactive control. Do not use this for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with single selection.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    There are three options for adding an item after the Add button is pressed. In order of priority (most recommended first), these are:

    1. Add the item inline. Create an empty, editable row as the first item of the table. Show the Save button on the table toolbar. This option is recommended for simple scenarios with just a few columns and no option to hide columns.
    2. Open a dialog for larger tables with up to 8 editable columns. Save the new item at the dialog level.
    3. Navigate to a new page. This behavior should only be used for very complex scenarios that cannot be handled by a dialog (for example, tables with more than 8 columns). When the user presses Save in the footer toolbar of the create page, navigate back to the table.

    A new item can have three different states:

    1. New: The item was just created and is in edit mode. It is highlighted with a visual indicator.
    2. Recent: The item was saved, but is still highlighted and displayed as the first item of the table. Current filter, sort and group criteria are ignored to keep the item visible.
    3. As soon as the responsive table is sorted, filtered, or grouped again, the action is also applied to the new item. It then also loses the visual highlight.

    In the context of the draft handling new items are not saved on table level, but rather with the entire draft.

    For more details, see the guidelines for managing objects (including subarticles).

    Add button in table toolbar
    Add button in table toolbar
    New item as first row in edit mode
    New item as first row in edit mode
    Saved new item, still highlighted, still the first item
    Saved new item, still highlighted, still the first item

    Editable Content

    For editable content, use input fields and any other interactive controls within the table cells that meet your input needs.

    All SAPUI5 controls can be used.

    If you need edit mode, change your text controls, such as label, text, and link, to input fields, or other appropriate controls as soon as you switch to edit mode, but not before.

    You can do this by exchanging the control or, in more complex cases, by exchanging the entire responsive table.

    For mass editing items:

    • Provide multiselection (sap.m.Table/ sap.m.ListBase, property: mode, value: sap.m.ListMode.MultiSelect).
    • Provide an Edit button.
    • If several items are selected, choosing the Edit button opens a dialog in which the user edits the corresponding fields for all selected items.

    For details, see mass editing.

    View Settings: Sort, Filter, and Group

    Sort, filter, and/or group settings are handled in the view settings dialog. This dialog can provide any combination of these three settings, including just one setting, such as sort only.

    • If sorting, filtering, and/or grouping are a common use case in your app, offer one, two, or all three of the corresponding features in one or more view settings dialogs. Note: Do not offer these features if the table is expected to have only a small number of entries (up to 20 in most cases).
    • If filtering is a main use case, do not offer filtering in the view settings dialog. Use the filter bar instead.

    To trigger the view settings dialog, provide several buttons, one for each of these view settings. Each button opens a view settings dialog that contains only the relevant page.

    You should always use only the view settings you really need. For example, do not offer grouping if it does not support your use case well.

    Using the view settings dialog allows you to define several sort, filter, and/or group settings per column. Therefore, you can sort, filter, and/or group a column with several data points independently by each data point.

    Several triggers for the different view settings (sort, filter, group)
    Several triggers for the different view settings (sort, filter, group)

    Sort

    For the default sort settings, sort by the column that identifies the row, which is usually the first column in default delivery. From this column, use the primary data point.

    If you offer sorting, offer it for each data point. In other words, allow sorting by both the primary and secondary information in a column. Allow sorting in both directions, ascending and descending. The descending sort order must always be the exact reverse of the ascending sort order.

    For each data point, provide a meaningful sort order. For example:

    • Sort text alphabetically
    • Sort numbers by their value
    • Sort status information by the severity of the status:
      • Ascending: Sort status information from positive to negative, with neutral last.
      • Descending: Sort status information from negative to positive, with neutral first.
    Object status sorted ascending, with neutral status last
    Object status sorted ascending, with neutral status last
    Object status sorted descending, with neutral status first
    Object status sorted descending, with neutral status first
      • Ascending with different values per severity level: Sort status information from positive to negative, with neutral last. Sort different values within a severity level (semantic color) alphabetically.
      • Descending with different values per severity level: Sort status information from negative to positive, with neutral first. Sort different values within a severity level (semantic color) alphabetically.
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted ascending and alphabetically, from positive to negative with neutral last
    Object status sorted descending and alphabetically, from negative to positive with neutral first
    Object status sorted descending and alphabetically, from negative to positive with neutral first

    Filter

    To display the current filter state, use the info bar below the table title. Clicking or tapping the info bar opens the view settings dialog on the filter page.

    Show the info bar only if the filter settings are not shown somewhere else. For example, do not show the info bar for settings taken in the filter bar or in a select placed in the table toolbar.

    If the info bar is shown, provide an option to reset all corresponding filters on the info bar.

    Keep the info bar sticky (sap.m.Table, property: sticky).

    Developer Hint
    To display the current filter settings on the info bar, consider using the list formatter (sap.ui.core.format.ListFormat).
    Filtered table
    Filtered table

    Group

    To display the current group state, group headers are shown.

    On the group header, show the following text (sap.m.GroupHeaderListItem, property: title):

    [Label of the grouped column]: [Grouping Value]

    Do not use several values on the group header.

    Grouped table
    Grouped table

    If there is no grouping value, show the following text:
    [Label of the grouped column]: (Not Available)

    This is the case if you have a group of items that don’t have a value for the grouped column.

    Grouped table, with missing grouping value
    Grouped table, with missing grouping value

    Persist the view settings. When a user reopens the app, show the responsive table with the same sort, filter, and group settings as last defined by this user.

    Personalization

    To add, remove, or rearrange columns, use the table personalization dialog. Trigger the dialog via a button in the table toolbar.

    Offer personalization if you need more columns than those that fit on a tablet screen, which is usually five, to fulfill 80% of your main use cases. Before doing so, try to reduce the number of columns, for example, by using several lines per column or by utilizing the pop-in function. See the cheat sheet for an example.

    If all columns are hidden, the table shows a corresponding “no data” text.

    View settings and table personalization icons
    View settings and table personalization icons

    Persist the column layout settings. When a user reopens the app, show the responsive table with the same column layout as last defined by this user.

    Tables in Object Pages

    To show a table in the object page content area, use the responsive table.

    A responsive table with up to 20 expected items can be displayed right away, without lazy loading.
    If you expect the table to have more than 20 items, use one of the following 3 options:

    1. Lazy loading (More button): Use this option if you expect to have up to 100 items.
    2. Tab navigation: If you expect to have more than 50 to 100 items, but less than 400, use the object page with tab navigation instead of anchor navigation. Put the table on a dedicated tab.
    3. Navigation to a list report: If you expect the table to have more than 400 items, or if the tab approach is unsuitable, restrict the number of items in the table itself to a reasonable amount. To provide the user with a way to work with the entire table, offer navigation to a separate list report containing the full table.

    For all of the three options mentioned above, we recommend providing a search, and if feasible, sort and filter capabilities for the table in the object page. Grouping should be avoided.

    For more information on the use of tables within the object page, see the Tables section of the Object Page article.

    Export to Spreadsheet

    On the table toolbar, apps can provide a menu button for exporting table data to a spreadsheet. For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Paste

    To paste data from the clipboard to the table, the browser functionality for paste can be used (CTRL + V or browser context menu).

    • If the focus is on row level, the app has to take the data from the clipboard and add it to the corresponding controls within the table.
    • If the focus is on an editable control within the table, the control gets the data automatically.

    Pasting via context menu does not work if a custom context menu is used.

    Properties

    sap.m.Table

    The following additional properties are available for the responsive table:

    • The property: fixedLayout defines the algorithm the control uses to define column width. Setting it to “false” would perform automatic calculations for the column width, based on the longest non-breakable content. You should always set it to “true” for performance reasons. Exceptions are permissible if the table has only a few columns for a large width and fewer than 10 rows are displayed.
    • The property: backgroundDesign defines the background on which items are rendered. Use the default value.
    • The property: showOverlay provides an overlay on the whole table, which prevents use of the responsive table. This is used within the list report floorplan to mark the table as outdated after filter settings have been changed but the new filter settings have not yet been applied. Do not use it in other cases.
    • The property: inset adds a margin on all sides of the responsive table.
    • The property: headerText is a simple way to set the table title if you just need a title. However, do not use any of the following:
      • A separate toolbar
      • variantManagement
      • headerToolbar aggregation
    • The property: headerDesign affects the appearance of the header if the theme supports it. Leave the default value as it is.
    • The property: footerText adds a small additional row below the table footer or last item. This row can contain text only. Do not use this property.
    • The property: width defines the width of the whole table.
    • The property: includeItemInSelection uses a click on the whole line item to select the corresponding item if the responsive table is in a selection mode. This competes with other settings like “Navigation” or “Active” and should therefore not be used.
    • The property: enableBusyIndicator automatically shows a busy indicator while data is loaded. (In contrast to the property: busy, where the application can control when the table is set to busy state)
    • The property: modeAnimationOn does not have any effect. Do not use it.
    • The property: showSeparators allows you to show all, none, or some separators. The default setting, which is to show all separators, is to be used.
    • The property: swipeDirection allows you to define the direction in which to swipe if additional actions are hidden behind a table row. This works only on touch devices. Do not use this property.
    • The property: rememberSelections leaves items selected even if they are not currently visible, for example, through filtering. If this behavior is not wanted, set the flag to “false”, but you should do so only in exceptional cases.
    • The property: busy sets the table to a busy state. While in busy state, the whole table cannot be used and items cannot be read due to an overlay.
    • The property: busyIndicatorDelay defines the time after which a busy state is shown after the responsive table has been set to this state. Use the default value.
    • The property: visible shows the table (“true”) or hides it (“false”).
    • The property: tooltip does not have an effect. Do not use it.
    • The property: alternateRowColors displays the rows with alternating background colors (“banded rows”). Do not use it.

    sap.m.Column

    The following additional properties are available for sap.m.Column:

    • The property: width defines the width of the column in all units allowed by HTML, such as em, rem, %, and px.
    • The property: styleClass is used if you need to change the visual design of a column. Do not use this, but use the default style instead.
    • The property: visible shows or hides the column.
    • The property: tooltip does not have an effect. Do not use it.

    sap.m.ColumnListItem

    The following additional properties are available for sap.m.ColumnListItem:

    • The property: selected allows an item to be selected programmatically.
    • The property: counter does not have any effect. Do not use it.
    • Do not use the property: busy.
    • Do not use the property: busyIndicatorDelay.
    • The property: visible shows or hides the item.
    • The property: tooltip adds a tooltip to a whole row. The tooltip is only shown on mouse interaction. It will not work on tablets or smartphones. Do not use it.

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation

    List

    In SAP Fiori, we distinguish between tables and lists. Both usually contain homogeneous data, but lists generally have rather basic data, whereas the data in tables tends to be more complex. Lists are mostly used in the master list for a master-detail scenario using the flexible column layout, as well as in popovers or dialogs. For certain use cases, lists can also be used in the dynamic page layout.

    Usage

    Use the list if:

    • You want to display a homogeneous set of basic data.
    • You need to sort, group, or filter simple datasets.
    • You need to display a single-level hierarchy rather than using a complex tree table to support this simple use case.

    Do not use the list if:

    • You want to manage complex datasets that need to be extensively sorted, grouped, filtered, or edited. In this case, use a table.
    • You work with complex hierarchies. In this case, use a tree.

    Responsiveness

    The list is like a layout container. You can change its width, but you must also ensure that the items contained in the list adapt whenever the list is resized.

    All list item variants available in SAP Fiori already adapt to the respective screen size.

    List Item Variants

    The list contains various list items. These items can be of various types depending on the use case and on the content they have. SAPUI5 already provides the most common list items in SAP Fiori in the form of controls, although custom list items can also be created if necessary.

    All the available list item types behave responsively and adapt to changing screen sizes out of the box. Most of them use truncation if size becomes too limited, since they are usually used to navigate to the item details. For custom list items, you can also wrap the texts, if required.

    Object List Item

    The object list item is the list item variant used most frequently in SAP Fiori applications. Consisting of a title, key figure, attributes, and a status, it contains the most important information about an object.

    The space available for the attributes and status is limited as it should only show crucial information that allows the user to decide which items should be dealt with first.

    All essential information about an object is usually provided when the user navigates to the item details.

    For more information, see object list item.

    Object list items
    Object list items

    Standard List Item

    The standard list item is used for less complex entries, such as when the user selects an item in a dialog. This list item contains an optional image, a title, description, and a single info text (which can contain semantic information).

    For more information, see standard list item.

    Standard list items
    Standard list items

    Display List Item

    The display list item is the simplest form of a list item and is only capable of showing a label and values. It is seldom used.

    For more information, see display list item.

    Display list items
    Display list items

    Action List Item

    The action list item allows various actions to be triggered in a dialog. The action list item is not used in the content area.

    For more information, see action list item.

    Action list item
    Action list item

    Feed List Item

    The feed list item is mainly used in feeds and notes.

    For more information, see feed list item.

    Feed with feed list items
    Feed with feed list items

    Input List Item

    The input list item allows the user to enter data in a list item. It is seldom used in SAP Fiori apps as forms are usually the preferable method for entering data.

    For more information, see input list item.

    Input list item
    Input list item

    Components

    The list control comes with the following main properties:

    Header

    The header text contains the title of the list. It is usually only used when the list is in the content area.

    Footer

    The footer text is the last entry in the list, and as such, it scrolls away with the content. Therefore, this property is also seldom used.

    Lazy Loading

    Like the table, the list also allows lazy loading. The “growing” list property is used for this purpose.

    List with header and footer
    List with header and footer

    Empty List

    Avoid empty lists. If necessary, provide instructions on how to fill the list with data (sap.m.List/ sap.m.ListBase, properties: noDataText, showNoData).

    Examples:

    • If a list is initially empty, provide at least a basic text:
      No items available.
      Overwrite this whenever a hint can be provided on how to fill the list with data.
    • If a list is used together with a filter bar (as in the list report), and is initially empty, use the following text:
      No filters set. To start, enter your search and filter settings and run the search.
    • If a list is used together with a filter bar and the filter does not return results, use the following text:
      No items found. Check the search and filter settings.

    Adapt the texts above if:

    • The standard text is not precise enough for your use case (for example, no search is offered, only the search is offered).
    • You are using the live search (no Go button in the filter bar). In this case, leave out “run the search”.
    • The standard text is misleading (for example, if the data is filled based on a master-detail pattern instead of search and filter settings).
    Empty list
    Empty list

    Count

    List items can have a count, which is located on the far right of a row. You can use the count in simple lists, such as those that contain standard list items, to indicate how many subitems the user can expect when navigating to the item.

    Standard list items with counter
    Standard list items with counter

    Read/Unread

    You can set an indicator to highlight unread items, making it easier for the user to discover them (property: showUnread = true). If you set this indicator, all texts for the unread items are shown in bold font.

    By default, this indicator is switched off, and all list items are displayed in normal font.

    Display list item with read and unread items
    Display list item with read and unread items

    Highlight Items

    To show that an item needs attention, a highlight indicator can be shown in front of the item. The highlight indicator can be used to indicate:

    • A semantic state, such as red or orange for an error or warning. In this case, use semantic colors.
    • Additional information, such as blue to highlight newly added items. In this case, use semantic colors.
    • Industry-specific or process-specific states, such as “out of stock” or “excess of inventory”. In this case, use indication colors.

    Be aware that the highlight is just an indication. It does not tell users exactly what is wrong. Make sure that you provide this information within the table row, ideally in the same color.

    For details on the use of highlight colors, see How To Use Semantic Colors / Industry-Specific Colors.

    (sap.m.ListItemBase, property: highlight)

    Highlighted items using status colors
    Highlighted items using status colors
    Highlighted items using indication colors
    Highlighted items using indication colors

    Behavior and Interaction

    There are several ways to interact with the list and its list items:

    List Level

    Scroll

    The height of the list is defined by the number of items it contains. It does not have its own scroll container, but is scrolled together with the app.

    If the list works in a “growing” mode, it only loads a few items at first. Additional items are only loaded (and rendered) on request. The “request” can either be triggered by scrolling (preferred), or by clicking the More button.

    When the user scrolls, the title and the filter infobar can stick to the top of the surrounding layout container (sap.m.List, property: sticky).

    Information
    The “sticky” feature comes with some limitations:

    • It is not available on all browsers. In non-supporting browsers, the corresponding areas are not fixed on top of the surrounding layout container while scrolling.
    • Certain layout containers suppress the sticky behavior, such as the grid layout. The same happens if the list is placed within the object page.
    • If the focus is set to a sticky area, the list is automatically scrolled to top.

    Sticky title
    Sticky title

    Mode

    The list can have several modes. The respective property (Mode) allows the following selection methods:

    • None
    • SingleSelectMaster (used to pick one item with no additional indicator, as in the master list for a master-detail scenario with the flexible column layout)
    • SingleSelectLeft (used to pick one item using a radio button on the far left)
    • MultiSelect (used to pick several items from the list using checkboxes on the far left). The Shift key can be used to select a range.
    • Delete (used to delete items from the list using a delete indicator on the far right)
    Developer Hint
    In multiple selection mode, users can (de)select all items using the shortcut CTRL+A. This only affects items that have already been loaded to the front-end server. All other items are not (de)selected before they are loaded (for example, items added via lazy loading with growingScrollToLoad). This conflicts with the guideline that all items the user can reach by scrolling must be (de)selected.

    To process all items, listen to the selectionChange event and to its flag selectAll. This indicates whether CTRL+A was triggered. As soon as an action is triggered, process the items accordingly. Depending on the number of items, consider processing them in the back end.

    List with explicit single selection
    List with explicit single selection
    List with multiple selection
    List with multiple selection
    List with delete mode
    List with delete mode

    Grouping

    List items can be grouped. The group header is a visually separate line at the top of the items it groups. It does not currently provide an interaction of its own.

    Grouped list
    Grouped list

    Line Item Level

    Type

    The list item type defines the interaction of the list item, which is accompanied by a visual cue.

    The items can be one of the following:

    • Active (click event; cursor changes to indicate that)
    • Inactive (no click event; cursor does not change)
    • Navigation (a small arrow appears on the far right, indicating that clicking would navigate)
    • Detail (a pencil appears on the far right, indicating that something can be changed. The user can only click the pencil.)
    • Detail and active (same as “detail”, but the item itself is also clickable)

    The example shows how all these types are visualized.

    All list item types: inactive, detail, navigation, active, detail and active
    All list item types: inactive, detail, navigation, active, detail and active

    Indicate Navigated Item

    When multi-selection is used in a master-detail scenario, it is not clear which item was last opened (for example, which item is currently shown in the second column of a flexible column layout). In this case only (multi-selection list with navigable items), you can display a “navigated” indicator to mark the item that is currently open (sap.m.ListItemBase, property: navigated).

    Navigated item
    Navigated item

    Swipe

    You can provide a swipe feature (sap.m.List, properties: swipeDirection, swipeContent) for approving or deleting items quickly without having to look at the details. Swiping is possible in both directions (left to right / right to left). You can provide different actions for each direction. Because swiping is only available on touch devices, only offer it as an additional feature. Swiping should never be the only way to perform the action.

    List with swipe action
    List with swipe action

    Context Menu

    The context menu can be triggered for the list or per item.

    It gives users an alternative way of modifying the focused elements by giving access to context-specific functions.

    Context menus are opened by right-clicking (desktop), long press (mobile), the context menu key, or SHIFT+F10.

    Be aware that using the context menu overrides the browser context menu, which can no longer be opened.

    List - context menu
    List - context menu

    Drag and Drop

    One or several items can be repositioned within a list or moved to other UI elements using drag and drop operations (sap.m.ListBase, aggregation: dragDropConfig). While being dragged, the items are shown as ghost elements on the mouse cursor.

    Drop targets can be on items, between items, or both (sap.ui.core.dnd.DropPosition). On a drop target, the mouse cursor changes to either a “copy”, “link”, “move”, or “none” cursor. “None” indicates that the dragged item cannot be dropped in the current position (sap.ui.core.dnd.DropEffect).

    Drag and drop is only available on supporting browsers.

    Drag and drop
    Drag and drop
    Whole item as drop target
    Whole item as drop target

    Styles

    The list items can have a header when they are used in a content area. It is also technically possible to change the background of the header and of the list itself. Depending on the use case, the lines between the list items and around the list can be shown or hidden.

    The property Show Separators (All, Inner, None) allows only the outer lines (Inner) or all the lines (None) to be hidden when the list is used as a more structural element within a content area.

    List without separators
    List without separators

    Guidelines

    Text Length

    When you use the list in the first column of the flexible column layout, keep the texts as short as possible and only as long as necessary. If you expect large numbers, use formatting instead.

    Design for Performance

    To optimize performance, we recommend showing no more than 200 items at once in the list. For larger datasets (up to 1,000 items), use the “growing” mechanism to limit the number of displayed items, and make sure that users can filter the data.

    Warning
    The limits above are only recommendations. For a specific app context, the number of manageable items might be far higher or lower.

    The actual limits depend on your concrete scenario, including:

    • The number of rows in the table
    • The number of displayed columns
    • The complexity of the cell content (for example, simple text vs. complex charts)
    • Other elements on the page (for example, multiple pages in a flexible column layout, or several tables/elements with more complex rendering on one page)
    • The browser being used

    Custom List Items

    If none of the list items provided suits the requirements of your app, you can also create a custom list. If you choose this option, ensure that your custom list item is responsive when resized.

    When creating custom list items, take the following guidelines into account, as needed:

    Radio Button

    Only use radio buttons if they are absolutely necessary. One example would be if you want to distinguish single selection from navigation. This is a rare case in which visible radio buttons for single selection are allowed.

    Actions

    To trigger actions on single items, show the actions on a toolbar above the list. Do not offer actions on multiple items if the list is expected to have fewer than 10 items in most cases.

    The following actions on single items must always be inline:

    • Delete: Use “Delete” mode (sap.m.Tree / sap.m.ListBase, property: mode, value: sap.m.ListMode.Delete). This places a Delete  button at the end of each item.
    • Navigation: Use the “Navigation” item type (sap.m.StandardTreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Navigation). This places a navigation indicator at the end of the corresponding items. Use this to navigate to a new page containing item details.
    • Edit: Use the “Detail” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Detail). This places an Edit   icon at the end of the corresponding items.

    You can combine delete and edit actions, or delete and navigation actions. However, edit and navigation actions cannot be combined.

    To trigger actions that are independent of the selection, show the actions on a toolbar above the list. For example: AddCollapse AllExpand All, … .

    To trigger a default action on the entire item, use the “Active” or “DetailAndActive” item type (sap.m.TreeItem / sap.m.ListItemBase, property: type, value: sap.m.ListType.Active). When clicked, active items trigger an event that can be handled by the app (for example, to open a dialog). Selection of items and expanding/collapsing a node do not trigger the event, and are handled by the tree. Do not use the active item type for navigation, to switch the line item to an edit state, or to delete the item.

    Active can be combined with edit and delete, but not with navigation. Do not combine active with the single selection master.

    Add Items

    For adding items, place an Add or Create text button on the table toolbar.

    • Use Create if the button adds a brand new item that doesn’t yet exist on the database.
    • Use Add if the item already exists and is merely added or assigned to the current object.

    Show new items as the first item of the table, with a visual highlight at the beginning of the row.

    For more information, see the guidelines for managing objects (including subarticles).

    Enabling/Disabling Actions

    To indicate if an action can be applied to the current selection:

    • Enable the action if it always works, regardless of whether or not items are selected.
    • Enable the action if it can be applied to all selected items.
    • Enable the action if it can be applied to some of the selected items. If the action is triggered, show a message that informs the user how many items will be affected. Let users choose whether to apply the action anyway or cancel the action.
    • Only disable the action if it can be applied to none of the selected items.

    For more details, see UI Element – States.

    If the action was applied and the items are still available, keep them selected.

    Message for action which applies to a part of a selection
    Message for action which applies to a part of a selection

    Context Menu

    Use the context menu only to give users a quick way of accessing functions that are already available elsewhere (for example, as buttons in the toolbar).

    Don’t just offer actions in the context menu itself, as users might not realize that these actions are available at all.

    Drag and Drop

    Drag and drop is “invisible” on the UI: users can’t see where dragging is available and where it isn’t. In addition, it is not accessible, since there is no generic keyboard interaction. Drag and drop is also not available on all browsers. For these reasons, provide it only in addition to existing (and visible) UI elements that fulfill the same purpose. For example, offer (toolbar) buttons for moving or for copying and pasting items.

    Use drag and drop only in addition to existing visible UI elements
    Use drag and drop only in addition to existing visible UI elements

    If you offer drag and drop for rearranging items within the list, use drop targets that are between items (sap.ui.core.dnd.DropPosition.Between). This provides better feedback on where the item will be inserted. Show the “move” mouse cursor (sap.ui.core.dnd.DropEffect.Move).

    Drop targets in between items
    Drop targets in between items

    Do not combine rearranging items and sorting. If you really need to do so, make sure that there is a dedicated sort criterion for the user-defined sort order, and only offer options for rearranging items if this sort order is set.

    When combining rearranging items with grouping, be aware that moving items to another group also means that a value of the dropped item changes: because grouping is based on values, the dropped item needs to take on the corresponding value of the target group. If this is not wanted, do not allow users to rearrange items in grouped lists.

     

    Example:

    A list is grouped by availability. An item is moved from the group “Not Available” to the group “In Stock”. In this case, the moved item needs to change its availability to “In Stock” to match the target group. If changing the value doesn’t make sense, only allow users to rearrange the items within the same group, or don’t allow rearranging at all.

    Don't
    Do not combine rearranging items with grouping, unless you know exactly what you're doing
    Do not combine rearranging items with grouping, unless you know exactly what you're doing

    Export to Spreadsheet

    Apps can provide a menu button for exporting list data to a spreadsheet (for example, on the relevant toolbar). For the export, use the export to spreadsheet function.

    'Export to Spreadsheet' menu button
    'Export to Spreadsheet' menu button

    Resources

    Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

    Elements and Controls

    Implementation