P_CollectionsAccount

DDL: P_COLLECTIONSACCOUNT Type: view COMPOSITE

P_CollectionsAccount is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_BPCollectionsSegmentAssgmt, I_BusinessPartnerCustomer, I_CustomerCompany) and exposes 12 fields with key fields Customer, CollectionSegment, CompanyCode, BusinessPartner. It has 4 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_BPCollectionsSegmentAssgmt I_BPCollectionsSegmentAssgmt inner
I_BusinessPartnerCustomer I_BusinessPartnerCustomer inner
I_CustomerCompany I_CustomerCompany inner

Associations (4)

CardinalityTargetAliasCondition
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[0..1] I_BusinessPartner _BusinessPartner $projection.BusinessPartner = _BusinessPartner.BusinessPartner
[0..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_CollectionSegment _CollectionSegment $projection.CollectionSegment = _CollectionSegment.CollectionSegment

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PCOLLSACCT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.representativeKey Customer view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY Customer I_BusinessPartnerCustomer Customer
KEY CollectionSegment
KEY CompanyCode I_CustomerCompany CompanyCode
KEY BusinessPartner I_BusinessPartnerCustomer BusinessPartner
CustomerName _Customer CustomerName
CollectionSegmentName
CompanyCodeName _CompanyCode CompanyCodeName
BusinessPartnerName _BusinessPartner BusinessPartnerName
_Customer _Customer
_BusinessPartner _BusinessPartner
_CompanyCode _CompanyCode
_CollectionSegment _CollectionSegment
@AbapCatalog: { sqlViewName: 'PCOLLSACCT',
                compiler: { compareFilter: true },
                preserveKey: true }
@AccessControl: { authorizationCheck: #CHECK,
                  personalData:       { blocking: #BLOCKED_DATA_EXCLUDED } }
@VDM: { viewType: #COMPOSITE,
        private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #C,
                             sizeCategory: #L,
                             dataClass: #TRANSACTIONAL },
                representativeKey: 'Customer' }

define view P_CollectionsAccount
  as select distinct from I_Customer
    inner join            I_CustomerCompany            on I_Customer.Customer = I_CustomerCompany.Customer
    inner join            I_BusinessPartnerCustomer    on I_Customer.Customer = I_BusinessPartnerCustomer.Customer
    left outer to many join(
                          I_CollsSgmtCompanyCodeAssgmt
        inner join        I_BPCollectionsSegmentAssgmt on  I_CollsSgmtCompanyCodeAssgmt.CollectionSegment           = I_BPCollectionsSegmentAssgmt.CollectionSegment
                                                       and I_BPCollectionsSegmentAssgmt.BPCollSgmtAssignmentValidTo = '99991231'
    )
    on  I_CustomerCompany.CompanyCode             = I_CollsSgmtCompanyCodeAssgmt.CompanyCode
    and I_BusinessPartnerCustomer.BusinessPartner = I_BPCollectionsSegmentAssgmt.BusinessPartner

  // VDM Associations

  // Customer

  association [0..1] to I_Customer          as _Customer          on $projection.Customer = _Customer.Customer

  // Business Partner

  association [0..1] to I_BusinessPartner   as _BusinessPartner   on $projection.BusinessPartner = _BusinessPartner.BusinessPartner

  // Company Code

  association [0..1] to I_CompanyCode       as _CompanyCode       on $projection.CompanyCode = _CompanyCode.CompanyCode

  // Collection Segment

  association [0..1] to I_CollectionSegment as _CollectionSegment on $projection.CollectionSegment = _CollectionSegment.CollectionSegment

{

      // VDM Fields

      @ObjectModel: { foreignKey: { association: '_Customer' } }
  key I_BusinessPartnerCustomer.Customer                                                                as Customer,

      @ObjectModel: { foreignKey: { association: '_CollectionSegment' } }
  key cast( I_BPCollectionsSegmentAssgmt.CollectionSegment as farp_collection_segment preserving type ) as CollectionSegment,

      @ObjectModel: { foreignKey: { association: '_CompanyCode' } }
  key I_CustomerCompany.CompanyCode                                                                     as CompanyCode,

      @ObjectModel: { foreignKey: { association: '_BusinessPartner' } }
  key I_BusinessPartnerCustomer.BusinessPartner                                                         as BusinessPartner,

      // Text Elements

      _Customer.CustomerName                                                                            as CustomerName,
      _CollectionSegment._Text[1:Language = $session.system_language].CollectionSegmentName             as CollectionSegmentName,
      _CompanyCode.CompanyCodeName                                                                      as CompanyCodeName,
      _BusinessPartner.BusinessPartnerName                                                              as BusinessPartnerName,

      // Exposed Associations

      _Customer,
      _BusinessPartner,
      _CompanyCode,
      _CollectionSegment

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BPCOLLECTIONSSEGMENTASSGMT",
"I_BUSINESSPARTNER",
"I_BUSINESSPARTNERCUSTOMER",
"I_COLLECTIONSEGMENT",
"I_COLLECTIONSEGMENTTEXT",
"I_COLLSSGMTCOMPANYCODEASSGMT",
"I_COMPANYCODE",
"I_CUSTOMER",
"I_CUSTOMERCOMPANY"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_COLLECTIONSEGMENT",
"I_COMPANYCODE",
"I_CUSTOMER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/