The text of Labels or a TableColumn can be determined from the short text of a data element from the ABAP Dictionary:
If no text is explicitly specified for a Label or a TableColumn the primary property is automatically used to determine the text. For this purpose the primary property of the TableCellEditor is used for the TableColumn and the primary property of the element that the Label refers to is used for the Label. The value for the primary property must be bound by the context attribute to an ABAP Dictionary data element. The short text of this data element belonging to the context attribute is used for the output.
One property is defined as the primary property for each of the following UI elements.
UI Element |
Primary Property |
---|---|
OfficeControl |
dataSource |
AbstractDropdownByIndex |
texts |
AbstractDropdownByKey |
selectedKey |
AbstractInputField |
value |
AbstractLegendItem |
text |
AbstractToggle |
checked |
AbstractTreeNodeType |
text |
CheckBoxGroup |
texts |
FormattedTextEdit |
value |
FormattedTextView |
text |
Image |
source |
MenuCheckBox |
checked |
MenuRadioButton |
selectedKey |
MultipleAccordionItem |
dataSource |
MultiplePhase |
dataSource |
MultipleRoadMapStep |
dataSource |
MultiPane |
dataSource |
NavigationList |
itemSource |
RadioButton |
selectedKey |
RadioButtonGroupByIndex |
texts |
RadioButtonGroupByKey |
selectedKey |
RowRepeater |
dataSource |
SectionHeader |
text |
Table |
dataSource |
TableScrollTipProvider |
dataSource |
TableRowGrouping |
rowData |
TableSingleMarkableCell |
attributeToMark |
TextBar |
text |
TextEdit |
value |
TextView |
text |
ThresholdSlider |
value |
TimedTrigger |
delay |
TriStateCheckBox |
checked |
ViewSwitch |
itemSource |
The value for the primary property is bound to an ABAP Dictionary object.
Table Column
You have a TableColumn with an InputField and you do not enter any text for the Caption.
The property value of the InputField ( value must be bound) is bound to SFLIGHT.CARRID.
The text of the primary property belonging to the TableCellEditor is now automatically used as the text for the Caption. This is the text from the ABAP Dictionary for the CARRID (data element S_CARR_ID), the airline carrier.
Label
You have a Label with a TextView and you do not enter any text.
Property text of TextView is bound to SFLIGHT.CARRID.
Using labelFor you specify what the Label refers to. If you want to use the text from the Label, the text is automatically taken from the ABAP Dictionary for the CARRID.