Skip to Content

Input parameter in HANA CDS View

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Aug 10, 2016 at 04:04 PM

    Hello Gokul,

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

    Best Regards,

    Florian

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2016 at 04:05 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2016 at 07:30 PM

    Hi,

    Like @Florian Pfeffer 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: How to Use Input Parameters in HANA Calculation View

    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


    ABAP CDS OData.jpg (64.8 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.