P_MaterialLedgerDocumentRecord
Material Ledger Document Record
P_MaterialLedgerDocumentRecord is a Basic CDS View that provides data about "Material Ledger Document Record" in SAP S/4HANA. It reads from 2 data sources (mldoc, ckmlhd) and exposes 35 fields with key fields MaterialLedgerDocRef, CurrencyRole. Part of development package FCML4H_DISPLAY.
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #BASIC | view | |
| VDM.private | true | view | |
| EndUserText.label | Material Ledger Document Record | view |
Fields (35)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | MaterialLedgerDocRef | mldoc | docref | |
| KEY | CurrencyRole | mldoc | curtp | |
| Ledger | mldoc | rldnr | ||
| FiscalYearPeriod | ||||
| MatlLdgrDocIsCostingRelevant | mldoc | xabr | ||
| MaterialLedgerCategory | mldoc | categ | ||
| ProcessCategory | mldoc | ptyp | ||
| CostEstimate | mldoc | kalnr | ||
| Material | ckmlhd | matnr | ||
| MaterialLedgerItemType | mldoc | posart | ||
| ProcurementAlternative | mldoc | bvalt | ||
| ProductionProcess | mldoc | process | ||
| ValuationQuantity | mldoc | quant | ||
| ValuationQuantityUnit | mldoc | meins | ||
| InventoryAmtInCCCrcy | mldoc | stval | ||
| PriceDifferenceAmtInCCCrcy | mldoc | prd | ||
| ExchRateDiffAmtInCoCodeCrcy | mldoc | kdm | ||
| Currency | mldoc | waers | ||
| ProductionOrder | mldoc | aufnr | ||
| EquivalenceNumberOfJntProdn | mldoc | eqnum | ||
| PostingDate | mldoc | budat | ||
| Plant | mldoc | werks | ||
| ReferenceDocumentType | mldoc | awtyp | ||
| SourceReferenceDocument | mldoc | awref | ||
| ReferenceDocumentContext | mldoc | aworg | ||
| ReferenceDocumentItem | mldoc | awitem | ||
| RefBusinessTransactionType | mldoc | glvor | ||
| MaterialLedgerTransactionType | mldoc | vgart | ||
| GoodsMovementType | mldoc | bwart | ||
| CostElement | mldoc | kstar | ||
| CostingRunReference | _list | runref | ||
| CostingRun | _period | run_id | ||
| CostingRunType | _period | run_type | ||
| LastDayOfMonthDate | _period | last_day | ||
| FirstDayOfMonthDate | _period | first_day |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XXL,
dataClass: #MIXED
}
@VDM: {
viewType: #BASIC,
private: true
}
--@EndUserText.label: 'Material Ledger Document Record'
define view entity P_MaterialLedgerDocumentRecord
as select from mldoc as doc
inner join ckmlhd as hd on doc.kalnr = hd.kalnr
left outer to one join mlrunlist as _list on doc.kalnr = _list.kalnr
and(
doc.jahrper = _list.jahrper
or(
_list.from_jahrper <> '0000000'
and _list.from_jahrper <= doc.jahrper
and _list.jahrper >= doc.jahrper
)
)
left outer to one join ckmlrunperiod as _period on _period.run_id = _list.run_id
and _period.rldnr = doc.rldnr
{
key doc.docref as MaterialLedgerDocRef,
key doc.curtp as CurrencyRole,
doc.rldnr as Ledger,
cast ( doc.jahrper as fins_fyearperiod ) as FiscalYearPeriod,
doc.xabr as MatlLdgrDocIsCostingRelevant,
doc.categ as MaterialLedgerCategory,
doc.ptyp as ProcessCategory, //doc.PTYP ,
doc.kalnr as CostEstimate,
hd.matnr as Material,
doc.posart as MaterialLedgerItemType,
doc.bvalt as ProcurementAlternative, //bvalt
doc.process as ProductionProcess, //doc.PROCESS,
@Semantics.quantity.unitOfMeasure: 'ValuationQuantityUnit'
doc.quant as ValuationQuantity, //quant
doc.meins as ValuationQuantityUnit, //meins
@Semantics.amount.currencyCode: 'Currency'
doc.stval as InventoryAmtInCCCrcy, //stval
@Semantics.amount.currencyCode: 'Currency'
doc.prd as PriceDifferenceAmtInCCCrcy, //prd
@Semantics.amount.currencyCode: 'Currency'
doc.kdm as ExchRateDiffAmtInCoCodeCrcy, //kdm
doc.waers as Currency, //waers
doc.aufnr as ProductionOrder,
doc.eqnum as EquivalenceNumberOfJntProdn,
doc.budat as PostingDate,
doc.werks as Plant,
doc.awtyp as ReferenceDocumentType,
doc.awref as SourceReferenceDocument,
doc.aworg as ReferenceDocumentContext,
doc.awitem as ReferenceDocumentItem,
doc.glvor as RefBusinessTransactionType,
doc.vgart as MaterialLedgerTransactionType,
doc.bwart as GoodsMovementType,
doc.kstar as CostElement,
_list.runref as CostingRunReference, //runref
_period.run_id as CostingRun, //period.RUN_ID,
_period.run_type as CostingRunType, //preiod.RUN_TYPE,
_period.last_day as LastDayOfMonthDate, //LAST_DAY,
_period.first_day as FirstDayOfMonthDate //FIRST_DAY
}
where
(
_list.runref like 'ACT__'
and doc.rldnr = substring(_list.runref,4,2)
)
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