on 2025 Mar 20 11:04 AM
Hello SAP Community,
I'm working on a Fiori Elements application with CAP CDS as the backend. I know it's possible to create a dropdown using a separate entity to define the values, and I'm able to do that. Specifically, if I define the entity in my CDS service, I can successfully show the values returned using this annotation:
Common.ValueListWithFixedValues : true,
Common.ValueList : {
$Type : 'Common.ValueListType',
CollectionPath : 'XXXXXXXX',
Parameters : [
{
$Type : 'Common.ValueListParameterInOut',
LocalDataProperty : XXXX,
ValueListProperty : 'XXXX'
}
]
}However, in my case, defining this property as a "DB table" just to store two options (which will always remain the same) feels unnecessary. We don't need any additional information for these options, so using an enum type would be much better.
Specifically, I'd like to use an enum type like this:
type AnswerPossibilities : String enum {
Yes;
No;
}I just want to choose one option (e.g., "Yes" or "No") and store it as a string in my main object (in my basic entity).
Is it possible to create a dropdown in Fiori Elements that uses this enum type directly? If so, how can I implement it? Are there any specific annotations or configurations required?
I'd appreciate any insights, examples, or best practices for handling this scenario. Thanks in advance for your help!
Best regards,
Daniel.
Request clarification before answering.
https://github.com/SAP-samples/fiori-elements-feature-showcase/blob/main/srv/service.cds
I made a simple sample based on sap's demo app.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.