I_PurgDocumentPartnerEnh is a Composite CDS View that provides data about "Purchasing Document Partner Enhanced" in SAP S/4HANA. It reads from 1 data source (I_PurchasingDocumentPartner) and exposes 27 fields with key fields PurchasingDocument, PurchasingDocumentItem, PurchasingOrganization, SupplierSubrange, Plant. It has 3 associations to related views.
@AbapCatalog.sqlViewName: 'IPURGDOCPARTNENH'
@ClientHandling.algorithm: #SESSION_VARIABLE@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #PRIVILEGED_ONLY@AccessControl.personalData.blocking: #NOT_REQUIRED// only to be referenced by objects that implement blocking
@VDM.viewType : #COMPOSITE@EndUserText.label: 'Purchasing Document Partner Enhanced'
@ObjectModel.usageType.dataClass: #MIXED@ObjectModel.usageType.serviceQuality: #C@ObjectModel.usageType.sizeCategory: #L//@ObjectModel.representativeKey: 'PartnerCounter'
defineview I_PurgDocumentPartnerEnh
asselectfrom I_PurchasingDocumentPartner
association [0..1] to I_SuplrContactCard as _SupplierContactCard on _SupplierContactCard.ContactCardID = $projection.Supplier
association [0..1] to P_ContactCardSupplierContact as _ContactCardSupplierContact on _ContactCardSupplierContact.ContactCardSemanticObjectType = 'SupplierContact'
and _ContactCardSupplierContact.ContactCardSemanticObjectID = $projection.SupplierContact
and _ContactCardSupplierContact.ContactCardType = 'SupplierContact'
association [0..*] to I_PartnerTypeText as _PartnerTypeText on _PartnerTypeText.PurchasingDocumentPartnerType = $projection.PurchasingDocumentPartnerType
//association [0..1] to I_PurgDocumentPartnerVH as _PurgDocumentPartnerVH on _PurgDocumentPartnerVH.PurchasingDocumentPartner = $projection.PurchasingDocumentPartner
// and _PurgDocumentPartnerVH.PurchasingDocumentPartnerType = $projection.PurchasingDocumentPartnerType
//
//association [0..*] to I_PurContractPartnerFunctionVH as _PurContrPartnerFunctionVH on _PurContrPartnerFunctionVH.PartnerFunction = $projection.PartnerFunction
// and _PurContrPartnerFunctionVH.PurchasingDocumentType = $projection.PurchasingDocumentType
{
@ObjectModel.foreignKey.association: '_PurchasingDocument'
key I_PurchasingDocumentPartner.PurchasingDocument,
@ObjectModel.foreignKey.association: '_PurchasingDocumentItem'
key I_PurchasingDocumentPartner.PurchasingDocumentItem, // Used in a single customer scenario but notin standard shipment, in standard 00000
@ObjectModel.foreignKey.association: '_PurchasingOrganization'
key I_PurchasingDocumentPartner.PurchasingOrganization, // attribute only, copied from PurchasingDocument
key I_PurchasingDocumentPartner.SupplierSubrange, // empty
@ObjectModel.foreignKey.association: '_Plant'
key I_PurchasingDocumentPartner.Plant, // empty
@ObjectModel: { foreignKey.association: '_PartnerFunction',
text.association: '_PartnerFunctionText' }key I_PurchasingDocumentPartner.PartnerFunction, // must match a SUPPORTED entry in I_PartnerFunction
key I_PurchasingDocumentPartner.PartnerCounter, // ensures uniqueness of records
@Consumption.hidden: true// transient
I_PurchasingDocumentPartner.PurchasingDocumentCategory,
@Consumption.hidden: true// transient
I_PurchasingDocumentPartner.PurchasingDocumentType,
@Semantics.user.createdBy: true
I_PurchasingDocumentPartner.CreatedByUser,
I_PurchasingDocumentPartner.CreationDate,
@ObjectModel.text.association: '_PartnerTypeText'
PurchasingDocumentPartnerType, // transient
@ObjectModel.foreignKey.association: '_Supplier'
I_PurchasingDocumentPartner.Supplier,
// ekpa.hityp as VendorHierarchy, // todo: Retail
I_PurchasingDocumentPartner.SupplierContact,
@ObjectModel.foreignKey.association: '_PersonWorkAgreement'
I_PurchasingDocumentPartner.PersonWorkAgreement,
//deprecated, replaced by PersonWorkAgreement
I_PurchasingDocumentPartner.EmploymentInternalID,
I_PurchasingDocumentPartner.DefaultPartner, // default for a particular partner function, checkbox on partner tab in ME21N
// ekpa.prfre as PricingRelevantIndicator, // todo: Retail
// ekpa.bolre as SettlementAccountingIndicator, // todo: Retail
// ekpa.histunr as HierarchyLevel, // todo: Retail
@ObjectModel.text.element: [ 'PurchasingDocumentPartnerName' ]cast( case PurchasingDocumentPartnerType
when 'LI' then Supplier
when 'AP' then SupplierContact
when 'PE' then PersonWorkAgreement
endas mm_pur_partner ) as PurchasingDocumentPartner,
cast( case PurchasingDocumentPartnerType
when 'LI' then _SupplierContactCard.FullName
when 'AP' then _ContactCardSupplierContact.FullName
when 'PE' then _PersonWorkAgreement.PersonFullName
endas mm_pur_partnername ) as PurchasingDocumentPartnerName,
_PurchasingDocument,
_PurchasingDocumentItem,
_PurchasingOrganization,
_Plant,
_PartnerFunction,
_PartnerFunctionText,
_PartnerTypeText,
_Supplier,
_SupplierContact,
_PersonWorkAgreement
// _PurgDocumentPartnerVH,
// _PurContrPartnerFunctionVH
}