P_MaterialDocumentHeader

DDL: P_MATERIALDOCUMENTHEADER Type: view_entity COMPOSITE Package: MM_IM_RAP_MATDOC

RAP Material Document Header

P_MaterialDocumentHeader is a Composite CDS View that provides data about "RAP Material Document Header" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 25 fields with key fields MaterialDocumentYear, MaterialDocument. It has 2 associations to related views. Part of development package MM_IM_RAP_MATDOC.

Data Sources (1)

SourceAliasJoin Type
I_MaterialDocumentRecord I_MaterialDocumentRecord from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_MaterialDocumentYear _MaterialDocumentYear $projection.MaterialDocumentYear = _MaterialDocumentYear.MaterialDocumentYear
[0..1] P_GoodsMovementCode _GoodsMovementCode $projection.TransactionCode = _GoodsMovementCode.TransactionCode -- the

Annotations (13)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.compositionRoot true view
ObjectModel.representativeKey MaterialDocument view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
Search.searchable true view
VDM.viewType #COMPOSITE view
VDM.private true view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label RAP Material Document Header view

Fields (25)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocumentYear MaterialDocumentYear
KEY MaterialDocument MaterialDocument
DocumentDate DocumentDate
PostingDate PostingDate
TransactionCode TransactionCode
AccountingDocumentType AccountingDocumentType
InventoryTransactionType InventoryTransactionType
CreatedByUser CreatedByUser
CreationDate CreationDate
CreationTime CreationTime
MaterialDocumentHeaderText MaterialDocumentHeaderText
ReferenceDocument ReferenceDocument
VersionForPrintingSlip VersionForPrintingSlip
ManualPrintIsTriggered ManualPrintIsTriggered
CtrlPostgForExtWhseMgmtSyst CtrlPostgForExtWhseMgmtSyst
BillOfLading BillOfLading
Plant Plant
StorageLocation StorageLocation
IssuingOrReceivingPlant IssuingOrReceivingPlant
IssuingOrReceivingStorageLoc IssuingOrReceivingStorageLoc
GoodsMovementCode _GoodsMovementCode GoodsMovementCode
_MaterialDocumentYear _MaterialDocumentYear
_User _User
_AccountingDocumentType _AccountingDocumentType
_InventoryTransactionType _InventoryTransactionType
@AccessControl: {
                    authorizationCheck: #CHECK,
                    personalData.blocking: #NOT_REQUIRED,
                    privilegedAssociations: ['_User']
                 }
@ObjectModel: {
                usageType: {
                             sizeCategory: #XXL,
                             serviceQuality: #B,
                             dataClass:#TRANSACTIONAL
                           },
                compositionRoot: true,
                representativeKey: 'MaterialDocument',
                modelingPattern: #ANALYTICAL_DIMENSION,
                supportedCapabilities: [#ANALYTICAL_DIMENSION, #CDS_MODELING_ASSOCIATION_TARGET, #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE]
} 

@Search.searchable: true
@VDM: {
        viewType: #COMPOSITE,
        private: true
      }

@Metadata: {
             ignorePropagatedAnnotations: true
           }
@EndUserText.label: 'RAP Material Document Header'
define view entity P_MaterialDocumentHeader as select from I_MaterialDocumentRecord
  association [1..1] to I_MaterialDocumentYear   as _MaterialDocumentYear          on $projection.MaterialDocumentYear = _MaterialDocumentYear.MaterialDocumentYear
//  association [1..*] to I_MaterialDocumentItem_2 as _MaterialDocumentItem          on $projection.MaterialDocumentYear = _MaterialDocumentItem.MaterialDocumentYear

//                                                                                  and $projection.MaterialDocument     = _MaterialDocumentItem.MaterialDocument

//  association [0..1] to I_DeliveryDocument       as _DeliveryDocument              on $projection.DeliveryDocument = _DeliveryDocument.DeliveryDocument

//

//  association [0..1] to I_StorageLocation        as _StorageLocation               on $projection.StorageLocation = _StorageLocation.StorageLocation

//                                                                                  and $projection.Plant           = _StorageLocation.Plant

//  association [0..1] to I_StorageLocation        as _IssuingOrReceivingStorageLoc  on $projection.IssuingOrReceivingStorageLoc = _IssuingOrReceivingStorageLoc.StorageLocation

//                                                                                  and $projection.IssuingOrReceivingPlant      = _IssuingOrReceivingStorageLoc.Plant 

                                                                                  
 association [0..1] to P_GoodsMovementCode      as _GoodsMovementCode             on $projection.TransactionCode = _GoodsMovementCode.TransactionCode

  -- the association to the DeliveryDocument would also be available as _DeliveryInMatlDocumentHeader in I_MaterialDocumentRecord,
  -- but since the field is rebranded as DeliveryDocument in the header view, the repeated association seems to make sense
{
      @ObjectModel.foreignKey.association: '_MaterialDocumentYear'
  key MaterialDocumentYear,
      @Search: {
                    defaultSearchElement: true,
                    fuzzinessThreshold: 0.9,
                    ranking: #HIGH
                }
  key MaterialDocument,

      @Search: {
                    defaultSearchElement: true,
                    fuzzinessThreshold: 0.9,
                    ranking: #MEDIUM
                }
      @Semantics.businessDate.at: true
      DocumentDate,

      @Search: {
                    defaultSearchElement: true,
                    fuzzinessThreshold: 0.9,
                    ranking: #MEDIUM
                }
      @Semantics.businessDate.at: true
      PostingDate,
        @Consumption.hidden: true
      TransactionCode,
      AccountingDocumentType,
      InventoryTransactionType,

      CreatedByUser,
      CreationDate,
      CreationTime,
      MaterialDocumentHeaderText,

//      @Search: {

//                    defaultSearchElement: true,

//                    fuzzinessThreshold: 0.9,

//                    ranking: #MEDIUM

//                }

//      @ObjectModel.foreignKey.association: '_DeliveryDocument'

//      @Consumption.valueHelpDefinition: [

//        { entity:  { name:    'I_DeliveryDocumentStdVH',

//                     element: 'DeliveryDocument' }

//        }]

//      DeliveryInMatlDocumentHeader as DeliveryDocument,

      ReferenceDocument,
      VersionForPrintingSlip,
      ManualPrintIsTriggered,
      CtrlPostgForExtWhseMgmtSyst, 
      
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Search.ranking: #MEDIUM
      BillOfLading,

// Authorization check 

      @Consumption.hidden: true
      Plant,
      @Consumption.hidden: true
      StorageLocation,
      @Consumption.hidden: true
      IssuingOrReceivingPlant,
      @Consumption.hidden: true
      IssuingOrReceivingStorageLoc,
// Authorization check 

      _GoodsMovementCode.GoodsMovementCode,

      _MaterialDocumentYear,
//      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]

//      _MaterialDocumentItem,


      _User,
      _AccountingDocumentType,
      _InventoryTransactionType

//      _DeliveryDocument,

// Authorization check 

//      @Consumption.hidden: true

//      _StorageLocation,

//      @Consumption.hidden: true

//      _IssuingOrReceivingStorageLoc

// Authorization check 

      
}
where
      MaterialDocumentRecordType = 'MDOC'
  and IsMaterialDocumentHeader   = 1