cancel
Showing results for 
Search instead for 
Did you mean: 

Default values for parameter in ABAP CDS view

Former Member
0 Kudos

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é

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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.

Answers (1)

Answers (1)

joachimrees1
Active Contributor
0 Kudos

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