Skip to Content

How to build OData Navigation from CDS Associations ?

Dear Community Member,

I'm interested in a documentation, where building the navigation in SEGW between OData entities is based on CDS Entity associations using SADL is described.

We're on level 740 sp9.

I've defined tree very basic CDS views views to test the capabilities of the system, before starting implementation of a productive application.The main entity is Person, and are associated with dependent entities Phone and Address

@AbapCatalog.sqlViewName: 'ZCDS_PERSON'
@EndUserText.label: 'Persons'
define view Zperson as select from zbc_person as person
association [1..*] to Zaddress as address
on address.person_id = $projection.id
association [1..*] to Zphone as phone
on phone.person_id = $projection.id
{
    key person.id as id,
    person.name_first,
    person.name_last,
    person.name_nick
}



@AbapCatalog.sqlViewName: 'ZCDS_PHONE'
@EndUserText.label: 'Phone Number'
define view Zphone as select from zbc_phone as phone {
    key phone.person_id,
    key phone.type,
    phone.tel_number,
    phone.tel_extens,
    phone.fax_number,
    phone.fax_extens,
    phone.skype_id
}



@AbapCatalog.sqlViewName: 'ZCDS_ADDRESS'
@EndUserText.label: 'Address'
define view Zaddress as select from zbc_address as address {
    key address.person_id,
    key address.type,
    address.country,
    address.city1,
    address.street,
    address.house_num1,
    address.floor,
    address.roomnumber           
}


I created the OData entities and did the mapping successfully importing the CDS Views.

Unfortuanetly I cannot see the association defined in the CDS view to add as navigation in the OData Property - Business Entity mapping editor.

Assumed it should be listed in the right pane displaying my CDS entity ZPERSON.

Maybe the definition of the CDS views are not fine, or there is no support for this in SEGW transaction ?
There are demo examples in the system, where the business entities are implemented with classes implementing interfaces, which realize associations, and can be dragged and dropped as navigation from right pane to the middle pane.

I can define the association and navigation manually of course, but I want to let the system to do it. This is why I need help on this.

Thank you in advance

SEGW.PNG (75.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    May 13, 2015 at 08:50 AM

    Hi Attila,

    looks very good, just a little piece is missing, which also happend to me already several times:

    Please add the declared definition to the projection list like the other attributes, so that is available outside of the CDS View. Then you will be able to see it in the SADL Mapping Editor in the SEGW.

    1. @AbapCatalog.sqlViewName: 'ZCDS_PERSON'
    2. @EndUserText.label: 'Persons'
    3. define view Zperson as select from zbc_person as person
    4. association [1..*] to Zaddress as address
    5. on address.person_id = $projection.id
    6. association [1..*] to Zphone as phone
    7. on phone.person_id = $projection.id
    8. {
    9. key person.id as id,
    10. person.name_first,
    11. person.name_last,
    12. person.name_nick ,
    13. address,
    14. phone
    15. }

    Best regards,

    Marcel

    Add comment
    10|10000 characters needed characters exceeded