The text of a label 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 TabelColumn 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 belonging to the standard and Office Integration libraries.
UI Elements with Primary Properties
Library |
UI Element |
Primary Property |
OfficeIntegration |
OfficeControl |
dataSource |
Standard |
AbstractDropdownByIndex |
texts |
AbstractDropdownByKey |
selectedKey |
|
AbstractInputField |
value |
|
AbstractTreeNodeType |
text |
|
CheckBox |
checked |
|
CheckBoxGroup |
texts |
|
FileUpload |
data |
|
FormattedTextView |
text |
|
MenuCheckBox |
checked |
|
MultipleRoadMapStep |
dataSource |
|
MultiPane |
dataSource |
|
RadioButton |
selectedKey |
|
RadioButtonGroupByIndex |
texts |
|
RadioButtonGroupByKey |
selectedKey |
|
Table |
dataSource |
|
TextBar |
text |
|
TextEdit |
value |
|
TextView |
text |
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.
You have a label with a TextView and you do not enter any text.
The property of the 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.