关于abap:ABAP两分钟搞定一个基于cds的odata服务

118次阅读

共计 607 个字符,预计需要花费 2 分钟才能阅读完成。

第一步撸一个 cds

@AbapCatalog.sqlViewName: 'ZSFLIGHTVIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'FLIGHT CDS VIEW'
@VDM.viewType: #BASIC
@OData.publish: true
define view ZFLIGHT_VIEW
  as select from sflight
{
  key sflight.carrid    as Airlinecode,
  key sflight.connid    as ConnectionNumber,
  key sflight.fldate    as FlightDate,
      sflight.price     as Airfare,
      sflight.currency  as FareCurrency,
      sflight.planetype as PlaneCategory,
      sflight.seatsmax  as MaxAvailableSeats,
      sflight.seatsocc  as OccupiedSeats
}

接下来去造服务。







记得加本人公司的服务器地址和端口号
sap/opu/odata/sap/ZFLIGHT_VIEW_CDS/ZFLIGHT_VIEW

显示成果

正文完
 0