cancel
Showing results for 
Search instead for 
Did you mean: 

How to annotate an OData Attribute with sap:display-format="Date"

Former Member
0 Kudos

Hello experts,

for a Fiori SmartFilterBar I need an Edm.DateTime attribute to be recognized as a Date field.

Intention: From the annotation the Filterbar recognizes, that a Datepicker needs to be displayed.

I got the idea with the Annotation from here:

The Annotation (display-format) is of course mentioned here:

I do not see any option to set this Annotation for my attribute in transaction segw.

The explanations on the second link confused me quite a bit.

Any hints appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185587
Participant
0 Kudos

Hi Matthias,

Good to know that you have read through the links and got a fair amount of understanding about the annotations that are used in the generated documents.

You are following "Service Generation" methodology in order to generate the required documents; for which you would be using the Gateway Service Builder (Transaction SEGW). Though this tool provided by SAP is quite helpful in reducing the efforts of a developer, it in itself is not a very strong tool to enable the developer to equip with all the options related to the service documents. Only few basic annotations are covered in the tool.

In order to avail all the possible annotations provided by SAP, you need to opt for "Service Development" methodology where the developer relies on extra coding on top of the generated documents or rather develops all the development artefacts from scratch. Open the service document and metadata documents in any XML editors and add the SAP annotations yourself.

Regards,

Kiran

Former Member
0 Kudos

Hello Kiran,

thanks for your explanation.

If I understood you correctly the metadata document should reside somewhere in the MPC Class and be accessible through the Workbench. Could you point out where I can find it?

Best Regards,

Matthias

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Stephan,

you will find the model provider extension class with the post fix _MPC_EXT in the folder of the runtime artifacts that are generated by the service builder.

Here you can enter code to enhance the content of the $metadata document which is generated by the code of the MPC class.

Best Regards,

Andre

Answers (1)

Answers (1)

Former Member
0 Kudos

I have the same problem, can someone give an example implementation please?

kammaje_cis
Active Contributor
0 Kudos

Sure here it is.