Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Consume Table Function With Parameters From CDS View

Former Member
14,735

I have a table function with parameters (other than just client). When I try to consume the function from a CDS view, it only likes the CLIENT parameter; I can't send the values for the others.

I'm new to using table functions and AMDPs so I'm hoping this is just a beginner's error. I am using Eclipse IDE to edit the code.

5 REPLIES 5
Read only

rajucd81
Participant
9,293

Hi Dianna Short-Hopkins,

You can't use left side table fields in parameters assignment of right side table/view, it should be some constant/pre-defined values in your case like $session.client.

Read only

Former Member
0 Likes
9,293

So how would you consume a table function with parameters?

Read only

0 Likes
9,293

Ideally Table functions will be used in Programs and passed the parameters from selection screen. in CDS views if you want to use it you should have some constants/pre-defined variables to pass to parameters of Table function.

Read only

sakshi_sawhney
Participant
0 Likes
9,293

In Select query pass the parameter like below

objects( client : $session.client.. and so on. )

Read only

0 Likes
9,293

Avoid passing the table function client information during the join in the CDS view. Instead, include it while selecting fields from the table function. For instance, the table function alias is 'object' in your screenshot, and the syntax should be object(clnt: $session.client).Fieldname