P_CustomerByExternalID

DDL: P_CUSTOMERBYEXTERNALID SQL: PDDFCUSTBYEXTID Type: view CONSUMPTION Package: ODATA_GL_DSP_DOC_FLW

Customer By External ID

P_CustomerByExternalID is a Consumption CDS View that provides data about "Customer By External ID" in SAP S/4HANA. It reads from 1 data source (I_Customer) and exposes 4 fields with key fields Customer, BusinessPartner, BPIdentificationType, BPIdentificationNumber. Part of development package ODATA_GL_DSP_DOC_FLW.

Data Sources (1)

SourceAliasJoin Type
I_Customer I_Customer from

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PDDFCUSTBYEXTID view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #XL view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY Customer I_Customer Customer
KEY BusinessPartner BuPaIdentification BusinessPartner
KEY BPIdentificationType BuPaIdentification BPIdentificationType
KEY BPIdentificationNumber BuPaIdentification BPIdentificationNumber
@AbapCatalog.sqlViewName: 'PDDFCUSTBYEXTID'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true

@ClientHandling.algorithm:#SESSION_VARIABLE

@AccessControl.authorizationCheck: #NOT_REQUIRED

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #XL

@VDM.viewType: #CONSUMPTION
@VDM.private: true
define view P_CustomerByExternalID
  as select from           I_Customer

  //---> BPIdentificationNumber is a key field which causes that association is not to 1, providing only the BPIdentificationType, 

  //that is why we use 'left outer to one join' instead of assotiation

  //BP application guarantees that there will be only 1 number for BPCU01


    left outer to one join I_Customer_to_BusinessPartner as CustomerToBuPa     on I_Customer.Customer = CustomerToBuPa.Customer
    left outer to one join I_BusinessPartner             as BuPa               on CustomerToBuPa.BusinessPartnerUUID = BuPa.BusinessPartnerUUID
    left outer to one join I_BuPaIdentification          as BuPaIdentification on  BuPa.BusinessPartner                    = BuPaIdentification.BusinessPartner
                                                                               and BuPaIdentification.BPIdentificationType = 'BPCU01'

{
  key I_Customer.Customer                       as Customer,
  key BuPaIdentification.BusinessPartner        as BusinessPartner,
  key BuPaIdentification.BPIdentificationType   as BPIdentificationType,
  key BuPaIdentification.BPIdentificationNumber as BPIdentificationNumber
}