Skip to Content

CDS contact details

Hi,

I'm trying in a CDS to link the SAP user id to another CDS defined with semantic contacts annotations.

This is an extract from the main CDS:

define view ZTT_C_TASKS
    as select from ZTT_I_TASKS as task
    association [1] to ZTT_C_PROJECTS                  as _project            on $projection.projectCode = _project.projectCode
    association [0..1] to ZTT_VH_USER                  as _functionalUserInfo on $projection.functionalResponsible = _functionalUserInfo.userName
    association [0..1] to ZTT_VH_USER                  as _technicalUserInfo  on $projection.technicalResponsible = _technicalUserInfo.userName
    association [0..1] to ZTT_I_STATUS                 as _status             on $projection.status      = _status.status
    association [0..1] to ZTT_I_TASK_CRITICALITY       as _criticality        on $projection.endCritically = _criticality.criticality
    association [0..*] to ZTT_C_TASK_COMMENTS          as _comments           on $projection.code        = _comments.taskCode
                                                                             and $projection.projectCode = _comments.projectCode
    association [0..*] to ZTT_C_TASK_TRANSPORT_REQUEST as _transportRequests  on $projection.code        = _transportRequests.taskCode
                                                                             and $projection.projectCode = _transportRequests.projectCode
    association [0..*] to ZTT_C_TASK_TIME_LOG          as _timeLog            on $projection.code        = _timeLog.taskCode
                                                                             and $projection.projectCode = _timeLog.projectCode
{
        ...
        @UI: { fieldGroup: [{ qualifier: 'Responsible', importance: #HIGH, position: 20, label: 'Functional Responsible Contact Details', type: #AS_CONTACT, value: '_functionalUserInfo'}],
               identification: [{ importance: #HIGH, position: 71, label: 'Functional Responsible Contact Details', type: #AS_CONTACT, value: '_functionalUserInfo'}]}
        _functionalUserInfo,
        @UI: { fieldGroup: [{ qualifier: 'Responsible', importance: #MEDIUM, position: 21, label: 'Technical Responsible Contact Details', type: #AS_CONTACT, value: '_technicalUserInfo'}],
               identification: [{ importance: #MEDIUM, position: 81, label: 'Technical Responsible Contact Details', type: #AS_CONTACT, value: '_technicalUserInfo'}]}
        _technicalUserInfo,
        ...
}

And this is the CDS with user details:

@AbapCatalog.sqlViewName: 'ZTTVH_USERS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Value Help: User'

@Search.searchable: true

@ObjectModel: {
    representativeKey: 'userName'
}

define view ZTT_VH_USER
    as select from ZTT_I_USERS {

        @ObjectModel.text.element: ['name']
        @Semantics.contact.type: #PERSON
    key userName,
    
        @Search.defaultSearchElement: true
        @Search.fuzzinessThreshold: 0.8
        @Search.ranking: #HIGH
        @Semantics.name.fullName: true
        @Semantics.text: true
        _userInfo.name_text as name,
        
        @Semantics.name.givenName: true
        _userInfo.name_first as firstName,
        
        @Semantics.name.familyName: true
        _userInfo.name_last as lastName,
        
        @Semantics.name.additionalName: true
        _userInfo.namemiddle as middleName,
        
        @Semantics.eMail.address 
        _emailAddress.smtp_addr as email,

        @Semantics.telephone.type: [#PREF] 
        _businessAddress.tel_number as telephone
    
} where userType = 'A' or userType = 'L' or userType = 'C'

The contact link and card are displayed, but not the user details (email, phone):

Is there anything wrong with the CDS?

I tried in 750 and S/4 1909 with the same result.

Thank you in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 29, 2020 at 11:10 AM

    Resolved, email address annotation should be @Semantics.eMail.type: [#PREF,#WORK] and phone @Semantics.telephone.type: [#PREF,#WORK]

    It seems that a type is necessary (#PREF is not taken into account)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.