Hello everyone,
In this ABAP for HANA tutorial, you will learn How to create ABAP CDS Views with parameters in ABAP for HANA. Input parameters are used to restrict the data from CDS Views. Please click here to access all tutorials related to ABAP CDS Views. Lets get started.
Prerequisites
- You have access to minimum ABAP Netweaver 7.4 system.
- You have installed Eclipse IDE( Kepler/Juno version ) on your local machine.Click here to know more about.
- You have installed ABAP Development Tools in Eclipse IDE.
- You have created ABAP Project in eclipse to connect to ABAP Netweaver 7.4 system.Click here to know how to create ABAP Project.
- You have basic understanding of ABAP CDS Views.
Step-by-Step Procedure
1. Choose the package in which you want to create ABAP CDS Views. Right-click on the package → New → Other ABAP Repository Object.Image may be NSFW.
Clik here to view.
2. In the New ABAP Repository Object window, search for DDL source object by typing in search field.Select the DDL Source and hit Next.
Image may be NSFW.
Clik here to view.
3. In the New DDL Source window, enter Name and Description of the CDS View and hit Finish.
4. A new ABAP CDS view editor opens up like below and paste the below code.
@AbapCatalog.sqlViewName: 'Z_CDS_PARAMS' @AbapCatalog.compiler.compareFilter: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'CDS View with Parameters' define view Z_Cds_With_Params with parameters p_billing_status :SNWD_SO_CF_STATUS_CODE, p_delivery_status :SNWD_SO_OR_STATUS_CODE as select from snwd_so join snwd_so_i on snwd_so.node_key = snwd_so_i.parent_key{ snwd_so.so_id as orderno, snwd_so_i.so_item_pos as itemno, snwd_so_i.currency_code as currency, snwd_so_i.gross_amount as grossamount, snwd_so_i.net_amount as netamount, snwd_so_i.tax_amount as taxamount } where snwd_so.billing_status = :p_billing_status and snwd_so.delivery_status = $parameters.p_delivery_status;
5.
The post How to create ABAP CDS Views with Parameters appeared first on SAP Fiori,SAP HANA,SAPUI5,SAP Netweaver Gateway Tutorials,Interview Questions|SAP Learners.