2015 Jul 21 11:26 AM
As far as I can tell (as I cannot find reference to it anywhere), it's not possible to define an optional parameter for a CDS view.
Is that correct? Thanks.
2015 Jul 21 11:42 AM
Hello Malcolm,
no, optional parameters are not possible (at the moment). To each input parameter an actual parameter must be assigned. Please take a look to paragraph "Notes" in online help ABAP Keyword Documentation.
Best Regards,
Florian
As far as I can tell (as I cannot find reference to it anywhere), it's not possible to define an optional parameter for a CDS view.
Is that correct? Thanks.
2015 Jul 21 11:42 AM
Hello Malcolm,
no, optional parameters are not possible (at the moment). To each input parameter an actual parameter must be assigned. Please take a look to paragraph "Notes" in online help ABAP Keyword Documentation.
Best Regards,
Florian
2015 Jul 21 11:49 AM
I just spotted that in the help at the same time as your reply came in! Thanks Florian.
I'm just wondering what the alternative is now. Would it be to put it in the projection list instead and then add it to the WHERE clause of the caller if it's filled and not add it to the WHERE clause when it isn't filled?
2015 Jul 21 12:50 PM
Hi Malcolm,
I'd say, that depends... e.g. if you are using aggregations in the view.
But I'd say it's a good workaround if applicable, so I understand instead of passing a filter value to the view in form of an input parameter, you're adding the (to be filtered) field to the projection list and leave the filtering to the consumer, right?
Question is, how will you consume the view? If it's Open SQL you can of course use a default value (in the Open SQL) or the given filter value in case it's given... same holds for IDA ALV, you can pass the default in the ABAP coding.
Cheers,
Jasmin
2016 Aug 30 1:02 PM
Hi
Is there any way to make parameters optional in abap cds views, say via annotations...?
Any possibility now?
2021 Feb 05 9:18 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |