Skip to Content
0
May 12, 2015 at 07:52 AM

How to build OData Navigation from CDS Associations ?

2121 Views

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

Attachments

SEGW.PNG (75.3 kB)