I_PurchasingDocumentPartner

DDL: I_PURCHASINGDOCUMENTPARTNER SQL: IPURDOCPARTNER Type: view BASIC

I_PurchasingDocumentPartner

I_PurchasingDocumentPartner is a Basic CDS View that provides data about "I_PurchasingDocumentPartner" in SAP S/4HANA. It reads from 1 data source (ekpa) and exposes 27 fields with key fields PurchasingDocument, PurchasingDocumentItem, PurchasingOrganization, SupplierSubrange, Plant. It has 9 associations to related views.

Data Sources (1)

SourceAliasJoin Type
ekpa ekpa from

Associations (9)

CardinalityTargetAliasCondition
[0..1] I_PurchasingDocument _PurchasingDocument _PurchasingDocument.PurchasingDocument = $projection.PurchasingDocument
[0..1] I_PurchasingDocumentItem _PurchasingDocumentItem _PurchasingDocumentItem.PurchasingDocument = $projection.PurchasingDocument and _PurchasingDocumentItem.PurchasingDocumentItem = $projection.PurchasingDocumentItem
[0..1] I_PurchasingOrganization _PurchasingOrganization _PurchasingOrganization.PurchasingOrganization = $projection.PurchasingOrganization
[0..1] I_Plant _Plant _Plant.Plant = $projection.Plant
[0..1] I_PartnerFunction _PartnerFunction _PartnerFunction.PartnerFunction = $projection.PartnerFunction
[0..*] I_PartnerFunctionText _PartnerFunctionText _PartnerFunctionText.PartnerFunction = $projection.PartnerFunction
[0..1] I_Supplier _Supplier _Supplier.Supplier = $projection.Supplier
[0..1] I_Suppliercontact _SupplierContact _SupplierContact.SupplierContact = $projection.SupplierContact
[0..1] I_PersonWorkAgreement_1 _PersonWorkAgreement _PersonWorkAgreement.PersonWorkAgreement = $projection.PersonWorkAgreement

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName IPURDOCPARTNER view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
VDM.viewType #BASIC view
EndUserText.label I_PurchasingDocumentPartner view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument ekpa ebeln
KEY PurchasingDocumentItem ekpa ebelp
KEY PurchasingOrganization ekpa ekorg
KEY SupplierSubrange ekpa ltsnr
KEY Plant ekpa werks
KEY PartnerFunction
KEY PartnerCounter ekpa parza
PurchasingDocumentCategory _PurchasingDocument PurchasingDocumentCategory
PurchasingDocumentType _PurchasingDocument PurchasingDocumentType
CreatedByUser ekpa ernam
CreationDate ekpa erdat
PurchasingDocumentPartnerType _PartnerFunction SDDocumentPartnerType
Supplier
SupplierHierarchyCategory ekpa hityp
SupplierContact ekpa parnr
PersonWorkAgreement ekpa pernr
EmploymentInternalID ekpa pernr
DefaultPartner ekpa defpa
_PurchasingDocument _PurchasingDocument
_PurchasingDocumentItem _PurchasingDocumentItem
_PurchasingOrganization _PurchasingOrganization
_Plant _Plant
_PartnerFunction _PartnerFunction
_PartnerFunctionText _PartnerFunctionText
_Supplier _Supplier
_SupplierContact _SupplierContact
_PersonWorkAgreement _PersonWorkAgreement
@AbapCatalog.sqlViewName: 'IPURDOCPARTNER'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@VDM.viewType : #BASIC
@EndUserText.label: 'I_PurchasingDocumentPartner'
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #L
//@ObjectModel.representativeKey: 'PartnerCounter'

define view I_PurchasingDocumentPartner
  as select from ekpa
  association [0..1] to I_PurchasingDocument     as _PurchasingDocument     on  _PurchasingDocument.PurchasingDocument = $projection.PurchasingDocument
  association [0..1] to I_PurchasingDocumentItem as _PurchasingDocumentItem on  _PurchasingDocumentItem.PurchasingDocument     = $projection.PurchasingDocument
                                                                            and _PurchasingDocumentItem.PurchasingDocumentItem = $projection.PurchasingDocumentItem
  association [0..1] to I_PurchasingOrganization as _PurchasingOrganization on  _PurchasingOrganization.PurchasingOrganization = $projection.PurchasingOrganization
  association [0..1] to I_Plant                  as _Plant                  on  _Plant.Plant = $projection.Plant
  association [0..1] to I_PartnerFunction        as _PartnerFunction        on  _PartnerFunction.PartnerFunction = $projection.PartnerFunction
  association [0..*] to I_PartnerFunctionText    as _PartnerFunctionText    on  _PartnerFunctionText.PartnerFunction = $projection.PartnerFunction
  //  association [0..*] to I_PartnerTypeText        as _PartnerTypeText        on  _PartnerTypeText.PurchasingDocumentPartnerType = $projection.purchasingdocumentpartnertype


  // only one of the following associations is used within a single record

  association [0..1] to I_Supplier               as _Supplier               on  _Supplier.Supplier = $projection.Supplier
  association [0..1] to I_Suppliercontact        as _SupplierContact        on  _SupplierContact.SupplierContact = $projection.SupplierContact // untested, cardinality unclear

  association [0..1] to I_PersonWorkAgreement_1  as _PersonWorkAgreement    on  _PersonWorkAgreement.PersonWorkAgreement = $projection.PersonWorkAgreement

  // need to select based on date

  // association [0..1] to I_User as _User on _User.UserID = $projection.CreatedByUser

{
      @ObjectModel.foreignKey.association: '_PurchasingDocument'
  key ekpa.ebeln                                     as PurchasingDocument,
      @ObjectModel.foreignKey.association: '_PurchasingDocumentItem'
  key ekpa.ebelp                                     as PurchasingDocumentItem, // Used in a single customer scenario but not in standard shipment, in standard 00000

      @ObjectModel.foreignKey.association: '_PurchasingOrganization'
  key ekpa.ekorg                                     as PurchasingOrganization, // attribute only, copied from PurchasingDocument

  key ekpa.ltsnr                                     as SupplierSubrange,       // empty

      @ObjectModel.foreignKey.association: '_Plant'
  key ekpa.werks                                     as Plant,                  // empty

      @ObjectModel: { foreignKey.association: '_PartnerFunction',
                      text.association: '_PartnerFunctionText' }
  key cast ( ekpa.parvw as parvw_unv preserving type ) as  PartnerFunction,        // must match a SUPPORTED entry in I_PartnerFunction


  key ekpa.parza                                     as PartnerCounter,         // ensures uniqueness of records


      @Consumption.hidden: true                                                 // transient

      _PurchasingDocument.PurchasingDocumentCategory as PurchasingDocumentCategory,
      @Consumption.hidden: true                                                 // transient

      _PurchasingDocument.PurchasingDocumentType     as PurchasingDocumentType,

      @Semantics.user.createdBy: true
      ekpa.ernam                                     as CreatedByUser,
      ekpa.erdat                                     as CreationDate,
      _PartnerFunction.SDDocumentPartnerType         as PurchasingDocumentPartnerType, // transient

      @ObjectModel.foreignKey.association: '_Supplier'
      cast(ekpa.lifn2 as lifnr preserving type)      as Supplier,
      ekpa.hityp                                     as SupplierHierarchyCategory,
      ekpa.parnr                                     as SupplierContact,

      @ObjectModel.foreignKey.association: '_PersonWorkAgreement'
      ekpa.pernr                                     as PersonWorkAgreement,
      //deprecated, replaced by PersonWorkAgreement

      ekpa.pernr                                     as EmploymentInternalID,
      ekpa.defpa                                     as 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


      _PurchasingDocument,
      _PurchasingDocumentItem,
      _PurchasingOrganization,
      _Plant,
      _PartnerFunction, //_PartnerFunctionsValueHelp, _PartnerFunctionsValueHelp2,

      _PartnerFunctionText,
      //      _PartnerTypeText,

      _Supplier,
      _SupplierContact,
      _PersonWorkAgreement
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PARTNERFUNCTION",
"I_PURCHASINGDOCUMENT",
"EKPA"
],
"ASSOCIATED":
[
"I_PARTNERFUNCTION",
"I_PARTNERFUNCTIONTEXT",
"I_PERSONWORKAGREEMENT_1",
"I_PLANT",
"I_PURCHASINGDOCUMENT",
"I_PURCHASINGDOCUMENTITEM",
"I_PURCHASINGORGANIZATION",
"I_SUPPLIER",
"I_SUPPLIERCONTACT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/