I_RO_SAFTMatlDocHeader

DDL: I_RO_SAFTMATLDOCHEADER Type: view_entity COMPOSITE Package: GLO_LOG_SAFT_RO

RO SAFT Material Document Header

I_RO_SAFTMatlDocHeader is a Composite CDS View (Dimension) that provides data about "RO SAFT Material Document Header" in SAP S/4HANA. It reads from 3 data sources (I_AccountingDocument, I_RO_SAFTDocumentTypeMap, I_Product) and exposes 7 fields with key fields MaterialDocument, MaterialDocumentYear, CompanyCode. It has 8 associations to related views. Part of development package GLO_LOG_SAFT_RO.

Data Sources (3)

SourceAliasJoin Type
I_AccountingDocument _AccountingDoc inner
I_RO_SAFTDocumentTypeMap _DocumentMap inner
I_Product _Product inner

Associations (8)

CardinalityTargetAliasCondition
[0..1] I_RO_SAFTGoodsService _GoodsService _GoodsService.MaterialType = _Product.ProductType
[0..1] I_AccountingDocumentTypeText _AccountingDocumentText _AccountingDocumentText.AccountingDocumentType = _Matdoc.AccountingDocumentType and _AccountingDocumentText.Language = $session.system_language
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType1 _MovementType1.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType1.Plant = _Matdoc.Plant and _MovementType1.TargetGLAccount = '' and _MovementType1.AccountingDocumentType = _Matdoc.AccountingDocumentType and _MovementType1.DebitCreditCode = _Matdoc.DebitCreditCode and _MovementType1.ValuationClass = ''
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType2 _MovementType2.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType2.Plant = _Matdoc.Plant and _MovementType2.TargetGLAccount = '' and _MovementType2.AccountingDocumentType = _Matdoc.AccountingDocumentType and _MovementType2.DebitCreditCode = '' and _MovementType2.ValuationClass = ''
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType3 _MovementType3.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType3.Plant = _Matdoc.Plant and _MovementType3.TargetGLAccount = '' and _MovementType3.AccountingDocumentType = '' and _MovementType3.DebitCreditCode = '' and _MovementType3.ValuationClass = ''
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType4 _MovementType4.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType4.Plant = _Matdoc.Plant and _MovementType4.TargetGLAccount = '' and _MovementType4.AccountingDocumentType = '' and _MovementType4.DebitCreditCode = _Matdoc.DebitCreditCode and _MovementType4.ValuationClass = ''
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType5 _MovementType5.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType5.Plant = '' and _MovementType5.TargetGLAccount = '' and _MovementType5.AccountingDocumentType = '' and _MovementType5.DebitCreditCode = '' and _MovementType5.ValuationClass = ''
[0..1] I_RO_SAFTMvtTypeTableEntry _MovementType6 _MovementType6.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType6.Plant = _Matdoc.Plant and _MovementType6.TargetGLAccount = '' and _MovementType6.AccountingDocumentType = _Matdoc.AccountingDocumentType and _MovementType6.DebitCreditCode = _Matdoc.DebitCreditCode and _MovementType6.ValuationClass = _Matdoc.ValuationClass

Annotations (11)

NameValueLevelField
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label RO SAFT Material Document Header view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
Analytics.dataCategory #DIMENSION view
Analytics.internalName #LOCAL view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocument _Matdoc MaterialDocument
KEY MaterialDocumentYear _Matdoc MaterialDocumentYear
KEY CompanyCode _Matdoc CompanyCode
CreatedByUser _Matdoc CreatedByUser
PostingDate _Matdoc PostingDate
DocumentDate _Matdoc DocumentDate
AccountingDocumentTypeName _AccountingDocumentText AccountingDocumentTypeName
@VDM.viewType: #COMPOSITE
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'RO SAFT Material Document Header'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions:true
@Analytics.dataCategory: #DIMENSION
@Analytics.internalName:#LOCAL
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #XXL,
  dataClass: #MIXED
}
//@ObjectModel.representativeKey: 'MaterialDocument'

@Consumption.dbHints: ['PREAGGR_BEFORE_JOIN']
define view entity I_RO_SAFTMatlDocHeader
  as select distinct from I_RO_SAFTMaterialDocumentItem as _Matdoc
  inner join I_AccountingDocument           as _AccountingDoc on  _AccountingDoc.CompanyCode = _Matdoc.CompanyCode
                                                              and _AccountingDoc.FiscalYear = _Matdoc.FiscalYear
                                                              and _AccountingDoc.ReferenceDocumentType = 'MKPF'
                                                              and _AccountingDoc.OriginalReferenceDocument = concat( _Matdoc.MaterialDocument, _Matdoc.MaterialDocumentYear)
  inner join I_RO_SAFTDocumentTypeMap       as _DocumentMap
                                                          on  _DocumentMap.CompanyCode = _Matdoc.CompanyCode
                                                          and _DocumentMap.AccountingDocumentType = _Matdoc.AccountingDocumentType
                                                          and _DocumentMap.RO_SAFTSourceDocumentType = '05'
  inner join I_Product                                    as  _Product on _Product.Product = _Matdoc.StockIdentifyingMaterial
  association [0..1] to I_RO_SAFTGoodsService             as  _GoodsService on _GoodsService.MaterialType = _Product.ProductType
  association [0..1] to I_AccountingDocumentTypeText
                                     as  _AccountingDocumentText
                                     on  _AccountingDocumentText.AccountingDocumentType = _Matdoc.AccountingDocumentType
                                     and _AccountingDocumentText.Language = $session.system_language
  association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType1
                                                          on  _MovementType1.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType1.Plant = _Matdoc.Plant
                                                          and _MovementType1.TargetGLAccount = ''
                                                          and _MovementType1.AccountingDocumentType = _Matdoc.AccountingDocumentType
                                                          and _MovementType1.DebitCreditCode = _Matdoc.DebitCreditCode
                                                          and _MovementType1.ValuationClass = ''
  association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType2
                                                          on  _MovementType2.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType2.Plant = _Matdoc.Plant
                                                          and _MovementType2.TargetGLAccount = ''
                                                          and _MovementType2.AccountingDocumentType = _Matdoc.AccountingDocumentType
                                                          and _MovementType2.DebitCreditCode = ''
                                                          and _MovementType2.ValuationClass = ''
  association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType3
                                                          on  _MovementType3.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType3.Plant = _Matdoc.Plant
                                                          and _MovementType3.TargetGLAccount = ''
                                                          and _MovementType3.AccountingDocumentType = ''
                                                          and _MovementType3.DebitCreditCode = ''
                                                          and _MovementType3.ValuationClass = ''
  association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType4
                                                          on  _MovementType4.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType4.Plant = _Matdoc.Plant
                                                          and _MovementType4.TargetGLAccount = ''
                                                          and _MovementType4.AccountingDocumentType = ''
                                                          and _MovementType4.DebitCreditCode = _Matdoc.DebitCreditCode
                                                          and _MovementType4.ValuationClass = ''
  association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType5
                                                          on  _MovementType5.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType5.Plant = ''
                                                          and _MovementType5.TargetGLAccount = ''
                                                          and _MovementType5.AccountingDocumentType = ''
                                                          and _MovementType5.DebitCreditCode = ''
                                                          and _MovementType5.ValuationClass = ''
 association [0..1] to I_RO_SAFTMvtTypeTableEntry
                                            as _MovementType6
                                                          on  _MovementType6.GoodsMovementType = _Matdoc.GoodsMovementType
                                                          and _MovementType6.Plant = _Matdoc.Plant
                                                          and _MovementType6.TargetGLAccount = ''
                                                          and _MovementType6.AccountingDocumentType = _Matdoc.AccountingDocumentType
                                                          and _MovementType6.DebitCreditCode = _Matdoc.DebitCreditCode
                                                          and _MovementType6.ValuationClass = _Matdoc.ValuationClass

{
  key _Matdoc.MaterialDocument,
  key _Matdoc.MaterialDocumentYear,
  key _Matdoc.CompanyCode,
  key ( case
    when _MovementType1.RO_SAFTMovementType is not null
      then _MovementType1.RO_SAFTMovementType
    when _MovementType2.RO_SAFTMovementType is not null
      then _MovementType2.RO_SAFTMovementType
    when _MovementType3.RO_SAFTMovementType is not null
      then _MovementType3.RO_SAFTMovementType
    when _MovementType4.RO_SAFTMovementType is not null
      then _MovementType4.RO_SAFTMovementType
    when _MovementType5.RO_SAFTMovementType is not null
      then _MovementType5.RO_SAFTMovementType
    else _MovementType6.RO_SAFTMovementType
  end  ) as RO_SAFTMovementType,

  _Matdoc.CreatedByUser,
  _Matdoc.PostingDate,
  _Matdoc.DocumentDate,
  _AccountingDocumentText.AccountingDocumentTypeName

} where /*_Matdoc.MaterialDocumentItem = '0001'
  and   */ _Matdoc.StockIdentifyingMaterial is not initial
  /*and   _Matdoc.GoodsMovementStkAmtInCCCrcy is not initial*/
  and   _Matdoc.MaterialDocumentRecordType = 'MDOC'
  and   _GoodsService.RO_SAFTGoodsService = '01'