define view entity与define root view entity

@AbapCatalog.viewEnhancementCategory: [#NONE]

@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'Travel Model View Entity - Read Only'

@Metadata.ignorePropagatedAnnotations: true

@Metadata.allowExtensions:true

@Search.searchable:true

@ObjectModel.usageType:{

serviceQuality: #X,

sizeCategory: #S,

dataClass: #MIXED

}

/*define view entity Z_I_TRAVEL_R_72806 as select from /DMO/I_TRAVEL_U as Travel

此处不使用define view entity会在指向该实体的实体出现警告

*/

define root view entity Z_I_TRAVEL_R_72806 as select from /DMO/I_Travel_U as Travel

composition [0..*] of Z_I_BOOKING_72806 as _Booking

association [1..1] to /DMO/I_Agency as _Agency on $projection.AgencyID = _Agency.AgencyID

association [1..1] to /DMO/I_Customer as _Customer on $projection.CustomerID = _Customer.CustomerID

association [0..*] to I_CurrencyText as _CurrencyText on $projection.CurrencyCode = _CurrencyText.Currency

{

key TravelID,

@Consumption.valueHelpDefinition:[{entity:{name:'/DMO/I_Agency',element:'AgencyID'}}]

@ObjectModel.text.association: '_Agency'

AgencyID,

@Consumption.valueHelpDefinition:[{entity:{name:'/DMO/I_Customer',element:'CustomerID'}}]

@ObjectModel.text.association:'_Customer'

CustomerID,

concat_with_space(_Customer.Title,_Customer.LastName,1) as Addressee,

BeginDate,

EndDate,

@Semantics.amount.currencyCode:'CurrencyCode'

BookingFee,

@Semantics.amount.currencyCode:'CurrencyCode'

@DefaultAggregation:#SUM

TotalPrice,

@Semantics.amount.currencyCode:'CurrencyCode'

currency_conversion(

amount => TotalPrice,

source_currency => CurrencyCode,

round => 'X',

target_currency => cast('USD' as abap.cuky( 5 )),

exchange_rate_date => cast('20200429' as abap.dats),

error_handling => 'SET_TO_NULL' )

as TotalPriceInUSD,

@ObjectModel.text.association:'_CurrencyText'

CurrencyCode,

@Search.defaultSearchElement:true

@Search.fuzzinessThreshold:0.90

Memo,

Status,

LastChangedAt,

/* Associations */

_Agency,

_Booking,

_Currency,

_CurrencyText,

_Customer,

_TravelStatus

} /*where $projection.CurrencyCode = 'EUR' */

@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'Consumption view from /DMO/I_BOOKING_U'

define view entity Z_I_BOOKING_72806

as select from /DMO/I_Booking_U as Booking

association to parent Z_I_TRAVEL_R_72806 as _Travel on $projection.TravelID = _Travel.TravelID

{

key TravelID,

key BookingID,

BookingDate,

CustomerID,

AirlineID,

ConnectionID,

FlightDate,

@Semantics.amount.currencyCode: 'Currency_Code'

FlightPrice as Flight_Price,

/* @Semantics.currencyCode: true */

CurrencyCode as Currency_Code,

/* Associations */

_BookSupplement,

_Carrier,

_Connection,

_Customer,

_Travel

// _association_name // Make association public

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值