P_SDDocumentCompletePartners_2

DDL: P_SDDOCUMENTCOMPLETEPARTNERS_2 Type: view BASIC

P_SDDocumentCompletePartners_2 is a Basic CDS View in SAP S/4HANA. It reads from 1 data source (vbpa) and exposes 23 fields with key fields SDDocument, SDDocumentItem, PartnerFunction.

Data Sources (1)

SourceAliasJoin Type
vbpa vbpa from

Annotations (11)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #NOT_REQUIRED view
AbapCatalog.sqlViewName PSDDOCCMPLTPART2 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #XL view
VDM.private true view
VDM.viewType #BASIC view

Fields (23)

KeyFieldSource TableSource FieldDescription
KEY SDDocument vbpa vbeln
KEY SDDocumentItem vbpa posnr
KEY PartnerFunction vbpa parvw
Customer vbpa kunnr
Supplier vbpa lifnr
Personnel vbpa pernr
ContactPerson vbpa parnr
assigned_bpendasReferenceBusinessPartner
AddressID vbpa adrnr
AddressPersonID vbpa adrnp
SDDocPartnerAddressRefType vbpa adrda
BPAddrDeterminationTransaction vbpa addr_operation
BPRefAddressIDForDocSpcfcAddr vbpa bp_ref_adrnr
PartnerIsOneTimeAccount vbpa xcpdk
VATRegistration vbpa stceg
UnloadingPointName vbpa ablad
CountryCode vbpa land1
CustomerHierarchyType vbpa hityp
CustIsPrcDetnRlvt vbpa prfre
CustomerIsRebateRelevant vbpa bokre
CustomerHierarchyLevel vbpa histunr
CustomerHierarchyFixedLevel vbpa hzuor
TransportZone vbpa lzone
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl: {
  authorizationCheck: #NOT_REQUIRED,
  personalData.blocking: #NOT_REQUIRED
}
@AbapCatalog: {
  sqlViewName: 'PSDDOCCMPLTPART2',
  compiler.compareFilter: true,
  preserveKey: true
}
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #A,
     sizeCategory:   #XL
   }
}
@VDM.private: true
@VDM.viewType: #BASIC

define view P_SDDocumentCompletePartners_2
as
select from vbpa
association[0..1] to I_CustomerToBusinessPartner as _CustomerToBusinessPartner
  on $projection.Customer = _CustomerToBusinessPartner.Customer
association[0..1] to I_BPCustomerContactLink as _BPCustomerContactLink
  on $projection.ContactPerson = _BPCustomerContactLink.CustomerContact
association[0..1] to I_SupplierToBusinessPartner as _SupplierToBusinessPartner
  on $projection.Supplier = _SupplierToBusinessPartner.Supplier
association[0..1] to I_PersonWorkAgreement_1 as _PersonWorkAgreement_1
  on $projection.Personnel = _PersonWorkAgreement_1.PersonWorkAgreement
{
  key vbpa.vbeln as SDDocument,
  key vbpa.posnr as SDDocumentItem,
  key vbpa.parvw as PartnerFunction,

  vbpa.kunnr as Customer,
  vbpa.lifnr as Supplier,
  vbpa.pernr as Personnel,
  vbpa.parnr as ContactPerson,

  // vbpa.assigned_bp as ReferenceBusinessPartner,

  case
    when vbpa.kunnr is not initial
      then _CustomerToBusinessPartner._BusinessPartner.BusinessPartner
    when vbpa.lifnr is not initial
      then _SupplierToBusinessPartner._BusinessPartner.BusinessPartner
    when vbpa.pernr is not initial
      then _PersonWorkAgreement_1.Person
    when vbpa.parnr is not initial
      then _BPCustomerContactLink._BusinessPartnerPerson.BusinessPartner
    else
      vbpa.assigned_bp
  end as ReferenceBusinessPartner,

  vbpa.adrnr as AddressID,
  vbpa.adrnp as AddressPersonID,
  vbpa.adrda as SDDocPartnerAddressRefType,
  // vbpa.addr_type as AddressObjectType,


  cast(
  case
    when vbpa.adrnr is initial
      then ''
    else
      case
        when vbpa.adrda = 'E' or vbpa.adrda = 'F'
         then '1'
        else
          case
            when vbpa.parnr is not initial and vbpa.adrnp is initial
              then '1' // Contact Person's business address (KNVK-ADRND) is used

            when vbpa.parnr is not initial and vbpa.adrnp is not initial
              then '3'
            else
              case
                when vbpa.adrnp is not initial and vbpa.adrda = 'H'
                  then '2'
                else
                  '1'
              end
          end
      end
  end
  as ad_adrtype ) as AddressObjectType,

  vbpa.addr_operation as BPAddrDeterminationTransaction,
  vbpa.bp_ref_adrnr as BPRefAddressIDForDocSpcfcAddr,

  cast(
    case vbpa.adrda
      when 'E' then 'X'
      when 'F' then 'X'
      else ' '
  end as sd_pd_doc_spec_addr_flag) as SDDocPartnerAddrIsDocSpecific,

  vbpa.xcpdk as PartnerIsOneTimeAccount,
  vbpa.stceg as VATRegistration,
  vbpa.ablad as UnloadingPointName,

  vbpa.land1 as CountryCode,
  vbpa.hityp as CustomerHierarchyType,
  vbpa.prfre as CustIsPrcDetnRlvt,
  vbpa.bokre as CustomerIsRebateRelevant,
  vbpa.histunr as CustomerHierarchyLevel,
  vbpa.hzuor   as CustomerHierarchyFixedLevel,
  vbpa.lzone   as TransportZone
}