码迷,mamicode.com
首页 > 其他好文 > 详细

ABAP CDS ON HANA-(12)ODATA Service

时间:2019-03-11 16:12:03      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:efi   author   put   inf   text   rtu   compile   planet   lte   

Create a CDS view and we have the view type as ‘BASIC’ view

技术图片

To publish this as oData, add the annotation as: @OData.publish: true

技术图片


@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Flight View CDS’
@VDM.viewType: #BASIC
@OData.publish: true
define view Zflight_View 
as select from sflight
{ 
key sflight.carrid, 
key sflight.connid, 
key sflight.fldate, 
sflight.price, 
sflight.currency, 
sflight.planetype, 
sflight.seatsmax, 
sflight.seatsocc
}

  


Activate the view. Then a symbol would appear at the line: @OData.publish: true, whihc tells that a service ‘ZFLIGHT_VIEW_CDS’ created and we have to add this service on Tx- /IWFND/MAINT_SERVICE

技术图片


Go to the Tx- /IWFND/MAINT_SERVICE, click on Add Service button

技术图片

Provide the alias name, and the service name and hit enter key.

技术图片

The created service will appear in the list. Select the service and click on Add Selected Service.

技术图片

Select local object and continue.

技术图片

The information appears.

技术图片

In the hana studio, activate the the view and a new symbol appears at the line’@OData.publish: true’ . Put the cursor on the mark

技术图片

Click on the link: OData-Service

技术图片

Here is the service. Now change the url and put ‘$metadata’

技术图片


 

So here the service metadata information appears.

sap/opu/odata/sap/ZFLIGHT_VIEW_CDS/$metadata

技术图片


 

To execute the view and get the details, change the url sap/opu/odata/sap/ZFLIGHT_VIEW_CDS/Zflight_View

It returns all the entries.

技术图片

 

ABAP CDS ON HANA-(12)ODATA Service

标签:efi   author   put   inf   text   rtu   compile   planet   lte   

原文地址:https://www.cnblogs.com/yjyongil/p/10511201.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!