cancel
Showing results for 
Search instead for 
Did you mean: 

CDS contact details

JaimeRodriguez
Participant

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.

ama_touzani13
Participant
0 Kudos

Hello ,

Is this the full name displayed in the Card ?.

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

JaimeRodriguez
Participant

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)

Answers (0)