I_SDDocStandardPartner

DDL: I_SDDOCSTANDARDPARTNER SQL: ISDDOCSTDPART Type: view COMPOSITE

SD Document Standard Partner

I_SDDocStandardPartner is a Composite CDS View that provides data about "SD Document Standard Partner" in SAP S/4HANA. It reads from 1 data source (P_SDDocStandardPartner1) and exposes 15 fields with key field SDDocument. It has 6 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_SDDocStandardPartner1 AllSDDocs from

Associations (6)

CardinalityTargetAliasCondition
[0..1] I_Customer _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] I_Customer _BillToParty $projection.BillToParty = _BillToParty.Customer
[0..1] I_Customer _ShipToParty $projection.ShipToParty = _ShipToParty.Customer
[0..1] I_Customer _PayerParty $projection.PayerParty = _PayerParty.Customer
[0..1] I_PersonWorkAgreement_1 _SalesEmployee $projection.SalesEmployee = _SalesEmployee.PersonWorkAgreement
[0..1] I_PersonWorkAgreement_1 _ResponsibleEmployee $projection.ResponsibleEmployee = _ResponsibleEmployee.PersonWorkAgreement

Annotations (11)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
EndUserText.label SD Document Standard Partner view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #NOT_REQUIRED view
AbapCatalog.sqlViewName ISDDOCSTDPART view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY SDDocument P_SDDocStandardPartner1 SDDocument
SoldToParty
ShipToParty
BillToParty
PayerParty
SalesEmployee
ResponsibleEmployee
SalesEmployeeWorkAgreement
ResponsibleEmployeeWorkAgrmt
_SoldToParty _SoldToParty
_BillToParty _BillToParty
_ShipToParty _ShipToParty
_PayerParty _PayerParty
_SalesEmployee _SalesEmployee
_ResponsibleEmployee _ResponsibleEmployee
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED 
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL 
@EndUserText.label: 'SD Document Standard Partner'
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'ISDDOCSTDPART'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true

define view I_SDDocStandardPartner
  // P_SDDocStandardPartner1: Get all distinct sd document to get rid of duplicated items

  as select from           P_SDDocStandardPartner1 as AllSDDocs

    left outer to one join I_SDDocumentPartner     as SoldToParty         on  AllSDDocs.SDDocument        = SoldToParty.SDDocument
                                                                          and SoldToParty.PartnerFunction = 'AG'
    left outer to one join I_SDDocumentPartner     as ShipToParty         on  AllSDDocs.SDDocument        = ShipToParty.SDDocument
                                                                          and ShipToParty.PartnerFunction = 'WE'
    left outer to one join I_SDDocumentPartner     as BillToParty         on  AllSDDocs.SDDocument        = BillToParty.SDDocument
                                                                          and BillToParty.PartnerFunction = 'RE'
    left outer to one join I_SDDocumentPartner     as PayerParty          on  AllSDDocs.SDDocument        = PayerParty.SDDocument
                                                                          and PayerParty.PartnerFunction  = 'RG'
    left outer to one join I_SDDocumentPartner     as SalesEmployee       on  AllSDDocs.SDDocument        = SalesEmployee.SDDocument 
                                                                          and SalesEmployee.PartnerFunction = 'VE'
    left outer to one join I_SDDocumentPartner     as ResponsibleEmployee on AllSDDocs.SDDocument        = ResponsibleEmployee.SDDocument 
                                                                          and ResponsibleEmployee.PartnerFunction = 'ZM'
//    left outer to one join I_Employment            as SalesEmployee2      on SalesEmployee1.Personnel     = SalesEmployee2.EmploymentInternalID

//    left outer to one join I_Employment            as ResponsibleEmployee2 on ResponsibleEmployee1.Personnel = ResponsibleEmployee2.EmploymentInternalID

      
  association [0..1] to I_Customer as _SoldToParty         on $projection.SoldToParty = _SoldToParty.Customer
  association [0..1] to I_Customer as _BillToParty         on $projection.BillToParty = _BillToParty.Customer
  association [0..1] to I_Customer as _ShipToParty         on $projection.ShipToParty = _ShipToParty.Customer
  association [0..1] to I_Customer as _PayerParty          on $projection.PayerParty  = _PayerParty.Customer

//  association [0..1] to I_Employee as _SalesEmployee       on $projection.SalesEmployee       = _SalesEmployee.PersonnelNumber

//  association [0..1] to I_Employee as _ResponsibleEmployee on $projection.ResponsibleEmployee = _ResponsibleEmployee.PersonnelNumber

  association [0..1] to I_PersonWorkAgreement_1 as _SalesEmployee       on $projection.SalesEmployee       = _SalesEmployee.PersonWorkAgreement
  association [0..1] to I_PersonWorkAgreement_1 as _ResponsibleEmployee on $projection.ResponsibleEmployee = _ResponsibleEmployee.PersonWorkAgreement
{
  key AllSDDocs.SDDocument,

      @ObjectModel.foreignKey.association: '_SoldToParty'
      cast(SoldToParty.Customer as kunag preserving type)      as SoldToParty,

      @ObjectModel.foreignKey.association: '_ShipToParty'
      cast(ShipToParty.Customer as kunwe preserving type)      as ShipToParty,

      @ObjectModel.foreignKey.association: '_BillToParty'
      cast(BillToParty.Customer as kunre preserving type)      as BillToParty,

      @ObjectModel.foreignKey.association: '_PayerParty'
      cast(PayerParty.Customer as kunrg preserving type)       as PayerParty,

      @ObjectModel.foreignKey.association: '_SalesEmployee'
      cast(SalesEmployee.Personnel as sales_empl preserving type) as SalesEmployee,

      @ObjectModel.foreignKey.association: '_ResponsibleEmployee'
      cast(ResponsibleEmployee.Personnel as resp_empl preserving type) as ResponsibleEmployee,
      
      //Sales Employee ID & Responsible Employee ID

      cast(SalesEmployee.Personnel as sales_empl preserving type) as SalesEmployeeWorkAgreement,
      cast(ResponsibleEmployee.Personnel as resp_empl preserving type) as ResponsibleEmployeeWorkAgrmt, 

      _SoldToParty,
      _BillToParty,
      _ShipToParty,
      _PayerParty,
      _SalesEmployee,
      _ResponsibleEmployee
};                                     
  
  
  
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SDDOCUMENTPARTNER",
"P_SDDOCSTANDARDPARTNER1"
],
"ASSOCIATED":
[
"I_CUSTOMER",
"I_PERSONWORKAGREEMENT_1"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/