Hi Experts,
I found an interesting read on my recent visit to SAPTechEd which explains creating a transactional FIORI application and using CDS as the data provider. The CDS view created was used as a Data Source and transaction behavior were managed through Gateway methods overriding the MPC_EXT and making specific entity as sap:creatable.
I have tried to replicate a similar operation through Flight Tables. I'm on 7.50, SP- 0011.
My CDS views are shown below at the code section.
Note - The CDS views are providing correct records when I'm following the association path through ADT.
I created the gateway service by mapping the CDS as reference data source.

Now I created a FIORI element application of type ListReport using the Gateway service built.
The application descriptor file considered the dependent entity - zcds_booking_details and navigation has been identified correctly.
The application is up and running when the basic consumption view i.e. ZCDS_FLIGHT_DETAILS is executed. Association of that view, the ZCDS_BOOKING_DETAILS is not being triggered and not fetching results.

The error in Gateway was - Unknown entity 'ZSRV_FLIGHT_BOOKING~zcds_booking_details' type 'SADL'

The application Log shows 3 consecutive messages. Out of that 2 are interesting


Upon Debugging the framework I got a point where a method init_transaction() is failing and CX_SADL_CONTRACT_VIOLATION is being raised.
I still don't know why the Entity not found error is appearing. Additionally I wonder if there is any transaction processing annotation like @ObjectModel is required. The document I was referring(provided in TechEd hands-on session) didn't have anything like that. What is that I'm missing here?
1. ZCDS_FLIGHT_DETAILS is the consumption view for application
@AbapCatalog.sqlViewName: 'zv_flight_info'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS view for Flight Information Display'
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'
define view zcds_flight_details
as select from zv_flight_basic as basic
association [0..*] to zcds_booking_details as _sbook on $projection.carrid = _sbook.carrid and
$projection.connid = _sbook.connid and
$projection.fldate = _sbook.fldate
{
//basic
// key mandt,
@UI.lineItem: [{position: 10 }]
@UI.identification: [{position: 10 }]
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
@Search.ranking: #HIGH
@UI.selectionField: [{ position: 10 }]
key carrid,
@UI.lineItem: [{position: 20 }]
@UI.identification: [{position: 20 }]
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
@Search.ranking: #MEDIUM
@UI.selectionField: [{ position: 20 }]
key connid,
@UI.lineItem: [{position: 30 }]
@UI.identification: [{position: 30 }]
@UI.selectionField: [{ position: 30 }]
key fldate,
@UI.lineItem: [{position: 40 }]
@UI.identification: [{position: 40 }]
price,
@UI.lineItem: [{position: 50 }]
@UI.identification: [{position: 50 }]
currency,
planetype,
@UI.lineItem: [{position: 60,
label: 'Economy Seats Available' }]
@UI.identification: [{position: 60 }]
economy_sa,
@UI.lineItem: [{position: 70,
label: 'Business Seats Available' }]
@UI.identification: [{position: 70 }]
business_sa,
@UI.lineItem: [{position: 80,
label: 'FirstClass Seats Available' }]
@UI.identification: [{position: 80 }]
firstclass_sa,
countryfr,
cityfrom,
airpfrom,
countryto,
cityto,
airpto,
duration,
deptime,
arrtime,
distance,
distid,
fltype,
period,
/* Associations */
// _sflight[inner],
_sbook[inner]
}
2. My Association View - ZCDS_BOOKING_DETAILS
@AbapCatalog.sqlViewName: 'zv_booking_det'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Booking Details CDS'
define view zcds_booking_details
as select from sbook {
//sbook
// key mandt,
@UI.hidden: true
key carrid,
@UI.hidden: true
key connid,
@UI.hidden: true
key fldate,
@UI.lineItem.position: 10
bookid,
@UI.lineItem.position: 20
customid,
@UI.lineItem.position: 30
custtype,
@UI.lineItem.position: 40
smoker,
luggweight,
wunit,
invoice,
class,
forcuram,
forcurkey,
loccuram,
loccurkey,
order_date,
counter,
agencynum,
cancelled,
reserved,
@UI.lineItem.position: 50
passname,
passform,
passbirth
}
Request clarification before answering.
I tried to reproduce your issue, but for me it worked, but I selected data from SFLLIGHT since I did not know the definition of zv_flight_basic.
Can you share the definition of zv_flight_basic ?
I tried the following URL in my SEGW project
/sap/opu/odata/SAP/ZTESTRDS_INNER_SRV/zcds_flight_details(carrid='AA',connid='0017',fldate=datetime'2019-06-20T00%3A00%3A00')/to_sbook
And it delivers the following

I used the following DDL source code for zcds_flight_details that in my case reads directly from table SFLIGHT.
@AbapCatalog.sqlViewName: 'zv_flight_info'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS view for Flight Information Display'
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'
define view zcds_flight_details
as select from sflight as basic
association [0..*] to zcds_booking_details as _sbook on $projection.carrid = _sbook.carrid and
$projection.connid = _sbook.connid and
$projection.fldate = _sbook.fldate
{
//basic
// key mandt,
@UI.lineItem: [{position: 10 }]
@UI.identification: [{position: 10 }]
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
@Search.ranking: #HIGH
@UI.selectionField: [{ position: 10 }]
key carrid,
@UI.lineItem: [{position: 20 }]
@UI.identification: [{position: 20 }]
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
@Search.ranking: #MEDIUM
@UI.selectionField: [{ position: 20 }]
key connid,
@UI.lineItem: [{position: 30 }]
@UI.identification: [{position: 30 }]
@UI.selectionField: [{ position: 30 }]
key fldate,
@UI.lineItem: [{position: 40 }]
@UI.identification: [{position: 40 }]
price,
@UI.lineItem: [{position: 50 }]
@UI.identification: [{position: 50 }]
currency,
planetype,
// @UI.lineItem: [{position: 60,
// label: 'Economy Seats Available' }]
// @UI.identification: [{position: 60 }]
// economy_sa,
//
// @UI.lineItem: [{position: 70,
// label: 'Business Seats Available' }]
// @UI.identification: [{position: 70 }]
// business_sa,
//
// @UI.lineItem: [{position: 80,
// label: 'FirstClass Seats Available' }]
// @UI.identification: [{position: 80 }]
// firstclass_sa,
// countryfr,
// cityfrom,
// airpfrom,
// countryto,
// cityto,
// airpto,
// duration,
// deptime,
// arrtime,
// distance,
// distid,
// fltype,
// period,
/* Associations */
// _sflight[inner],
_sbook[inner]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Reference Data Source projects are supported as of SAP NW 7.50.
In SAP NW 7.40 you can use the so called mapped data source approach. Here you would have to map the entity sets and the associations to CDS views and their associations.
But CDS views require at least NW 740 SP05
Have you tried whether the navigation works in the data preview in ADT?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would try to make the field bookid a key field in your CDS view ZCDS_BOOKING_DETAILS as well.
Because otherwise the association _sbook isn't a 1 to many but a 1 to 1 association.
association [0..*] to zcds_booking_details as _sbook on $projection.carrid = _sbook.carrid and
$projection.connid = _sbook.connid and
$projection.fldate = _sbook.fldate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.