P_CounterPartyWithSide

DDL: P_COUNTERPARTYWITHSIDE SQL: PCNTRPRTYWTSD Type: view COMPOSITE

P_CounterPartyWithSide is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_ACMCustomerCounterparty, lfa1) and exposes 19 fields with key field Counterparty.

Data Sources (2)

SourceAliasJoin Type
I_ACMCustomerCounterparty I_ACMCustomerCounterparty from
lfa1 lfa1 union

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PCNTRPRTYWTSD view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
ClientHandling.type #INHERITED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY Counterparty Counterparty
CustomerName
CounterpartyFullName CounterpartyFullName
Side Side
Country Country
Name1 ACMCounterpartyLastName
Name2 AdditionalName
City ACMCounterpartyCity
PostalCode PostalCode
Region Region
CustomerName
Side
Country land1
Name1 name1
Name2 name2
City ort01
PostalCode pstlz
Region regio
IsBusinessPurposeCompleted cvp_xblck
@AbapCatalog.sqlViewName: 'PCNTRPRTYWTSD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.type: #INHERITED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
define view P_CounterPartyWithSide

  as select from I_ACMCustomerCounterparty
  //kna1

{

      @ObjectModel.text.element: ['CustomerName']
  //key cast(kna1.kunnr as kunnr preserving type)                                                                   as 

  key Counterparty,
      @Semantics.text:true
      cast(substring(rtrim(replace(concat(ACMCounterpartyLastName, concat(' &@', AdditionalName)), '&@', ''),' '),1,80) as md_customer_name) as 
      CustomerName,

      //cast(concat( concat( concat( concat( concat( concat_with_space( anred, name1, 1 ), name2 ), name3 ), name4 ), '/' ),

      //        concat_with_space(pstlz, ort01, 1 ) ) as md_customer_full_name)                                     as 

              CounterpartyFullName, //KF: different with S4

      //cast( 'V' as wlf_pr_side)                                                                                   as 

      Side,
     //land1                                                                                                       as 

      Country,
     // name1                                                                                                       as 

      ACMCounterpartyLastName as Name1,
     // name2                                                                                                       as 

      AdditionalName as Name2,
     // ort01                                                                                                       as 

      ACMCounterpartyCity as City,
     // pstlz                                                                                                       as 

      PostalCode,
     // regio                                                                                                       as 

      Region,
      IsBusinessPurposeCompleted
}


union

select from lfa1
{

  key cast(lfa1.lifnr as lifnr preserving type)                                                                   as Counterparty,
      @Semantics.text: true
      cast(substring(rtrim(replace(concat(name1, concat(' &@', name2)), '&@', ''),' '),1,80) as md_supplier_name) as CustomerName,
      ltrim(cast(concat( concat(concat( concat(concat_with_space( anred, name1, 1 ), '/' ), stras ), '/'),
                   concat_with_space(concat_with_space(ort01,regio, 1 ), pstlz,1 ) ) as md_customer_full_name) , ' ' ) as CounterpartyFullName,
      cast( 'M' as wlf_pr_side)                                                                                   as Side,
      land1                                                                                                       as Country,
      name1                                                                                                       as Name1,
      name2                                                                                                       as Name2,
      ort01                                                                                                       as City,
      pstlz                                                                                                       as PostalCode,
      regio                                                                                                       as Region,
      cvp_xblck                                                                                                   as IsBusinessPurposeCompleted

}
where
  loevm is initial and
  cvp_xblck is initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACMCUSTOMERCOUNTERPARTY",
"LFA1"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/