abap
Copy
@UI.lineItem: [{position: 10}]
ProductName;
@UI.lineItem: [{position: 30}]
Price;
@UI.lineItem: [{position: 20}]
Status;
Show answerHide answer
Correct answer: B Three columns: ProductName, Status, Price
Explanation
Explanation:The Logic: Ordering by Position SAP Fiori Elements uses the position property within the annotation to determine the visual sequence of elements from left to right (or top to bottom). Even though the code is written with Price (position 30) before Status (position 20), the framework sorts these numerically during metadata interpretation.
10: ProductName (1st Column)
20: Status (2nd Column)
30: Price (3rd Column)
Why it's B and not C:
The framework does not render fields in the order they appear in the DDL (Data Definition Language) source code; it strictly follows the numerical value assigned to position. Therefore, Status (20) will always jump ahead of Price (30).
Why the others are incorrect:
A (Three fields in a form):
Forms are controlled by the @UI.identification or @UI.fieldGroup annotations. @UI.lineItem is specifically for tables/lists.
C (ProductName, Price, Status):
This ignores the numerical logic of the position attribute and assumes the framework follows the line-by-line order of the code.
D (ProductName only):
All three fields have the @UI.lineItem annotation, so all three will be rendered as columns.
Key Takeaway
Whenever you see @UI.lineItem, think Table Columns. Whenever you see position, remember that lower numbers appear first, regardless of where they are written in the ABAP CDS view.