a week ago
I’m developing an SAP Fiori application using the RAP model. In my scenario, I have a CDS entity that provides the data for the Value Help. The screenshot below shows the Value Help window with the data. I would like to specify the sort order for the Value Help, so that when the list is displayed, the line items will be sorted in ascending order based on the first column. Is there a RAP annotation that can be used to define the sorting order?
Request clarification before answering.
Consumption.valueHelpDefinition.presentationVariantQualifier: PUTYOURPRESENTATIONVARIANTHERE
when you annotate the field, you have to mention which presentationvariant to be used
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ivan_kalcha,
In the Metadata Extension of the CDS View Value Help you could try adding the following annotation in the header section:
@ui.presentationVariant:[{ sortOrder: [{ by: '[FieldName]', direction: #ASC }] }]
annotate entity [CDSValueHelpName] with { ... }
In case the field you want to sort is of type CHAR, you can try casting to INT (if this does not work as expected or is not permitted, try casting to NUMC then to INT) as the following:
cast( cast([FieldName] as abap.numc(len)) as abap.int[int_len] ) as [FieldName]
I hope this helps you resolve the issue.
BR,
Elda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cast conversion in the CDS View for Value Help:
cast( cast( cast( domvalue_l as abap.sstring(10) ) as abap.numc(2) ) as abap.int1 ) as Status
Annotation in the Metadata Extension:
@ui:{presentationVariant:[{sortOrder:[{by:'Status',direction:#ASC}]}]
User | Count |
---|---|
85 | |
11 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.