首页 > 其他 > 详细

ABAP CDS ON HANA-(12)ODATA Service

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!