on 2017 Apr 24 2:21 PM
Hi Experts,
I have created sapui5 list report using list report template, i have one field "As on Date" in the selection fields of the report. this fields is showing as Multiinput instead of Datepicker on the screen. I want to show that field in
- There is no annotation coming from backend system.
- filed is type date (Edm.DateTime) in the backend.
- in metdata file i have maintained sap:display-format="Date" property
-Metadata file:
<Property Name="Dmdt" Type="Edm.DateTime" Nullable="false" Precision="7" sap:label="As on date" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:display-format="Date"/>
I want to show field as Datepicker.
Please suggest way forward.
Regards,
Saurabh
Request clarification before answering.
Hi,
As Mark Castle mentioned, you can use filter restrictions. If you want to show a date picker instead of date range selection, use filter-restriction value as Single.
Sample CDS annotation:
Common.FilterExpressionRestrictions: [{ Property: <your Date Field>, AllowedExpressions: #SingleInterval } ]
hope it helps.
Regards,
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(In case anyone stumbles across this in the future)
If this is the type of field you are looking for it can be achieved by adding an additional annotation via a redefinition of the DEFINE Method in the implementing class.
DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
lo_property TYPE REF TO /iwbep/cl_mgw_odata_property,
lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation.
super->define( ).
lo_entity_type = model->get_entity_type( iv_entity_name = 'ZSomeODataServiceType' ).
lo_property ?= lo_entity_type->get_property( iv_property_name = 'SomeDateField' ).
CALL METHOD lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation
EXPORTING
iv_annotation_namespace = /iwbep/if_mgw_med_odata_types=>gc_sap_namespace
RECEIVING
ro_annotation = lo_annotation.
lo_annotation->add( iv_key = 'filter-restriction' iv_value = 'interval' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm with this very same problem. I created both annotations "display-format" and "filter-restriction" to my DateTime field and my smart filter does not change.
Any solutions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Saurabh,
Did you figure it out ?
Thank you mate !
Olivier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
34 | |
22 | |
16 | |
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.