Skip to Content
Author's profile photo Sharmila Gurubelli

 ABAP on HANA – Step by step procedure to create a CDS view using input parameters to display multiple records.

This blog shows how to display multiple records by using input PARAMETERS keyword, As there is no provision to use ABAP keyword SELECT-OPTIONS which display multiple records in CDS View.

1. Go to Dictionary => ABAP DDL Sources => New Data Definition

2. Create a New Data Definition

3. Load the template and click on finish


4. Source Code

5. Output

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Useful.. 

      Author's profile photo Ibrahim Khan
      Ibrahim Khan

      Hi Sharmila,
      We can have ranges parameter using the between operator, but how do we provide multiple values for a input parameter in the same way we do in select options,. please advice.

      Author's profile photo Sharmila Gurubelli
      Sharmila Gurubelli
      Blog Post Author

      Hi Ibrahim,

      In CDS Views (ABAP on HANA) we don't have any functionality like select-options as in ABAB.

      Here we can get the multiple values by using multiple input parameters and assign to where condition.

      define view Zcds_View with  parameters 
                                 p_ebeln1:ebeln,
                                 p_ebeln2:ebeln,
                                 p_ebeln3:ebeln,
                                 p_ebeln4:ebeln,
                                 p_ebeln5:ebeln
      
      as select from ekko
              join ekpo 
              on ekko.ebeln = ekpo.ebeln
      {
        ekko.ebeln as purchasing_docu,
        ekko.bukrs,
        ekko.ernam,
        ekpo.ebelp,
        ekpo.aedat,
        ekpo.meins
      }
      
      where ekpo.ebeln= :p_ebeln1 or 
            ekpo.ebeln= :p_ebeln2 or 
            ekpo.ebeln= :p_ebeln3 or 
            ekpo.ebeln= :p_ebeln4 or 
            ekpo.ebeln= :p_ebeln5;

      Output:

      This may help you 🙂

      Author's profile photo Ibrahim Khan
      Ibrahim Khan

      This is a work around and will not work in real time as we are not sure how much many values the user needs for input