P_SalesContractPartner
Sales Contract Partner
P_SalesContractPartner is a Composite CDS View that provides data about "Sales Contract Partner" in SAP S/4HANA. It reads from 2 data sources (I_SalesDocumentPartner, I_SlsContrAddlCompletePartners) and exposes 45 fields with key fields SalesContract, PartnerFunction, SDDocPartnerSequenceNumber, PartnerFunction, SDDocPartnerSequenceNumber. It has 2 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_SalesDocumentPartner | I_SalesDocumentPartner | from |
| I_SlsContrAddlCompletePartners | I_SlsContrAddlCompletePartners | union_all |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_SalesContract | _SalesContract | $projection.SalesContract = _SalesContract.SalesContract |
| [0..1] | I_ContactPerson | _ContactPerson | $projection.ContactPerson = _ContactPerson.ContactPerson -- Contact Person required for union |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | Sales Contract Partner | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view | |
| AbapCatalog.sqlViewName | PSCONTRPART | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XL | view |
Fields (45)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | SalesContract | |||
| KEY | PartnerFunction | PartnerFunction | ||
| KEY | SDDocPartnerSequenceNumber | |||
| Partner | Partner | |||
| Customer | Customer | |||
| Supplier | Supplier | |||
| Personnel | Personnel | |||
| ContactPerson | ContactPerson | |||
| AddressID | AddressID | |||
| AddressPersonID | AddressPersonID | |||
| AddressObjectType | AddressObjectType | |||
| SDDocPartnerAddressRefType | SDDocPartnerAddressRefType | |||
| BPAddrDeterminationTransaction | BPAddrDeterminationTransaction | |||
| BPRefAddressIDForDocSpcfcAddr | BPRefAddressIDForDocSpcfcAddr | |||
| SDDocPartnerAddrIsDocSpecific | SDDocPartnerAddrIsDocSpecific | |||
| ReferenceBusinessPartner | ReferenceBusinessPartner | |||
| VATRegistration | VATRegistration | |||
| UnloadingPointName | UnloadingPointName | |||
| _PartnerFunction | _PartnerFunction | |||
| _Address | _Address | |||
| _SalesContract | _SalesContract | |||
| _ContactPerson | _ContactPerson | |||
| _DfltAddrRprstn | _DfltAddrRprstn | |||
| KEY | PartnerFunction | PartnerFunction | ||
| KEY | SDDocPartnerSequenceNumber | SDDocPartnerSequenceNumber | ||
| Customer | Customer | |||
| Supplier | ||||
| Personnel | Personnel | |||
| ContactPerson | ||||
| AddressID | AddressID | |||
| AddressPersonID | AddressPersonID | |||
| AddressObjectType | AddressObjectType | |||
| SDDocPartnerAddressRefType | SDDocPartnerAddressRefType | |||
| BPAddrDeterminationTransaction | BPAddrDeterminationTransaction | |||
| BPRefAddressIDForDocSpcfcAddr | BPRefAddressIDForDocSpcfcAddr | |||
| SDDocPartnerAddrIsDocSpecific | ||||
| ReferenceBusinessPartner | ReferenceBusinessPartner | |||
| VATRegistration | ||||
| UnloadingPointName | ||||
| _PartnerFunction | _PartnerFunction | |||
| _Address | _Address | |||
| _SalesContract | _SalesContract | |||
| _ContactPerson | _ContactPerson | |||
| _DfltAddrRprstn | _DfltAddrRprstn | |||
| _BusinessPartnerAddress | _BusinessPartnerAddress |
@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":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA