首页 > SAP > HANA > How to create ABAP CDS Views on HANA-验证成功
2019
08-27

How to create ABAP CDS Views on HANA-验证成功

此为最简单的在HANA STUDIO上创建ABAP CDS的例子,只说明简单创建过程序,前提是已安装好了HANA STUDIO ,并创建了ABAP的工程项目,连接到了你SAP ABAP系统,如你还没有成功到这个步骤,请先查看,

1.HANA STUDIO 连接ABAP 开发 

2.HANA STUDIO如何创建ABAP CDS 

Hello everyone in this ABAP on HANA tutorial you will learn how to create ABAP CDS Views on HANA. The abbreviation for CDS is Core Data Services. To know about ABAP CDS click here.

1.Prerequisites

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 access to ABAP Netweaver 7.4 on HANA.
You have created ABAP Project in eclipse to connect to ABAP Netweaver 7.4 system.Click here to know how to create ABAP Project.

2.操作步骤

1. Choose the package in which you want to create CDS Views. Right-click on the package → New → Other ABAP Repository Object.

How to create ABAP CDS Views on HANA-验证成功 - 第1张  | 优通SAP
 

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.

How to create ABAP CDS Views on HANA-验证成功 - 第2张  | 优通SAP

3. In the New DDL Source window, enter Name and Description of the CDS View and hit Finish.

How to create ABAP CDS Views on HANA-验证成功 - 第3张  | 优通SAP

4. A new CDS view editor opens up like below.

How to create ABAP CDS Views on HANA-验证成功 - 第4张  | 优通SAP

5. Here we are going to retrieve the data from the table SNWD_PD using ABAP CDS View.Look at the DDL source we need to replace few values

Replace data_source_name with table name “SNWD_PD” from which you want to get the data.
Provide new value for @AbapCatalog.sqlViewName as “ZV_DEMO_01” .

6. Now the DDL source looks like below.

How to create ABAP CDS Views on HANA-验证成功 - 第5张  | 优通SAP

7. Lets look at the syntax for the CDS View.

Syntax

In the first part of the syntax we declare annotations.Annotation “@AbapCatalog.sqlViewName” is mandatory when creating CDS views, by which it creates a View in the Data Dictionary.

cds_entity – is the name of the view.
name_list – list of field names displayed in the output when we run the CDS view.
parameter_list – list of input parameters to the CDS view.
select_statement – is the select statement to be provided from table.

Full syntax documentation is available

How to create ABAP CDS Views on HANA-验证成功 - 第6张  | 优通SAP

10. Now a new ABAP DDL Source object will created and available under ABAP DDL Sources folder and also new dictionary view will be created along with it under Views folder.

How to create ABAP CDS Views on HANA-验证成功 - 第7张  | 优通SAP

11. Right click on the newly created DDL source object and choose Open Data Preview to view the data.

How to create ABAP CDS Views on HANA-验证成功 - 第8张  | 优通SAP

12. You will see the output like below with data retrieving from the CDS view.

How to create ABAP CDS Views on HANA-验证成功 - 第9张  | 优通SAP

You have successfully created a ABAP CDS View.In our next tutorial we will know how to use these ABAP CDS view in ABAP programs/reports and also will have deep dive into full features of ABAP CDS views.

Please stay tuned to us for more ABAP on HANA and ABAP in Eclipse tutorials.Please feel free to comment and let us know your feedback. You feedback will keep us alive.

Thank you.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519

留下一个回复

你的email不会被公开。