cancel
Showing results for 
Search instead for 
Did you mean: 

Input parameter in HANA CDS View

gokul_jayaraman2
Explorer
0 Kudos

Hi Friends,

I am trying to create a HANA CDS View in HANA Studio. I am not sure about the syntax to create input parameters.

Can anyone provide an example code for HANA CDS view with input parameters ?

I see there are lot of examples for ABAP CDS but not much documentations and blog about HANA CDS, just want to know if SAP is moving towards ABAP CDS ?

If anyone can provide any links to blogs or documents other than SAP HANA CDS Reference is appreciated.

Thanks,

Gokul

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Like mentioned, this is not (yet?) supported.

You could create a graphical or script based calculation view with a parameter and expose it as an XS OData service.

For this a great example exists on SCN:

Even tho I think the titel was not well chosen...

You could use this calculation view + it's parameter and expose it via an XS OData service like the example below.

// Get last five activity codes (one parameter called 'User' for example), included in file called model.xsodata

  "__.global.models.timeSheet::LastWorkPckgWorkItems" as "GetLastWorkPckgWorkItems"

     key ("TIME_STAMP")

     parameters via key and entity;

Url to consume example:

     <host:port/path to xsodata>/model.xsodata/GetLastWorkPckgWorkItemsParameters(User='ABC')/Results

Another option is to define an ABAP CDS and expose it as an OData service.

I hope this helps.

Jonathan

SergioG_TX
Active Contributor
0 Kudos

Gokul,

CDS has the same base but ABAP and HANA views are different. HANA views are simpler. ABAP views have way more annotations, etc.

here is the HAN CDS reference FYI

http://help.sap.com/hana/SAP_HANA_Core_Data_Services_CDS_Reference_en.pdf

and the XSA reference

CDS Views - Introduction to Application Development and Deployment (XS Advanced Model) - SAP Library

Create a View in CDS - SAP HANA Developer Guide for SAP HANA Studio - SAP Library

pfefferf
Active Contributor
0 Kudos

Hello Gokul,

parameters for HANA CDS Views are not supported up to now.

Best Regards,

Florian