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. Part of development package ODATA_MM_IM_API_MATERIAL_DOC.
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 | Material Document Year |
| KEY | MaterialDocument | I_GoodsMovementDocument | MaterialDocument | Material Doc. |
| InventoryTransactionType | I_GoodsMovementDocument | InventoryTransactionType | Trans. Ev. Type | |
| DocumentDate | I_GoodsMovementDocument | DocumentDate | Journal Entry Date | |
| PostingDate | I_GoodsMovementDocument | PostingDate | Posting Date for GR | |
| CreationDate | I_GoodsMovementDocument | CreationDate | Time Stamp | |
| CreationTime | I_GoodsMovementDocument | CreationTime | Time of Change | |
| CreatedByUser | I_GoodsMovementDocument | CreatedByUser | User Name | |
| MaterialDocumentHeaderText | I_GoodsMovementDocument | MaterialDocumentHeaderText | ||
| ReferenceDocument | I_GoodsMovementDocument | ReferenceDocument | Reference Document | |
| VersionForPrintingSlip | I_GoodsMovementDocument | VersionForPrintingSlip | ||
| ManualPrintIsTriggered | I_GoodsMovementDocument | ManualPrintIsTriggered | ||
| CtrlPostgForExtWhseMgmtSyst | I_GoodsMovementDocument | CtrlPostgForExtWhseMgmtSyst | ||
| GoodsMovementCode | P_GoodsMovementCode | GoodsMovementCode | GM_code | |
| Plant | I_GoodsMovementDocument | Plant | Valuation Area | |
| StorageLocation | I_GoodsMovementDocument | StorageLocation | StorageLocation | |
| IssuingOrReceivingPlant | I_GoodsMovementDocument | IssuingOrReceivingPlant | Transfer Plant | |
| IssuingOrReceivingStorageLoc | I_GoodsMovementDocument | IssuingOrReceivingStorageLoc | Receiving SLoc. | |
| _MaterialDocumentItem | _MaterialDocumentItem | |||
| _StorageLocation | _StorageLocation | |||
| _IssuingOrReceivingStorageLoc | _IssuingOrReceivingStorageLoc |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view A_MaterialDocumentHeader.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: AMATDOCHEAD
CREATE VIEW A_MaterialDocumentHeader AS
SELECT
Header.MaterialDocumentYear AS MaterialDocumentYear,
Header.MaterialDocument AS MaterialDocument,
Header.InventoryTransactionType AS InventoryTransactionType,
Header.DocumentDate AS DocumentDate,
Header.PostingDate AS PostingDate,
Header.CreationDate AS CreationDate,
Header.CreationTime AS CreationTime,
Header.CreatedByUser AS CreatedByUser,
Header.MaterialDocumentHeaderText AS MaterialDocumentHeaderText,
Header.ReferenceDocument AS ReferenceDocument,
Header.VersionForPrintingSlip AS VersionForPrintingSlip,
Header.ManualPrintIsTriggered AS ManualPrintIsTriggered,
Header.CtrlPostgForExtWhseMgmtSyst AS CtrlPostgForExtWhseMgmtSyst,
P_GoodsMovementCode.GoodsMovementCode AS GoodsMovementCode,
Header.Plant AS Plant,
Header.StorageLocation AS StorageLocation,
Header.IssuingOrReceivingPlant AS IssuingOrReceivingPlant,
Header.IssuingOrReceivingStorageLoc AS IssuingOrReceivingStorageLoc
FROM I_GoodsMovementDocument AS Header
LEFT OUTER JOIN A_MaterialDocumentItem AS _MaterialDocumentItem ON MaterialDocumentYear = _MaterialDocumentItem.MaterialDocumentYear AND MaterialDocument = _MaterialDocumentItem.MaterialDocument -- association [1..*]
LEFT OUTER JOIN I_StorageLocation AS _StorageLocation ON StorageLocation = _StorageLocation.StorageLocation AND Plant = _StorageLocation.Plant -- association [0..1]
LEFT OUTER JOIN I_StorageLocation AS _IssuingOrReceivingStorageLoc ON IssuingOrReceivingStorageLoc = _IssuingOrReceivingStorageLoc.StorageLocation AND IssuingOrReceivingPlant = _IssuingOrReceivingStorageLoc.Plant -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA