SAP BTP (Business Technology Platform) ABAP Environment is an all-inclusive ABAP platform that is cloud ready.
@AbapCatalog.sqlViewName:'ZVTESTFLIGHT'
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck:#CHECK
@EndUserText.label:'CDS View for flight booking'
defineview ztest_flight_cds
asselectfrom sbook as Booking
association[0..1]to I_Country as _Country on$projection.country = _Country.Country
{
key carrid as FlightID,
key connid as ConnectionID,
key fldate as Flight_date,
key bookid as Booking,
passname as CustomerName,
_Country.Country,
order_date as DateOfBooking,
fldate as DateOfTravel,
forcuram,
forcurkey as CurrencyCode,
_Country // Make association public
}
@AbapCatalog.sqlViewName: 'ZVTESTFLIGHT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View for flight booking'
@Search.searchable : true
@UI:
{
headerInfo:
{
typeName: 'Booking',
typeNamePlural: 'Bookings',
title: { type: #STANDARD, value: 'Booking' }
}
}
define view ztest_flight_cds
as select from sbook as Booking
association [0..1] to I_Country as _Country on $projection.country = _Country.Country
{
@UI.facet: [
{
id: 'Booking',
purpose: #STANDARD,
type: #IDENTIFICATION_REFERENCE,
label: 'Booking',
position: 10 }
]
@UI: {
lineItem: [ { position: 10, importance: #HIGH, label: 'Flight ID' } ],
identification:[ { position: 10, label: 'Flight ID' } ]
}
key carrid as FlightID,
@UI: {
lineItem: [ { position: 20, importance: #HIGH, label: 'Connection ID' } ],
identification:[ { position: 20, label: 'Connection ID' } ]
}
key connid as ConnectionID,
@UI: {
lineItem: [ { position: 30, importance: #HIGH, label: 'Fl.Date' } ],
identification:[ { position: 30, label: 'Fl.Date' } ]
}
key fldate as Flight_date,
@UI: {
lineItem: [ { position: 40, importance: #HIGH, label: 'Booking ID' } ],
identification:[ { position: 40, label: 'Booking ID' } ]
}
key bookid as Booking,
@UI: {
lineItem: [ { position: 50, label: 'Customer', importance: #HIGH } ],
identification:[ { position: 50, label: 'Customer' } ]
}
@Search.defaultSearchElement: true
passname as CustomerName,
@UI: {
identification:[ { position: 60, label: 'Country' } ]
}
_Country.Country,
@UI: {
identification:[ { position: 60, label: 'Booked On' } ]
}
order_date as DateOfBooking,
@UI: { identification:[ { position: 70, label: 'Traveling on' } ] }
fldate as DateOfTravel,
@UI: {
lineItem: [ { position: 80, label: 'Cost', importance: #HIGH } ],
identification:[ { position: 80, label: 'Cost' } ]
}
@Semantics.amount.currencyCode: 'CurrencyCode'
forcuram,
@UI: { identification:[ { position: 90, label: 'Currency' } ] }
@Semantics.currencyCode: true
forcurkey as CurrencyCode,
_Country // Make association public
}
a. Right-click the Data Definition name and select ‘New Service Definition’.
b. No TR is required since this is a local object as well.
@EndUserText.label:'Service defnition for Flight CDS'
defineservice Ztest_flight_srvd {
expose ztest_flight_cds;
expose I_Country;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 |