C_CN_MaterialStockSum
China Stock Summary for Material
C_CN_MaterialStockSum is a Consumption CDS View that provides data about "China Stock Summary for Material" in SAP S/4HANA. It reads from 1 data source (I_CN_MaterialStockDetail) and exposes 36 fields with key fields Plant, StockIdentifyingBatch, InventoryValuationType, GoodsMovementType, StockIdfgStorageLocation. It has 1 association to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_CN_MaterialStockDetail | I_CN_MaterialStockDetail | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_FromPostingDate | budat | |
| P_ToPostingDate | budat | |
| P_IsReversal | char1 |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | I_CN_MaterialStockDetail | _child | $projection.StockIdentifyingMaterial = _child.StockIdentifyingMaterial and _detail.Plant = _child.Plant and _detail.StockIdfgStorageLocation = _child.StockIdfgStorageLocation and _detail.StockIdentifyingBatch = _child.StockIdentifyingBatch and _detail.InventoryValuationType = _child.InventoryValuationType and _detail.GoodsMovementType = _child.GoodsMovementType |
Annotations (16)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | CCNMATSTKSUM | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | China Stock Summary for Material | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| UI.headerInfo.typeName | Items | view | |
| UI.headerInfo.typeNamePlural | Items | view | |
| UI.headerInfo.title.value | StockIdentifyingMaterial | view | |
| UI.headerInfo.title.label | Material | view | |
| UI.headerInfo.description.value | MaterialDescription | view | |
| UI.headerInfo.description.label | MaterialDescription | view |
Fields (36)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| P_FromPostingDate | ||||
| P_ToPostingDate | ||||
| KEY | Plant | Plant | Valuation Area | |
| KEY | StockIdentifyingBatch | StockIdentifyingBatch | ||
| KEY | InventoryValuationType | InventoryValuationType | Valuation Type | |
| KEY | GoodsMovementType | GoodsMovementType | Movement Type | |
| KEY | StockIdfgStorageLocation | StockIdfgStorageLocation | ||
| KEY | MaterialBaseUnit | _detail | BaseUnit | Unit of Measure |
| KEY | CompanyCode | CompanyCode | Receiver Company Code | |
| KEY | InventorySpecialStockType | InventorySpecialStockType | Special Stock Type | |
| KEY | CompanyCodeCurrency | CompanyCodeCurrency | Local Currency | |
| MaterialGroup | MaterialGroup | Product Group | ||
| MaterialGroupName | MaterialGroupName | Material Group Name | ||
| MaterialType | MaterialType | Material Type | ||
| MaterialTypeName | MaterialTypeName | Material Type Name | ||
| MaterialDescription | MaterialDescription | Material Description | ||
| StandardPriceInCoCodeCrcy | StandardPriceInCoCodeCrcy | Standard price | ||
| CompanyCodeName | CompanyCodeName | Company Name | ||
| StorageLocationName | StorageLocationName | StorageLocation name | ||
| PlantName | PlantName | Plant Name | ||
| AccountingDocumentIsExcluded | AccountingDocumentIsExcluded | Accounting Indicator Code | ||
| IsCrossPlantTransfer | IsCrossPlantTransfer | Is Cross Plant Transfer | ||
| IsStorageLocChangeByTransf | IsStorageLocChangeByTransf | Is Cross Storage Location Transfer | ||
| IsBatchChangeByTransf | IsBatchChangeByTransf | Is Cross Batch Transfer | ||
| MatlStkIncrQtyInMatlBaseUnit | Total Goods Receipt Quantity | |||
| GoodsMovementStkAmtInCCCrcy | Total Goods Receipt Value | |||
| MatlStkDecrQtyInMatlBaseUnit | Total Goods Issue Quantity | |||
| MatlStkDecrQtyAmountInCCCrcy | Total Goods Issue Value | |||
| PeriodStartStockQuantity | Initial Stock Quantity | |||
| PeriodStartStockAmountInCoCrcy | Initial Stock Value | |||
| MatlStkPerdStrtPriceInCCCrcy | Initial Unit Price | |||
| CN_MatlsStkSpclStkNoValStrtQty | Non valuation of special stock Initial Stock Qty | |||
| MatlStkPerdEndPriceInCCCrcy | Closing Unit Price | |||
| MatlStkCreditRevalAmtInCCCrcy | Credit | |||
| MatlStkDebitRevalAmtInCCCrcy | Debit | |||
| _child | _child |
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 C_CN_MaterialStockSum.
-- 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: CCNMATSTKSUM
-- Parameters: P_FromPostingDate : budat, P_ToPostingDate : budat, P_IsReversal : char1
CREATE VIEW C_CN_MaterialStockSum AS
SELECT
defaultValue: '20210331' AS P_FromPostingDate,
P_ToPostingDate : $parameters.P_ToPostingDate AS P_ToPostingDate,
Plant,
StockIdentifyingBatch,
InventoryValuationType,
GoodsMovementType,
StockIdfgStorageLocation,
_detail.BaseUnit AS MaterialBaseUnit,
CompanyCode,
InventorySpecialStockType,
CompanyCodeCurrency,
MaterialGroup,
MaterialGroupName,
MaterialType,
MaterialTypeName,
MaterialDescription,
StandardPriceInCoCodeCrcy,
CompanyCodeName,
StorageLocationName,
PlantName,
AccountingDocumentIsExcluded,
IsCrossPlantTransfer,
IsStorageLocChangeByTransf,
IsBatchChangeByTransf,
sum ( case when PostingDate >= :P_FromPostingDate and PostingDate <= :P_ToPostingDate then MatlStkIncrQtyInMatlBaseUnit else 0 end ) AS MatlStkIncrQtyInMatlBaseUnit,
sum ( case when PostingDate >= :P_FromPostingDate and PostingDate <= :P_ToPostingDate then MatlStkIncrQtyAmountInCCCrcy else 0 end ) AS GoodsMovementStkAmtInCCCrcy,
sum ( case when PostingDate >= :P_FromPostingDate and PostingDate <= :P_ToPostingDate then MatlStkDecrQtyInMatlBaseUnit else 0 end ) AS MatlStkDecrQtyInMatlBaseUnit,
sum ( case when PostingDate >= :P_FromPostingDate and PostingDate <= :P_ToPostingDate then MatlStkDecrQtyAmountInCCCrcy else 0 end ) AS MatlStkDecrQtyAmountInCCCrcy,
sum ( case when PostingDate < :P_FromPostingDate then MatlStkChangeQtyInBaseUnit else 0 end ) AS PeriodStartStockQuantity,
sum ( case when PostingDate < :P_FromPostingDate then GoodsMovementStkAmtInCCCrcy else 0 end ) AS PeriodStartStockAmountInCoCrcy,
cast( '99999999' as nsdm_dmbtr_stock ) AS MatlStkPerdStrtPriceInCCCrcy,
sum ( case when ( PostingDate < :P_FromPostingDate) and ( CN_MatlsStkSpclStkIsNoValFlag = 'X') then MatlStkChangeQtyInBaseUnit else 0 end ) AS CN_MatlsStkSpclStkNoValStrtQty,
cast( '99999999' as nsdm_dmbtr_stock ) AS MatlStkPerdEndPriceInCCCrcy,
cast( '99999999' as j_3rm_credreval ) AS MatlStkCreditRevalAmtInCCCrcy,
cast( '99999999' as j_3rm_debreval ) AS MatlStkDebitRevalAmtInCCCrcy
FROM I_CN_MaterialStockDetail
LEFT OUTER JOIN I_CN_MaterialStockDetail AS _child ON StockIdentifyingMaterial = _child.StockIdentifyingMaterial AND _detail.Plant = _child.Plant AND _detail.StockIdfgStorageLocation = _child.StockIdfgStorageLocation AND _detail.StockIdentifyingBatch = _child.StockIdentifyingBatch AND _detail.InventoryValuationType = _child.InventoryValuationType AND _detail.GoodsMovementType = _child.GoodsMovementType -- association [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