I_SalesContractPartner

DDL: I_SALESCONTRACTPARTNER Type: view COMPOSITE

Sales Contract Partner

I_SalesContractPartner is a Composite CDS View that provides data about "Sales Contract Partner" in SAP S/4HANA. It reads from 1 data source (P_SalesContractPartner) and exposes 29 fields with key fields SalesContract, PartnerFunction, SDDocPartnerSequenceNumber. It has 10 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_SalesContractPartner SDPartner from

Associations (10)

CardinalityTargetAliasCondition
[0..1] I_PersonWorkplaceAddress _PersonWorkplaceAddress $projection.AddressID = _PersonWorkplaceAddress.AddressID and $projection.AddressPersonID = _PersonWorkplaceAddress.AddressPersonID and $projection.AddressObjectType = '3' and _PersonWorkplaceAddress.AddressRepresentationCode is initial
[1] I_WorkAssignment _WorkAssignment $projection.Personnel = _WorkAssignment.WorkAssignment
[0..1] I_OrganizationAddress _OrganizationAddress $projection.AddressID = _OrganizationAddress.AddressID and $projection.AddressPersonID = _OrganizationAddress.AddressPersonID and $projection.AddressObjectType = '1' and _OrganizationAddress.AddressRepresentationCode is initial
[0..1] I_PersonAddress _PersonAddress $projection.AddressID = _PersonAddress.AddressID and $projection.AddressPersonID = _PersonAddress.AddressPersonID and $projection.AddressObjectType = '2' and _PersonAddress.AddressRepresentationCode is initial
[0..1] I_AddrOrgNamePostalAddress _OrgNamePostalAddress $projection.AddressID = _OrgNamePostalAddress.AddressID and _OrgNamePostalAddress.AddressRepresentationCode is initial
[0..1] I_AddressPersonName _PersonName $projection.AddressPersonID = _PersonName.AddressPersonID and _PersonName.AddressRepresentationCode is initial
[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
[0..1] I_AddrCurDefaultFaxNumber _CurrentDfltFaxNumber $projection.AddressID = _CurrentDfltFaxNumber.AddressID and $projection.AddressPersonID = _CurrentDfltFaxNumber.AddressPersonID

Annotations (11)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Sales Contract Partner view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
AccessControl.authorizationCheck #MANDATORY view
AbapCatalog.sqlViewName ISCONTRPART view
AbapCatalog.compiler.compareFilter true view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
Metadata.ignorePropagatedAnnotations true view

Fields (29)

KeyFieldSource TableSource FieldDescription
KEY SalesContract P_SalesContractPartner SalesContract
KEY PartnerFunction P_SalesContractPartner PartnerFunction
KEY SDDocPartnerSequenceNumber P_SalesContractPartner SDDocPartnerSequenceNumber
Partner P_SalesContractPartner Partner
Customer P_SalesContractPartner Customer
Supplier P_SalesContractPartner Supplier
Personnel P_SalesContractPartner Personnel
ContactPerson P_SalesContractPartner ContactPerson
AddressID P_SalesContractPartner AddressID
AddressPersonID P_SalesContractPartner AddressPersonID
AddressObjectType P_SalesContractPartner AddressObjectType
SDDocPartnerAddressRefType P_SalesContractPartner SDDocPartnerAddressRefType
BPAddrDeterminationTransaction P_SalesContractPartner BPAddrDeterminationTransaction
BPRefAddressIDForDocSpcfcAddr P_SalesContractPartner BPRefAddressIDForDocSpcfcAddr
SDDocPartnerAddrIsDocSpecific P_SalesContractPartner SDDocPartnerAddrIsDocSpecific
ReferenceBusinessPartner P_SalesContractPartner ReferenceBusinessPartner
VATRegistration P_SalesContractPartner VATRegistration
UnloadingPointName UnloadingPointName
FormOfAddressasFormOfAddress
_PartnerFunction _PartnerFunction
_Address _Address
_SalesContract _SalesContract
_ContactPerson _ContactPerson
_DfltAddrRprstn _DfltAddrRprstn
_BusinessPartnerAddress _BusinessPartnerAddress
_OrganizationAddress _OrganizationAddress
_PersonAddress _PersonAddress
_PersonWorkplaceAddress _PersonWorkplaceAddress
_OrgNamePostalAddress _OrgNamePostalAddress
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Sales Contract Partner'

@VDM: {
  viewType: #COMPOSITE,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}

@AccessControl: {
  authorizationCheck: #MANDATORY,
  personalData.blocking: #('TRANSACTIONAL_DATA'),
  privilegedAssociations: [ '_DfltAddrRprstn','_PersonAddress','_PersonWorkplaceAddress','_OrgNamePostalAddress','_OrganizationAddress']
}

@AbapCatalog: {
  sqlViewName: 'ISCONTRPART',
  compiler.compareFilter: true
}
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #XL
   },
   supportedCapabilities: [ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET ]
}
@Metadata.ignorePropagatedAnnotations: true
define view I_SalesContractPartner
  as select from P_SalesContractPartner as SDPartner

  association [0..1] to I_PersonWorkplaceAddress       as _PersonWorkplaceAddress       on  $projection.AddressID                             = _PersonWorkplaceAddress.AddressID
                                                                                        and $projection.AddressPersonID                       = _PersonWorkplaceAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType                     = '3'
                                                                                        and _PersonWorkplaceAddress.AddressRepresentationCode is initial

  association [1]    to I_WorkAssignment               as _WorkAssignment               on  $projection.Personnel = _WorkAssignment.WorkAssignment


  association [0..1] to I_OrganizationAddress          as _OrganizationAddress          on  $projection.AddressID                          = _OrganizationAddress.AddressID
                                                                                        and $projection.AddressPersonID                    = _OrganizationAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType                  = '1'
                                                                                        and _OrganizationAddress.AddressRepresentationCode is initial
  association [0..1] to I_PersonAddress                as _PersonAddress                on  $projection.AddressID                    = _PersonAddress.AddressID
                                                                                        and $projection.AddressPersonID              = _PersonAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType            = '2'
                                                                                        and _PersonAddress.AddressRepresentationCode is initial

  association [0..1] to I_AddrOrgNamePostalAddress     as _OrgNamePostalAddress         on  $projection.AddressID                           = _OrgNamePostalAddress.AddressID
                                                                                        and _OrgNamePostalAddress.AddressRepresentationCode is initial

  association [0..1] to I_AddressPersonName            as _PersonName                   on  $projection.AddressPersonID           = _PersonName.AddressPersonID
                                                                                        and _PersonName.AddressRepresentationCode is initial

  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

  association [0..1] to I_AddrCurDefaultFaxNumber      as _CurrentDfltFaxNumber         on  $projection.AddressID       = _CurrentDfltFaxNumber.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltFaxNumber.AddressPersonID
{

  key SDPartner.SalesContract,

  key SDPartner.PartnerFunction,

  key SDPartner.SDDocPartnerSequenceNumber,

      @ObjectModel.text.element: ['FullName']
      SDPartner.Partner,
      @Semantics: {
      text: true,
      name.fullName: true
      }
      cast(
      case SDPartner.AddressID
      when ''
      then
       case
         when SDPartner.Personnel != '00000000'
          then coalesce(_WorkAssignment.PersonFullName,
                        _WorkAssignment._BusinessPartner.LastName)
       end
      else
      case
       when SDPartner.AddressObjectType = '1'
         then
           case
             when SDPartner.ContactPerson != '0000000000'
               then
                 cast(substring(replace(concat(SDPartner._ContactPerson.FirstName,
                                        concat(' &@', SDPartner._ContactPerson.LastName) ), '&@', '') ,1,80) as ad_namtext )
              when SDPartner.Personnel != '00000000'
                then _OrganizationAddress.AddresseeName1  //Document specific personnel

             else
               cast(concat_with_space(_OrganizationAddress.AddresseeName1,
                                      _OrganizationAddress.AddresseeName2, 1) as ad_namtext )
            end
       when SDPartner.AddressObjectType = '2'
         then _PersonAddress.PersonFullName
       when SDPartner.AddressObjectType = '3'
         then _PersonWorkplaceAddress.PersonFullName
      end
      end as ad_namtext )                                     as FullName,

      SDPartner.Customer,
      SDPartner.Supplier,
      SDPartner.Personnel,
      SDPartner.ContactPerson,
      SDPartner.AddressID,
      SDPartner.AddressPersonID,
      SDPartner.AddressObjectType,
      SDPartner.SDDocPartnerAddressRefType,
      SDPartner.BPAddrDeterminationTransaction,
      SDPartner.BPRefAddressIDForDocSpcfcAddr,
      SDPartner.SDDocPartnerAddrIsDocSpecific,
      SDPartner.ReferenceBusinessPartner,
      SDPartner.VATRegistration,
      @Semantics.text: true
      UnloadingPointName,

      coalesce(_PersonName.FormOfAddress,
               _OrgNamePostalAddress.FormOfAddress )          as FormOfAddress,

      coalesce(_PersonName.CorrespondenceLanguage,
               _OrgNamePostalAddress.CorrespondenceLanguage ) as CorrespondenceLanguage,

      /* Communication Related Data */
      cast(
        coalesce( _CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber,
                  _WorkAssignment._WorkplaceAddress.NormalizedPhoneNumber )
         as ad_telnrlg preserving type )                      as InternationalPhoneNumber,

      cast(
        coalesce( _CurrentDfltMobilePhoneNumber.InternationalPhoneNumber,
                  _WorkAssignment._WorkplaceAddress.MblNormalizedPhoneNumber )
         as ad_telnrlg preserving type )                      as InternationalMobilePhoneNumber,

      cast(
        coalesce( _CurrentDfltFaxNumber.InternationalFaxNumber,
                  _WorkAssignment._WorkplaceAddress.InternationalFaxNumber )
         as ad_fxnrlng preserving type )                      as InternationalFaxNumber,

      cast(
        coalesce( _CurrentDfltEmailAddress.EmailAddress,
                  _WorkAssignment._WorkplaceAddress.DefaultEmailAddress )
        as vdm_sd_ad_smtpadr preserving type )                as EmailAddress,

      _PartnerFunction,
      _Address,
      _SalesContract,
      //_WorkAgreement,

      _ContactPerson,
      _DfltAddrRprstn,
      _BusinessPartnerAddress,
      _OrganizationAddress,
      _PersonAddress,
      _PersonWorkplaceAddress,
      _OrgNamePostalAddress


}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRCURDEFAULTEMAILADDRESS",
"I_ADDRCURDEFAULTFAXNUMBER",
"I_ADDRCURDFLTLANDLINEPHONENMBR",
"I_ADDRCURDFLTMOBILEPHONENUMBER",
"I_ADDRESSPERSONNAME",
"I_ADDRORGNAMEPOSTALADDRESS",
"I_BUSINESSPARTNER",
"I_CONTACTPERSON",
"I_ORGANIZATIONADDRESS",
"I_PERSONADDRESS",
"I_PERSONWORKPLACEADDRESS",
"I_WORKASSIGNMENT",
"I_WORKPLACEADDRESS",
"P_SALESCONTRACTPARTNER"
],
"ASSOCIATED":
[
"I_ADDRCURDEFAULTEMAILADDRESS",
"I_ADDRCURDEFAULTFAXNUMBER",
"I_ADDRCURDFLTLANDLINEPHONENMBR",
"I_ADDRCURDFLTMOBILEPHONENUMBER",
"I_ADDRESS",
"I_ADDRESSPERSONNAME",
"I_ADDRESS_2",
"I_ADDRORGNAMEPOSTALADDRESS",
"I_BUSPARTADDRESS",
"I_CONTACTPERSON",
"I_ORGANIZATIONADDRESS",
"I_PARTNERFUNCTION",
"I_PERSONADDRESS",
"I_PERSONWORKPLACEADDRESS",
"I_SALESCONTRACT",
"I_WORKASSIGNMENT"
],
"BASE":
[
"P_SALESCONTRACTPARTNER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/