on 03-15-2024 11:36 AM
Hello Gurus,
I have a RAP-based Fiori app. On the Object Page a I have a table with a "Quantity" field.
I want to display a full text description of the UoM next to the quantity value.
I can display the UoM abbreviation, but not the full text (code below).
Would be grateful for any hints/advice to help me solve my issue.
Thank You!
Basic View
define view Z_I_Items
as select from database_table
association [0..1] to I_UnitOfMeasure as _QuantityUnitOfMeasure on $projection.QuantityUnit = _QuantityUnitOfMeasure.UnitOfMeasure
{
@Semantics.quantity.unitOfMeasure: 'QuantityUnit'
order_qty as Quantity,
@ObjectModel.foreignKey.association: '_QuantityUnitOfMeasure'
@Semantics.unitOfMeasure: true
process_qty_unit as QuantityUnit,
/* Associations */
_QuantityUnitOfMeasure
}
Transactional View
define view entity Z_I_ItemsTP
as select from Z_I_Items as _Item
{
@Semantics.quantity.unitOfMeasure: 'QuantityUnit'
_Item.Quantity,
@ObjectModel.foreignKey.association: '_QuantityUnitOfMeasure'
_Item.QuantityUnit,
/* Associations */
_Item._QuantityUnitOfMeasure,
}
Consumption View
define view entity Z_C_Items
as projection on Z_I_ItemsTP
{
@Semantics.quantity.unitOfMeasure: 'QuantityUnit'
Quantity,
@ObjectModel.text.element: ['UnitOfMeasureName']
QuantityUnit,
@Semantics.text: true
_QuantityUnitOfMeasure._Text.UnitOfMeasureName : localized
}
Metadata Extension
annotate view Z_C_Items with
{
@UI: { lineItem: [{ position: 50, label: 'Quantity' }] }
@Consumption.semanticObject: 'QuantityUnit'
Quantity;
@Consumption.semanticObject: 'UnitOfMeasureName'
@UI.textArrangement: #TEXT_FIRST
QuantityUnit;
@UI.hidden: true
UnitOfMeasureName;
}
Result
I have 1, but want 2 next to the quantity value (in the screenshot).
User | Count |
---|---|
83 | |
11 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.