You can associate a field with a helper control in SAP Fiori elements for OData V4.
Fields can have an associated value help, or a dropdown list for several fixed values. They can also include a date or date-time picker. This topic provides information about the supported types of associations and how applications can enable them.
Value help allows users to either select a value from a value help entity associated with the field or define a condition to retrieve a suitable value from the main entity.

For more information, see Value Help.
A dropdown list must be used for fields with fixed values.

For more information, see Value Help as a Dropdown List.
For fields of type Edm.Date, a date picker is rendered when the field is used outside a filter context. When used within a filter context, the field help depends on the filter restrictions for the field. The field help can be a date picker, value help, or dynamic semantic date options. For more information, see Enabling Semantic Operators in the Filter Bar.
XML Annotation
<EntityType Name="SalesOrderManage"> <Property Name="SalesOrderDate" Type="Edm.Date"/> </EntityType>
ABAP CDS Annotation
No ABAP CDS annotation sample is available. The correct metadata is generated when the
DATSdata type is used in the CDS view or database table.
CAP CDS Annotation
entity SalesOrderManage { SalesOrderDate : Date; }
For fields of type Edm.DateTimeOffset, a date/time picker is rendered when the field is used outside a filter context. Within a filter context, the field help depends on the filter restrictions defined for the field. It can be a date/time picker, a value help, or a list of dynamic semantic date options.
XML Annotation
<EntityType Name="SalesOrderManage"> <Property Name="LastChangedDateTime" Type="Edm.DateTimeOffset"/> </EntityType>
ABAP CDS Annotation
No ABAP CDS annotation sample is available. The correct metadata is generated when the
TIMESTAMPdata type is used in the CDS view or database table.
CAP CDS Annotation
entity SalesOrderManage { SalesOrderDate : DateTime; }

When a user selects a date or time using the picker, the DateTimeOffset field is converted and displayed in the UI's timezone, as determined by SAPUI5. The following screenshot shows an input field without a specified or default timezone:

You can specify a timezone for a field of type Edm.DateTimeOffset. If the timezone is defined using an annotation, it is displayed in both the input field (edit mode) and the text field (in display mode). The following settings are supported:
-
Use a fixed value for the
Timezoneannotation in the@Commonvocabulary, following the IANA (Internet Assigned Numbers Authority) standard format:XML Annotation
<EntityType Name="SalesOrderManage"> ... <Property Name="testTimeFixed" Type="Edm.DateTimeOffset"/> ... </EntityType> <Annotations Target="com.c_salesordermanage_sd.SalesOrderManagerManage/testTimeFixed"> <Annotation Term="Common.Timezone" String="Asia/Riyadh"/> <Annotation Term="Common.Label" String="Timestamp with fixed timezone"/> </Annotations>CAP CDS Annotation
entity SalesOrderManage { … testTimeFixed : DateTime @Common : { Timezone : 'Asia/Riyadh' }; … -
Base the
Timezoneannotation on the value of another property:XML Annotation
<Annotations Target="com.c_salesordermanage_sd.SalesOrderManage/testTime"> <Annotation Term="Common.Timezone" Path="testTimezone"/> <Annotation Term="Common.Label" String="Datetime Stamp with Timezone based on Property"/> </Annotations> <Annotations Target="com.c_salesordermanage_sd.SalesOrderManager/testTimezone"> <Annotation Term="Common.Label" String="Timezone Property"/> </Annotations>ABAP CDS Annotation
@Semantics.timeZoneReference: 'MySAPTimezone' MyDateTime, @Semantics.timeZone MySAPTimezone,CAP CDS Annotation
entity SalesOrderManage { testTime : DateTime @Common : { Timezone : testTimezone }; }
The following screenshot shows an input field where a timezone has been specified:

Fields can display the history of recently entered values, which is especially helpful when users frequently select the same entries from a long list. When this feature is enabled, the field saves the values previously entered by the user. Upon focusing on the field, a list of recently entered values is shown. When the user starts typing, the list is filtered based on their input. If there are no previously entered values, the list is not displayed, even if the feature is enabled.
To enable the history of recently entered values, use the INPUTFIELD_HISTORY parameter in SAP Fiori launchpad.
History of recently entered values is not supported for field help based on fixed values.
Fields with value help provide type-ahead suggestions based on user's input. These suggestions are fetched from the back end using the $search parameter included in the client request.
You can control which columns appear in the type-ahead list using the UI.Importance annotation property. The type-ahead list displays only those columns annotated as High. If the annotation isn't defined, the type-ahead list shows the same columns as configured in the value help dialog. For more information about UI.Importance, see the Annotations section in Value Help.
Type-ahead functionality is not available if the value help entity is configured as non-searchable. For more information, see Enabling the Search Function.
