I_PurgDocumentPartnerEnh

DDL: I_PURGDOCUMENTPARTNERENH SQL: IPURGDOCPARTNENH Type: view COMPOSITE

Purchasing Document Partner Enhanced

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.

Data Sources (1)

SourceAliasJoin Type
I_PurchasingDocumentPartner I_PurchasingDocumentPartner from

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_SuplrContactCard _SupplierContactCard _SupplierContactCard.ContactCardID = $projection.Supplier
[0..1] P_ContactCardSupplierContact _ContactCardSupplierContact _ContactCardSupplierContact.ContactCardSemanticObjectType = 'SupplierContact' and _ContactCardSupplierContact.ContactCardSemanticObjectID = $projection.SupplierContact and _ContactCardSupplierContact.ContactCardType = 'SupplierContact'
[0..*] I_PartnerTypeText _PartnerTypeText _PartnerTypeText.PurchasingDocumentPartnerType = $projection.PurchasingDocumentPartnerType

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName IPURGDOCPARTNENH view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
EndUserText.label Purchasing Document Partner Enhanced view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument I_PurchasingDocumentPartner PurchasingDocument
KEY PurchasingDocumentItem I_PurchasingDocumentPartner PurchasingDocumentItem
KEY PurchasingOrganization I_PurchasingDocumentPartner PurchasingOrganization
KEY SupplierSubrange I_PurchasingDocumentPartner SupplierSubrange
KEY Plant I_PurchasingDocumentPartner Plant
KEY PartnerFunction I_PurchasingDocumentPartner PartnerFunction
KEY PartnerCounter I_PurchasingDocumentPartner PartnerCounter
PurchasingDocumentCategory I_PurchasingDocumentPartner PurchasingDocumentCategory
PurchasingDocumentType I_PurchasingDocumentPartner PurchasingDocumentType
CreatedByUser I_PurchasingDocumentPartner CreatedByUser
CreationDate I_PurchasingDocumentPartner CreationDate
PurchasingDocumentPartnerType PurchasingDocumentPartnerType
Supplier I_PurchasingDocumentPartner Supplier
SupplierContact I_PurchasingDocumentPartner SupplierContact
PersonWorkAgreement I_PurchasingDocumentPartner PersonWorkAgreement
EmploymentInternalID I_PurchasingDocumentPartner EmploymentInternalID
DefaultPartner I_PurchasingDocumentPartner DefaultPartner
_PurchasingDocument _PurchasingDocument
_PurchasingDocumentItem _PurchasingDocumentItem
_PurchasingOrganization _PurchasingOrganization
_Plant _Plant
_PartnerFunction _PartnerFunction
_PartnerFunctionText _PartnerFunctionText
_PartnerTypeText _PartnerTypeText
_Supplier _Supplier
_SupplierContact _SupplierContact
_PersonWorkAgreement _PersonWorkAgreement
@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'


define view I_PurgDocumentPartnerEnh
  as select from 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 not in 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
      end as mm_pur_partner )     as PurchasingDocumentPartner,

      cast( case PurchasingDocumentPartnerType
        when 'LI' then _SupplierContactCard.FullName
        when 'AP' then _ContactCardSupplierContact.FullName
        when 'PE' then _PersonWorkAgreement.PersonFullName
      end as mm_pur_partnername ) as PurchasingDocumentPartnerName,

      _PurchasingDocument,
      _PurchasingDocumentItem,
      _PurchasingOrganization,
      _Plant,
      _PartnerFunction,
      _PartnerFunctionText,
      _PartnerTypeText,
      _Supplier,
      _SupplierContact,
      _PersonWorkAgreement
      //   _PurgDocumentPartnerVH,

      //   _PurContrPartnerFunctionVH

}              
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PERSONWORKAGREEMENT_1",
"I_PURCHASINGDOCUMENTPARTNER",
"I_SUPLRCONTACTCARD",
"P_CONTACTCARDSUPPLIERCONTACT"
],
"ASSOCIATED":
[
"I_PARTNERFUNCTION",
"I_PARTNERFUNCTIONTEXT",
"I_PARTNERTYPETEXT",
"I_PERSONWORKAGREEMENT_1",
"I_PLANT",
"I_PURCHASINGDOCUMENT",
"I_PURCHASINGDOCUMENTITEM",
"I_PURCHASINGORGANIZATION",
"I_SUPLRCONTACTCARD",
"I_SUPPLIER",
"I_SUPPLIERCONTACT",
"P_CONTACTCARDSUPPLIERCONTACT"
],
"BASE":
[
"I_PURCHASINGDOCUMENTPARTNER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/