C_SDDocumentPartnerCard

DDL: C_SDDOCUMENTPARTNERCARD SQL: CSDDOCPARTCARD Type: view CONSUMPTION

Business Partner for Fact Sheets

C_SDDocumentPartnerCard is a Consumption CDS View that provides data about "Business Partner for Fact Sheets" in SAP S/4HANA. It reads from 1 data source (I_SDDocumentCompletePartners) and exposes 15 fields with key fields SDDocument, SDDocumentItem, PartnerFunction. It has 4 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_SDDocumentCompletePartners SDPartner from

Associations (4)

CardinalityTargetAliasCondition
[1] I_WorkAssignment _WorkAssignment $projection.Personnel = _WorkAssignment.WorkAssignment
[0..1] I_AddrCurDfltLandlinePhoneNmbr _CurrentDfltLandlinePhoneNmbr $projection.AddressID = _CurrentDfltLandlinePhoneNmbr.AddressID and $projection.AddressPersonID = _CurrentDfltLandlinePhoneNmbr.AddressPersonID
[0..1] I_AddrCurDefaultEmailAddress _CurrentDfltEmailAddress $projection.AddressID = _CurrentDfltEmailAddress.AddressID and $projection.AddressPersonID = _CurrentDfltEmailAddress.AddressPersonID
[0..1] I_AddrCurDfltMobilePhoneNumber _CurrentDfltMobilePhoneNumber $projection.AddressID = _CurrentDfltMobilePhoneNumber.AddressID and $projection.AddressPersonID = _CurrentDfltMobilePhoneNumber.AddressPersonID

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName CSDDOCPARTCARD view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Business Partner for Fact Sheets view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY SDDocument I_SDDocumentCompletePartners SDDocument
KEY SDDocumentItem I_SDDocumentCompletePartners SDDocumentItem
KEY PartnerFunction
PartnerFunctionName
Customer I_SDDocumentCompletePartners Customer
Personnel I_SDDocumentCompletePartners Personnel
ContactPerson I_SDDocumentCompletePartners ContactPerson
AddressID I_SDDocumentCompletePartners AddressID
AddressPersonID I_SDDocumentCompletePartners AddressPersonID
AddressObjectType I_SDDocumentCompletePartners AddressObjectType
SDDocPartnerAddressRefType I_SDDocumentCompletePartners SDDocPartnerAddressRefType
AddresseeFullNameendasFullName
EmailAddressendasEmailAddress
_PartnerFunction I_SDDocumentCompletePartners _PartnerFunction
FormattedPostalAddressDesc
@AbapCatalog.sqlViewName: 'CSDDOCPARTCARD'
@ClientHandling.algorithm:#SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED

@EndUserText.label: 'Business Partner for Fact Sheets'

@ObjectModel: {
   semanticKey: ['SDDocument','SDDocumentItem'],
   usageType.dataClass: #TRANSACTIONAL,
   usageType.serviceQuality: #C,
   usageType.sizeCategory: #L
}

define view C_SDDocumentPartnerCard

  as select from I_SDDocumentCompletePartners as SDPartner
  
  association [1]    to I_WorkAssignment               as _WorkAssignment               on $projection.Personnel        = _WorkAssignment.WorkAssignment
  
  association [0..1] to I_AddrCurDfltLandlinePhoneNmbr as _CurrentDfltLandlinePhoneNmbr on  $projection.AddressID       = _CurrentDfltLandlinePhoneNmbr.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltLandlinePhoneNmbr.AddressPersonID 

  association [0..1] to I_AddrCurDefaultEmailAddress   as _CurrentDfltEmailAddress      on  $projection.AddressID       = _CurrentDfltEmailAddress.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltEmailAddress.AddressPersonID

  association [0..1] to I_AddrCurDfltMobilePhoneNumber as _CurrentDfltMobilePhoneNumber on  $projection.AddressID       = _CurrentDfltMobilePhoneNumber.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltMobilePhoneNumber.AddressPersonID
  

{

      @UI.hidden: true
      @ObjectModel: { readOnly: true }
  key SDPartner.SDDocument,

      @UI.hidden: true
      @ObjectModel: { readOnly: true }
  key SDPartner.SDDocumentItem,
        
  key cast(SDPartner.PartnerFunction as parvw_unv preserving type )           as PartnerFunction,

      @Semantics:   { organization.role: true }
      SDPartner._PartnerFunction._Text[1: Language = $session.system_language].PartnerFunctionName,

      @Semantics.contact.type: #ORGANIZATION
      case
        when SDPartner.Customer != ''
            then SDPartner.Customer
        when SDPartner.Supplier != ''
            then SDPartner.Supplier
        when SDPartner.Personnel != '00000000'
            then cast(SDPartner.Personnel as kunnr)
        when SDPartner.ContactPerson != '0000000000'
            then cast(SDPartner.ContactPerson as kunnr)
        else
            ''
        end as BusinessPartner,

      @UI.hidden: true
      SDPartner.Customer,
      @UI.hidden: true
      SDPartner.Personnel,
      @UI.hidden: true
      SDPartner.ContactPerson,
      @UI.hidden: true
      SDPartner.AddressID,
      @UI.hidden: true
      SDPartner.AddressPersonID,
      @UI.hidden: true
      SDPartner.AddressObjectType,
      @UI.hidden: true
      SDPartner.SDDocPartnerAddressRefType,
      
      @Semantics.name.fullName: true
      @Semantics.text: true
      case
        when SDPartner.ContactPerson != '0000000000'
          then 
          coalesce(SDPartner._DfltAddrRprstn.AddresseeFullName, cast(substring(replace(concat(_ContactPerson.FirstName, concat(' &@', _ContactPerson.LastName)), '&@', ''),1,80) as ad_namtext ) )
        when SDPartner.Personnel != '00000000'
         then 
          coalesce(SDPartner._DfltAddrRprstn.AddresseeFullName, coalesce(_WorkAssignment.PersonFullName, _WorkAssignment._BusinessPartner.LastName))
        else 
          SDPartner._DfltAddrRprstn.AddresseeFullName
        end
      as FullName,

      @Semantics.telephone.type: [#WORK]
      @ObjectModel.text.element: ['FormattedPostalAddressDesc']
      case AddressID
         when ''
            then _WorkAssignment._WorkplaceAddress.NormalizedPhoneNumber
         else _CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber
      end   as InternationalPhoneNumber,

      @Semantics.telephone.type: [#CELL]
      case AddressID
         when ''
            then _WorkAssignment._WorkplaceAddress.MblNormalizedPhoneNumber
         else _CurrentDfltMobilePhoneNumber.InternationalPhoneNumber
      end   as InternationalMobilePhoneNumber,

      @Semantics.eMail.address: true
      @Semantics.eMail.type:  [#WORK]
      case AddressID
         when ''
            then _WorkAssignment._WorkplaceAddress.DefaultEmailAddress
         else _CurrentDfltEmailAddress.EmailAddress
      end   as EmailAddress,

      SDPartner._PartnerFunction,
      
      @Semantics.address.label: true
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_S4H_SDOC_ODATA_UTIL'
      cast ( '' as ad_line_s ) as  FormattedPostalAddressDesc
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRCURDEFAULTEMAILADDRESS",
"I_ADDRCURDFLTLANDLINEPHONENMBR",
"I_ADDRCURDFLTMOBILEPHONENUMBER",
"I_ADDRESS_2",
"I_BUSINESSPARTNER",
"I_CONTACTPERSON",
"I_PARTNERFUNCTION",
"I_PARTNERFUNCTIONTEXT",
"I_SDDOCUMENTCOMPLETEPARTNERS",
"I_WORKASSIGNMENT",
"I_WORKPLACEADDRESS"
],
"ASSOCIATED":
[
"I_ADDRCURDEFAULTEMAILADDRESS",
"I_ADDRCURDFLTLANDLINEPHONENMBR",
"I_ADDRCURDFLTMOBILEPHONENUMBER",
"I_PARTNERFUNCTION",
"I_WORKASSIGNMENT"
],
"BASE":
[
"I_SDDOCUMENTCOMPLETEPARTNERS"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/