UI5 Controls Part 1: Choosing Control Libraries — sap.m, sap.f, sap.ui.table and sap.ui.mdc
Free sample lesson · open to everyone
Know which UI5 libraries to use for what: sap. m for responsive controls, sap. f for Fiori layouts, sap. ui. table for desktop grids, sap. ui. mdc for metadata-driven controls — and why deprecated libraries should be avoided.
In this lessonShow sectionsHide sections
Visual overview
The situation: a real project scenario
A warehouse app built with sap.ui.table grids was unusable on handheld scanners. Rebuilding the scanning screens with sap.m lists and responsive tables, while keeping a grid table for supervisors on desktops, fixed usability without losing desktop efficiency.
Explanation
This series covers building UIs with the right controls, and Part 1 maps the available control libraries.
sap.m is the main responsive library, and it contains controls that work across phones, tablets and desktops: List, Table (the responsive table), Input, Select, Dialog, Button, MessageStrip and many more. It's the default choice for most controls in freestyle apps.
sap.f contains Fiori-specific layouts instead: DynamicPage with its collapsible header, FlexibleColumnLayout for master-detail-detail patterns, cards and avatars. These give freestyle apps the same structure users already know from Fiori elements apps.
sap.ui.table provides grid, tree and analytical tables that handle many rows and columns efficiently on desktop, using row virtualization and fixed columns. They're less suitable on phones, so they're chosen specifically for desktop-heavy use cases with large datasets.
sap.ui.mdc offers metadata-driven controls that power Fiori elements V4's tables, filter bars and fields. Developers typically use these indirectly, through flexible programming model building blocks such as macros:Table, which bring Fiori elements behavior into custom pages without working with sap.ui.mdc directly.
Some older controls and libraries, such as parts of sap.ui.commons, are deprecated. The UI5 API reference marks deprecated controls, and the UI5 linter can find them automatically. New development should avoid these deprecated controls and libraries altogether, and migration work should replace them gradually — using deprecated libraries or controls blocks upgrades and future UI5 versions.
In practice, this means listing the controls used in one freestyle app and their libraries, finding deprecated controls with the UI5 linter, rebuilding one page with sap.f's DynamicPage, and comparing sap.m's Table against sap.ui.table for a large dataset — ending with the ability to justify the library choice for each control in an app.
How the SAP process fits together
SAP PROCESS EXPLORER · Fiori: from service to user
ERPClimb.comUI5 Controls and Layouts — process breakdown
Topic-specific conceptual flow: how key objects and decisions fit together. SAP configurations and exceptional cases can follow different paths.
Selected process stage
Select
Pick control libraries for the use case
Representative SAP learning flow, not a guarantee of system runtime sequence in every scenario.
Watch out
Common mistakes
Using sap.ui.table grid tables for apps that need to work well on phones or handheld devices. Grid tables are optimized for desktop with fixed columns and row virtualisation, but they don't adapt well to small, touch-first screens — an app built around them for warehouse scanning or field service on a handheld device becomes genuinely hard to use, not just less polished.
Pulling in deprecated libraries or controls (parts of sap.ui.commons, or other controls the API reference flags as deprecated) for new development because an old tutorial or copied snippet used them. Deprecated controls aren't guaranteed to keep working across UI5 versions, so code built on them accumulates upgrade risk from day one, and the fix (migrating off them) is harder the longer they stay in active use.
Building custom page layouts by hand instead of using sap.f's Fiori-specific layouts (DynamicPage, FlexibleColumnLayout). This produces a freestyle app that looks and behaves differently from the standard Fiori structure users are used to, losing the "feels familiar" benefit sap.f exists to provide — and it's extra work to get right that sap.f already solved.
Reimplementing Fiori elements-style table, filter bar, or field behavior from scratch in a custom page instead of using the flexible programming model's building blocks (macros:Table, etc.), which are built on sap.ui.mdc's metadata-driven controls. This means missing out on behaviour (like annotation-driven formatting) that comes for free with the building blocks, while taking on the burden of maintaining an equivalent by hand.
Do this
Best practices
Choose the control library based on device target and data volume per screen, not for the whole app uniformly: sap.m for anything that must work well on phones or tablets, sap.ui.table for desktop-heavy screens with large datasets that benefit from grid virtualisation.
Use sap.f's Fiori-specific layouts (DynamicPage, FlexibleColumnLayout, cards) for freestyle apps that should feel consistent with standard Fiori apps, rather than building equivalent custom layouts by hand.
Run the UI5 linter (or check the API reference) for deprecated controls and libraries before and during development, and avoid introducing new dependencies on anything already marked deprecated — this is far cheaper than migrating off it later once it's embedded throughout an app.
Use flexible programming model building blocks (macros:Table, macros:Field, macros:FilterBar) — built on sap.ui.mdc's metadata-driven controls — when a custom page needs Fiori elements-style behavior, instead of reimplementing table, filter, or field logic manually.
In the interview
Interview angle
A typical interview question: "A warehouse app on handheld scanners feels unusable even though it works fine on a desktop browser — what's likely wrong?" A weak answer looks for a generic performance issue.
A strong answer suspects a control library mismatch first: sap.ui.table's grid/tree/analytical tables are built for desktop (fixed columns, row virtualisation, mouse-oriented interaction) and don't adapt well to small touch screens, whereas sap.m's responsive controls (including the responsive table) are designed to work across phone, tablet and desktop.
The strong answer also knows when NOT to switch everything to sap.m — a supervisor's desktop dashboard reviewing thousands of rows may still be better served by sap.ui.table — so the right answer is choosing the library per screen based on device and data volume, not applying one library everywhere.
Practice this lesson
Original educational case studies for SAP consultants, not official SAP certification exam questions. Verify product edition and implementation details against the current SAP documentation.
Quick check
0 of 3 questions attempted
Question 1 of 3
Which library provides DynamicPage and FlexibleColumnLayout?
Question 2 of 3
Which table suits large datasets with many columns on desktop?
Question 3 of 3
How do developers usually use sap.ui.mdc controls in custom pages?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1How do you choose UI5 controls for a new freestyle app?
Was this lesson helpful?
Keep exploring
More lessons in this topic
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.