2017 Oct 19 5:06 PM - edited 2024 Feb 04 2:36 AM
I'm building a consumption CDS view where I need to set multiple default values for a specific consumption filter:
The current default value works perfectly. My issue is that I need to include a few more values in there, and I can't figure out the correct syntax or method to do so.
For example, I need Movement Type to default to 601 and 901.
What's the correct way to do this?
All the best,
Marcelo
Hi all,
I have used the following code in my consumption view and it worked fine.
In the place of Companycode1,companycode2,companycode3.. use the key values of CompanyCode you want to display.
In the background I have made an association for I_companycode in the cube view and used below annotation for same field.
@objectmodel.foreignkey.association:'_CompanyCode'
Best Regards,
Vaishnavi Devi, N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcelo,
i Currently have the same problem. Did you find a solution?
Best regards,
Hendrik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try to use to build your filter with case/when expression and use the annotations:
...
a.MovementType,
@UI.hidden: true
@Consumption.filter.defaultValue: 'Filter_X'
case(a.MovementType)
when '601' then 'Filter_X'
when '901' then 'Filter_X'
else 'NoFilter'
end as MyMovementFilter
Best regards
Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is there a way to avoid some Values in a property?
For Example,
If I want to avoid John specifically.
$filter=EmployeeName ne 'John'
Is there a way to do this in CDS view or Fiori Elements?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
did anyone find a solution to this problem in the meantime? I found this question in several other questions (unanswered) as well.
There should be a possibility for a default filter on multiple values...
Best,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcelo,
Do you want to have multiple single value for the select-option?
I could not see to define a set of values for
defaultValue
in
select
from vbak {
@Consumption.filter : {
selectionType : #SINGLE,
multipleSelections : true,
defaultValue : '1653000003'
}
vbeln, //several single values are allowed
Perhaps you have already checked, if not have a look at
But there is not an explicitly shown sample for your case
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Eralper,
As you mention the link doesn't provide an example for multiple default values in a filter.
At this point, it doesn't matter if it's multiple single values or a range. As long as I can DEFAULT multiple values in the filter, I'd be able to satisfy my requirements.
Best regards,
Marcelo
User | Count |
---|---|
92 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.