P_SALESCONTRACTPARTNER

CDS View

Sales Contract Partner

P_SALESCONTRACTPARTNER is a CDS View in S/4HANA. Sales Contract Partner. It contains 17 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
I_SalesContractPartner view from COMPOSITE Sales Contract Partner

Fields (17)

KeyField CDS FieldsUsed in Views
KEY PartnerFunction PartnerFunction 1
KEY SalesContract SalesContract 1
KEY SDDocPartnerSequenceNumber SDDocPartnerSequenceNumber 1
AddressID AddressID 1
AddressObjectType AddressObjectType 1
AddressPersonID AddressPersonID 1
BPAddrDeterminationTransaction BPAddrDeterminationTransaction 1
BPRefAddressIDForDocSpcfcAddr BPRefAddressIDForDocSpcfcAddr 1
ContactPerson ContactPerson 1
Customer Customer 1
Partner Partner 1
Personnel Personnel 1
ReferenceBusinessPartner ReferenceBusinessPartner 1
SDDocPartnerAddressRefType SDDocPartnerAddressRefType 1
SDDocPartnerAddrIsDocSpecific SDDocPartnerAddrIsDocSpecific 1
Supplier Supplier 1
VATRegistration VATRegistration 1
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Sales Contract Partner'

@VDM: {
  private: true,
  viewType: #COMPOSITE
}

@AccessControl: {
  authorizationCheck: #PRIVILEGED_ONLY,
  personalData.blocking: #('TRANSACTIONAL_DATA'),
  privilegedAssociations:  [ '_DfltAddrRprstn' ]
}

@AbapCatalog: {
  sqlViewName: 'PSCONTRPART',
  preserveKey:true ,
  compiler.compareFilter: true
}
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #XL
   }
}
define view P_SalesContractPartner
  as select from I_SalesDocumentPartner

  association [1..1] to I_SalesContract as _SalesContract on $projection.SalesContract = _SalesContract.SalesContract
{

  key cast(SalesDocument as sales_contract preserving type) as SalesContract,

  key PartnerFunction,


  key cast( '000000' as cnt_parvw preserving type )         as SDDocPartnerSequenceNumber,

      Partner,
      Customer,
      Supplier,
      Personnel,
      ContactPerson,
      AddressID,
      AddressPersonID,
      AddressObjectType,
      SDDocPartnerAddressRefType,
      BPAddrDeterminationTransaction,
      BPRefAddressIDForDocSpcfcAddr,
      SDDocPartnerAddrIsDocSpecific,
      ReferenceBusinessPartner,
      VATRegistration,
      UnloadingPointName,


      _PartnerFunction,
      _Address,
      _SalesContract,
      _ContactPerson,
      _DfltAddrRprstn,
      _BusinessPartnerAddress


}
where
  SDDocumentCategory = 'G' -- Document Category G is Contract

union all

select from I_SlsContrAddlCompletePartners

association [1..1] to I_SalesContract as _SalesContract on $projection.SalesContract = _SalesContract.SalesContract
association [0..1] to I_ContactPerson as _ContactPerson on $projection.ContactPerson = _ContactPerson.ContactPerson -- Contact Person required for union

{

  key cast(SDDocument as sales_contract preserving type) as SalesContract,

  key PartnerFunction,

  key SDDocPartnerSequenceNumber,

      case
        when Customer != ''
            then Customer
        when Personnel != '00000000'
            then cast(Personnel as kunnr)
        else
            ''
        end                                              as Partner,

      Customer,
      cast('' as lifnr )                                 as Supplier,
      Personnel,
      cast( '0000000000' as parnr )                      as ContactPerson,
      AddressID,
      AddressPersonID,
      AddressObjectType,
      SDDocPartnerAddressRefType,
      BPAddrDeterminationTransaction,
      BPRefAddressIDForDocSpcfcAddr,
      cast( ' ' as sd_pd_doc_spec_addr_flag )            as SDDocPartnerAddrIsDocSpecific,
      ReferenceBusinessPartner,
      cast( ' ' as stceg  )                              as VATRegistration,
      cast( ' ' as ablad )                               as UnloadingPointName,


      _PartnerFunction,
      _Address,
      _SalesContract,
      _ContactPerson,
      _DfltAddrRprstn,
      _BusinessPartnerAddress

}
where
  SDDocumentItem = '000000' -- Only Sales Document Header Partners
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SALESDOCUMENTPARTNER",
"I_SLSCONTRADDLCOMPLETEPARTNERS"
],
"ASSOCIATED":
[
"I_ADDRESS",
"I_ADDRESS_2",
"I_BUSPARTADDRESS",
"I_CONTACTPERSON",
"I_PARTNERFUNCTION",
"I_SALESCONTRACT"
],
"BASE":
[
"I_SALESDOCUMENTPARTNER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/