I_PURGDOCUMENTPARTNERENH

CDS View

Purchasing Document Partner Enhanced

I_PURGDOCUMENTPARTNERENH is a CDS View in S/4HANA. Purchasing Document Partner Enhanced. It contains 27 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
I_Purctrpartners view from COMPOSITE Interface view for partners
I_SchedgAgrmtPartner view from COMPOSITE Scheduling Agreement Partners

Fields (27)

KeyField CDS FieldsUsed in Views
KEY PartnerCounter PartnerCounter 2
KEY PartnerFunction PartnerFunction 2
KEY Plant Plant 2
KEY PurchasingDocument PurchaseContract,SchedulingAgreement 2
KEY PurchasingDocumentItem PurchaseContractItem,SchedulingAgreementItem 2
KEY PurchasingOrganization PurchasingOrganization 2
KEY SupplierSubrange SupplierSubrange 2
_PartnerFunction _PartnerFunction 2
_PartnerFunctionText _PartnerFunctionText 2
_PersonWorkAgreement _PersonWorkAgreement 2
_Plant _Plant 2
_PurchasingDocument _PurchasingDocument 2
_PurchasingDocumentItem _PurchasingDocumentItem 2
_PurchasingOrganization _PurchasingOrganization 2
_Supplier _Supplier 2
_SupplierContact _SupplierContact 2
CreatedByUser CreatedByUser 2
CreationDate CreationDate 2
DefaultPartner DefaultPartner 2
EmploymentInternalID EmploymentInternalID 1
PersonWorkAgreement EmploymentInternalID,PersonWorkAgreement 2
PurchasingDocumentCategory PurchasingDocumentCategory,SchedgAgrmtCategory 2
PurchasingDocumentPartner PurchasingDocumentPartner,SchedgAgrmtPartner 2
PurchasingDocumentPartnerName PurchasingDocumentPartnerName,SchedgAgrmtPartnerName 2
PurchasingDocumentType PurchaseContractType,PurchasingDocumentType,SchedgAgrmtType 2
Supplier Supplier 2
SupplierContact SupplierContact 2
@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":""
}
}*/