<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Issue in Association using CDS in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125408#M4530833</link>
    <description>&lt;P&gt;Reference Data Source projects are supported as of SAP NW 7.50.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/saphelp_nw751abap/7.51.0/de-DE/82/0b24ce35c745bb9e0fb3a6e8d6dbd4/frameset.htm" target="test_blank"&gt;https://help.sap.com/doc/saphelp_nw751abap/7.51.0/de-DE/82/0b24ce35c745bb9e0fb3a6e8d6dbd4/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But CDS views require at least NW 740 SP05 &lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 17:05:07 GMT</pubDate>
    <dc:creator>Andre_Fischer</dc:creator>
    <dc:date>2019-12-04T17:05:07Z</dc:date>
    <item>
      <title>Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaq-p/12125401</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;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 &lt;EM&gt;sap:creatable&lt;/EM&gt;. &lt;BR /&gt;I have tried to replicate a similar operation through Flight Tables. &lt;EM&gt;I'm on 7.50, SP- 0011.&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;My &lt;STRONG&gt;&lt;EM&gt;CDS views are shown below at the code section&lt;/EM&gt;&lt;/STRONG&gt;. &lt;/P&gt;
  &lt;P&gt;Note - The CDS views are providing correct records when I'm following the association path through ADT. &lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;I created the gateway service by mapping the CDS as reference data source. &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751842-gw-service.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Now I created a FIORI element application of type ListReport using the Gateway service built. &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;The application descriptor file considered the dependent entity - zcds_booking_details and navigation has been identified correctly. &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751843-manifest.png" /&gt;&lt;STRONG&gt;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. &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751848-dependent-set.png" /&gt;&lt;BR /&gt;&lt;BR /&gt;The error in Gateway was - &lt;STRONG&gt;Unknown entity 'ZSRV_FLIGHT_BOOKING~zcds_booking_details' type 'SADL'&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751850-backend-monitor.png" /&gt;&lt;BR /&gt;&lt;BR /&gt;The application Log shows 3 consecutive messages. &lt;STRONG&gt;Out of that 2 are interesting &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751852-applog1.png" /&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1751853-applog2.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Upon Debugging the framework I got a point where a method init_transaction() is failing and CX_SADL_CONTRACT_VIOLATION is being raised. &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;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? &lt;/STRONG&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;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
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 10:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaq-p/12125401</guid>
      <dc:creator>sas3</dc:creator>
      <dc:date>2019-12-02T10:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125402#M4530827</link>
      <description>&lt;P&gt;I would try to make the field &lt;STRONG&gt;bookid&lt;/STRONG&gt; a key field in your CDS view  &lt;STRONG&gt;ZCDS_BOOKING_DETAILS&lt;/STRONG&gt; as well.&lt;/P&gt;&lt;P&gt;Because otherwise the association _sbook isn't a 1 to many but a 1 to 1 association.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;association [0..*] to zcds_booking_details as _sbook on $projection.carrid = _sbook.carrid and 
                                                        $projection.connid = _sbook.connid and 
                                                        $projection.fldate = _sbook.fldate&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:50:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125402#M4530827</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2019-12-02T13:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125403#M4530828</link>
      <description>&lt;P&gt;Hi Andre,&lt;/P&gt;&lt;P&gt;Changed the ZCDS_BOOKING_DETAILS and made bookid as key field but no luck!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 17:59:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125403#M4530828</guid>
      <dc:creator>sas3</dc:creator>
      <dc:date>2019-12-02T17:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125404#M4530829</link>
      <description>&lt;P&gt;Have you tried whether the navigation works in the data preview in ADT?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125404#M4530829</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2019-12-02T18:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125405#M4530830</link>
      <description>&lt;P&gt;Yes. Association works perfectly in ADT.&lt;BR /&gt;ZCDS_FLIGHT_DETAILS view&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1755448-baseview.png" /&gt;&lt;BR /&gt;&lt;BR /&gt;Association result when clicked on the last entry with flight date 2018-06-0&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1755449-association.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 19:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125405#M4530830</guid>
      <dc:creator>sas3</dc:creator>
      <dc:date>2019-12-02T19:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125406#M4530831</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Can you share the definition of zv_flight_basic ?&lt;/P&gt;&lt;P&gt;I tried the following URL in my SEGW project&lt;/P&gt;&lt;P&gt;/sap/opu/odata/SAP/ZTESTRDS_INNER_SRV/zcds_flight_details(carrid='AA',connid='0017',fldate=datetime'2019-06-20T00%3A00%3A00')/to_sbook&lt;/P&gt;&lt;P&gt;And it delivers the following&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1754477-cusersd041615onedrive-sap-sedocumentsscn-qaassocia.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;I used the following DDL source code for &lt;STRONG&gt;zcds_flight_details&lt;/STRONG&gt; that in my case reads directly from table &lt;STRONG&gt;SFLIGHT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;DEL&gt;&lt;/DEL&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@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]
        
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125406#M4530831</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2019-12-03T09:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125407#M4530832</link>
      <description>&lt;P&gt;Hi Andre,&lt;/P&gt;&lt;P&gt;For some reason my gateway construct was not working properly. I created a new GW project and that worked perfectly. &lt;/P&gt;&lt;P&gt;Thanks a ton for all the support! &lt;BR /&gt;P.S - What is the minimum version requirement to execute this feature? &lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 15:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125407#M4530832</guid>
      <dc:creator>sas3</dc:creator>
      <dc:date>2019-12-04T15:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Association using CDS</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125408#M4530833</link>
      <description>&lt;P&gt;Reference Data Source projects are supported as of SAP NW 7.50.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/saphelp_nw751abap/7.51.0/de-DE/82/0b24ce35c745bb9e0fb3a6e8d6dbd4/frameset.htm" target="test_blank"&gt;https://help.sap.com/doc/saphelp_nw751abap/7.51.0/de-DE/82/0b24ce35c745bb9e0fb3a6e8d6dbd4/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But CDS views require at least NW 740 SP05 &lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 17:05:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-in-association-using-cds/qaa-p/12125408#M4530833</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2019-12-04T17:05:07Z</dc:date>
    </item>
  </channel>
</rss>

