cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS + OData + Fiori Smart Template; View parameters are not welcome?

Hi all,

I'm currently developing an application using a Smart Template and some CDS Views.

Since I need to perform some calculations (blame COEJ/COSR tables and their column-based periods!), I'm using view parameters and some artistry to get the job done.

So the top of my consumption view looks like this:

Problem is: the parameters are created as a separate Entity Set on the OData Service, which leads the Smart Template to restrict my choice of OData Collection to the parameters' Entity Set, while automatically defining the navigation to the Results Entity Set.

(if I remove the parameters and hardcode them on the select statement, I end up with a fully working List Report with all the data I expect to see)

This means that the Parameters' Entity Set will be used for the List Report (thus showing only the 3 parameters as columns of the Smart Table) and the Results' Entity Set will be used for the Object Page.

What I intended was to have Parameters show on the Smart Filter Bar (and included in the Variant Management control as well); working like filters, so to say.

Are there annotations I'm missing that can act as a workaround? I've seen the @Consumption.derivation ones but don't seem to fully understand them?

Am I asking for more than the Smart Template app can chew? Should I give up on the (very) limited ABAP CDS Views and move to HANA CDS Views for the calculations (plus an .xsodata)?

Thanks in advance,

Nuno

Accepted Solutions (0)

Answers (7)

Answers (7)

Hi Wead,

Unfortunately not. Didn't find a straight through solution, so ended up building an OData service manually. Passed the CDS View parameters as filters and then on the DPC_EXT class of the OData service called the CDS View with using those filters as... parameters. Not pretty, but it worked.

Good luck.

Best regards,

Nuno

VladyslavShchur
Explorer
0 Kudos

Hi Nuno,

Any news on this topic?

I have got the same requirement and looking to come up with an elegant solution... Seems nothing has changed in List Report behavior.

Thanks, Vlad

sdebeaulieu
Participant
0 Kudos

Hi Nuno,

How did you keep all annotations for List Report application when you redefined your OData service in GW?

Thanks!

Former Member

Hi Nuno

Almost the same problem,

Have you got a solution?

Best Regards,

Wead

former_member233040
Discoverer
0 Kudos

Request to follow the steps given in the link:

https://blogs.sap.com/2018/06/11/sap-fiori-list-report-utilizing-parametrized-cds/

It may help to solve the problem.

sdebeaulieu
Participant
0 Kudos

Hi,

Has anyone found a solution?

Cheers,

Severin

sdebeaulieu
Participant
0 Kudos

Hi,

I have the same issue. I'll try with manual OData service, but it's a shame.

Has anyone found a solution?

Cheers,

Sev

Former Member
0 Kudos

Hi Nuno,

I ran into a less complex variant of this same issue, whereas I had a single parameter in my CDS view for the language key used to read several texts. I was able to solve it with the following annotations:

define view {my_view_name}
    with parameters 
        @Environment.systemField : #SYSTEM_LANGUAGE 
        @Consumption.hidden: true
        p_langu:sylangu 

the result was such that when the OData was regenerated (when activating the View), there was no longer a separate Entity Set for the view parameter and the parameter was not visible at all and was set to the user's logon language at runtime.

In your case, I guess perhaps you could add 3 view fields, somehow map them to your 3 parameters via @Consumption.derivation annotations, and use the 3 view fields as filter criteria. I haven't tried this though, so you'll have to play around with it if no-one else has a solution.

Cheers,

Eric

pratheek_kv2
Explorer
0 Kudos

Hello,

I dont know if I quiet get the issue, but you can have a look at the UI annotation SELECTION VARIANT. This might be of help.

This is used to pass Filters from UI for Smart Template App's

Thanks,

Pratheek