A_MaterialDocumentHeader
Document Header
A_MaterialDocumentHeader is a Basic CDS View that provides data about "Document Header" in SAP S/4HANA. It reads from 1 data source (I_GoodsMovementDocument) and exposes 21 fields with key fields MaterialDocumentYear, MaterialDocument. It has 3 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_GoodsMovementDocument | Header | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | A_MaterialDocumentItem | _MaterialDocumentItem | $projection.MaterialDocumentYear = _MaterialDocumentItem.MaterialDocumentYear and $projection.MaterialDocument = _MaterialDocumentItem.MaterialDocument |
| [0..1] | I_StorageLocation | _StorageLocation | $projection.StorageLocation = _StorageLocation.StorageLocation and $projection.Plant = _StorageLocation.Plant |
| [0..1] | I_StorageLocation | _IssuingOrReceivingStorageLoc | $projection.IssuingOrReceivingStorageLoc = _IssuingOrReceivingStorageLoc.StorageLocation and $projection.IssuingOrReceivingPlant = _IssuingOrReceivingStorageLoc.Plant |
Annotations (14)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.lifecycle.contract.type | #PUBLIC_REMOTE_API | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.sqlViewName | AMATDOCHEAD | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Document Header | view | |
| ObjectModel.createEnabled | true | view | |
| VDM.viewType | #BASIC | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #B | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.compositionRoot | true | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | MaterialDocumentYear | I_GoodsMovementDocument | MaterialDocumentYear | |
| KEY | MaterialDocument | I_GoodsMovementDocument | MaterialDocument | |
| InventoryTransactionType | I_GoodsMovementDocument | InventoryTransactionType | ||
| DocumentDate | I_GoodsMovementDocument | DocumentDate | ||
| PostingDate | I_GoodsMovementDocument | PostingDate | ||
| CreationDate | I_GoodsMovementDocument | CreationDate | ||
| CreationTime | I_GoodsMovementDocument | CreationTime | ||
| CreatedByUser | I_GoodsMovementDocument | CreatedByUser | ||
| MaterialDocumentHeaderText | I_GoodsMovementDocument | MaterialDocumentHeaderText | ||
| ReferenceDocument | I_GoodsMovementDocument | ReferenceDocument | ||
| VersionForPrintingSlip | I_GoodsMovementDocument | VersionForPrintingSlip | ||
| ManualPrintIsTriggered | I_GoodsMovementDocument | ManualPrintIsTriggered | ||
| CtrlPostgForExtWhseMgmtSyst | I_GoodsMovementDocument | CtrlPostgForExtWhseMgmtSyst | ||
| GoodsMovementCode | P_GoodsMovementCode | GoodsMovementCode | ||
| Plant | I_GoodsMovementDocument | Plant | ||
| StorageLocation | I_GoodsMovementDocument | StorageLocation | ||
| IssuingOrReceivingPlant | I_GoodsMovementDocument | IssuingOrReceivingPlant | ||
| IssuingOrReceivingStorageLoc | I_GoodsMovementDocument | IssuingOrReceivingStorageLoc | ||
| _MaterialDocumentItem | _MaterialDocumentItem | |||
| _StorageLocation | _StorageLocation | |||
| _IssuingOrReceivingStorageLoc | _IssuingOrReceivingStorageLoc |
@VDM.lifecycle.contract.type: #PUBLIC_REMOTE_API
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'AMATDOCHEAD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Document Header'
@ObjectModel.createEnabled: true
@VDM.viewType : #BASIC
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.compositionRoot:true
//@ObjectModel.sapObjectNodeType.name: 'MaterialDocument'
@Metadata.ignorePropagatedAnnotations:true
/*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */
define view A_MaterialDocumentHeader
as select from I_GoodsMovementDocument as Header
left outer to one join P_GoodsMovementCode on Header.TransactionCode = P_GoodsMovementCode.TransactionCode
association [1..*] to A_MaterialDocumentItem as _MaterialDocumentItem on $projection.MaterialDocumentYear = _MaterialDocumentItem.MaterialDocumentYear
and $projection.MaterialDocument = _MaterialDocumentItem.MaterialDocument
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
{
key Header.MaterialDocumentYear,
key Header.MaterialDocument,
@ObjectModel.sapObjectNodeTypeReference: 'InventoryTransactionType'
Header.InventoryTransactionType,
Header.DocumentDate,
Header.PostingDate,
Header.CreationDate,
Header.CreationTime,
Header.CreatedByUser,
Header.MaterialDocumentHeaderText,
Header.ReferenceDocument,
Header.VersionForPrintingSlip,
Header.ManualPrintIsTriggered,
@ObjectModel.sapObjectNodeTypeReference: 'CtrlPostgForExtWhseMgmtSyst'
Header.CtrlPostgForExtWhseMgmtSyst,
@ObjectModel.sapObjectNodeTypeReference: 'GoodsMovementCode'
P_GoodsMovementCode.GoodsMovementCode,
// Authorization check
@Consumption.hidden: true
Header.Plant,
@Consumption.hidden: true
Header.StorageLocation,
@Consumption.hidden: true
Header.IssuingOrReceivingPlant,
@Consumption.hidden: true
Header.IssuingOrReceivingStorageLoc,
// Authorization check
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_MaterialDocumentItem,
// Authorization check
@Consumption.hidden: true
_StorageLocation,
@Consumption.hidden: true
_IssuingOrReceivingStorageLoc
// Authorization check
} where
Header.MaterialDocumentRecordType = 'MDOC'
and Header.IsMaterialDocumentHeader = 1
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA