Skip to Content
0

Default values for parameter in ABAP CDS view

Dec 06, 2016 at 11:02 AM

1.8k

avatar image

Dear SCN-Community,

currently I´m playing with CDS Views and input parameters.

At view execution the parameter prompt appears without any value help or default value. Is there an option to setup such a LOV or default value that the user knows from BW?

Kind regards

André

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sagar Jadhav Dec 12, 2016 at 09:35 AM
2

Hi Andre,

Value help \ default values won't work here as you are trying to get a data preview of the view that you created in the Eclipse IDE.

Value help or default values works for consumption views that are interpreted either by the Analytical or UI engine.

For example, you can create a CDS-based query on top of the cube that you created and assign the default values there. Something like this.

@Analytics.query: true
@VDM.viewType: #CONSUMPTION

define view ZC_JOrdersQuery
   with parameters
   
   @Consumption.defaultValue: '<date_in_format_yyyymmdd>'
   p_keydate: abap.dats
   
   as select from ZAJ_C_ORDERS
{
   <required_elements>
};
   

You can also default it to the system date using the below annotation.

@Environment.systemField: #SYSTEM_DATE

As for the value help, as these are ABAP CDS views, the value help corresponds to the data element assigned to the parameter.

But again this works for consumption views which are interpreted either by an Analytical or UI engine.

Let Me know if this answers your query.

Thanks,

Sagar J.

Share
10 |10000 characters needed characters left characters exceeded
Joachim Rees Dec 19, 2016 at 08:07 AM
0

Hi André,

I don't have an answer to your question, but the suggestion that you add "ABAP Development" as another secondary tag.

-> This might bring it to the attention of more CDS-experts.

After all, CDS-Views are no S/4HANA exclusives, but a general feature of modern ABAP.

best

Joachim

Share
10 |10000 characters needed characters left characters exceeded