I_MaterialKPIForCycleCounting

DDL: I_MATERIALKPIFORCYCLECOUNTING Type: view_entity COMPOSITE Package: ODATA_MM_IM_PI_CYC_MAINT

I View Material KPIs fory Cycle Counting

I_MaterialKPIForCycleCounting is a Composite CDS View that provides data about "I View Material KPIs fory Cycle Counting" in SAP S/4HANA. It reads from 3 data sources (I_Productplantstorage, P_MaterialKPIForCycleCounting, P_PlantsWithCycleCountInd) and exposes 22 fields with key fields Plant, Material. It has 3 associations to related views. Part of development package ODATA_MM_IM_PI_CYC_MAINT.

Data Sources (3)

SourceAliasJoin Type
I_Productplantstorage masterData from
P_MaterialKPIForCycleCounting P_MaterialKPIForCycleCounting left_outer
P_PlantsWithCycleCountInd plants inner

Parameters (3)

NameTypeDefault
P_StartDate nsdm_reference_startdate
P_EndDate nsdm_reference_enddate
P_InventoryConsumptionGroup inventory_consumption_group

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_CycleCountingSettings _CycleCounting _CycleCounting.CycleCountType = $projection.CycleCountType and _CycleCounting.Plant = masterData.Plant
[0..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_PlantCompanyCodeCurrency _PlantCompanyCodeCurrency $projection.Plant = _PlantCompanyCodeCurrency.Plant

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
EndUserText.label I View Material KPIs fory Cycle Counting view

Fields (22)

KeyFieldSource TableSource FieldDescription
KEY Plant I_Productplantstorage Plant Valuation Area
KEY Material I_Productplantstorage Product Product Sold
PlantName _Plant PlantName Plant Name
MaterialName
MaterialGroup
MaterialGroupName
MaterialType
MaterialTypeName
NmbrOfPhysInvtryPerFiscalYear
PhysInvtryIntvlForCycCounting _CycleCounting PhysInvtryIntvlForCycCounting
PhysInvtryFloatTimeCycCounting _CycleCounting PhysInvtryFloatTimeCycCounting
CycleCountingIndicatorIsFixed
MaterialBaseUnit
StockValueInCCCrcyEnd
Currency _PlantCompanyCodeCurrency Currency Valuation Crcy
AvgMatlStkQtyInMatlBaseUnit
AvgMatlStkAmountInCompanyCrcy
CnsmpnQtyInBaseUnitInPeriod
CnsmpnAmountInCCCrcyInPeriod
InventoryTurnover
PInvDiffQtyPerYearInBaseUnit
DifferenceAmtPerYrInCoCodeCrcy

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 I_MaterialKPIForCycleCounting.
-- 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.
-- Parameters: P_StartDate : nsdm_reference_startdate, P_EndDate : nsdm_reference_enddate, P_InventoryConsumptionGroup : inventory_consumption_group

CREATE VIEW I_MaterialKPIForCycleCounting AS
SELECT
  masterData.Plant AS Plant,
  masterData.Product AS Material,
  _Plant.PlantName AS PlantName,
  masterData._Product._Text[1: Language=$session.system_language].ProductName AS MaterialName,
  cast( masterData._Product.ProductGroup as matkl preserving type ) AS MaterialGroup,
  cast( masterData._Product._ProductGroupText[1: Language=$session.system_language].MaterialGroupName as nsdm_wgbez preserving type ) AS MaterialGroupName,
  cast( masterData._Product.ProductType as mtart preserving type ) AS MaterialType,
  cast( masterData._Product._ProductTypeName[1: Language=$session.system_language].MaterialTypeName as nsdm_mtbez preserving type ) AS MaterialTypeName,
  cast( _CycleCounting.NmbrOfPhysInvtryPerFiscalYear as nsdm_cyclecountsperyear ) AS NmbrOfPhysInvtryPerFiscalYear,
  _CycleCounting.PhysInvtryIntvlForCycCounting AS PhysInvtryIntvlForCycCounting,
  _CycleCounting.PhysInvtryFloatTimeCycCounting AS PhysInvtryFloatTimeCycCounting,
  cast( masterData.CycleCountingIndicatorIsFixed as nsdm_cyclecountingindisfixed ) AS CycleCountingIndicatorIsFixed,
  masterData._Product.BaseUnit AS MaterialBaseUnit,
  cast( kpi.StockValueInCCCrcyEnd as nsdm_stockvalueonenddate) AS StockValueInCCCrcyEnd,
  _PlantCompanyCodeCurrency.Currency AS Currency,
  cast(kpi.AvgMatlStkQtyInMatlBaseUnit as nsdm_avgmatlstkqtyinbaseunit) AS AvgMatlStkQtyInMatlBaseUnit,
  cast(kpi.AvgMatlStkAmountInCompanyCrcy as nsdm_avgmatlstkamountincccrcy) AS AvgMatlStkAmountInCompanyCrcy,
  cast(kpi.CnsmpnQtyInBaseUnitInPeriod as nsdm_cnsmpnqtyinperiodinbuom) AS CnsmpnQtyInBaseUnitInPeriod,
  cast(kpi.CnsmpnAmountInCCCrcyInPeriod as nsdm_cnsmpnvalinperiodinccc) AS CnsmpnAmountInCCCrcyInPeriod,
  cast(kpi.InventoryTurnover as nsdm_inventoryturnover) AS InventoryTurnover,
  cast(kpi.PInvDiffQtyPerYearInBaseUnit as pi_difference_qty_per_year) AS PInvDiffQtyPerYearInBaseUnit,
  cast(kpi.DifferenceAmtPerYrInCoCodeCrcy as nsdm_differenceamtperyrinccc) AS DifferenceAmtPerYrInCoCodeCrcy
FROM I_Productplantstorage AS masterData
INNER JOIN P_PlantsWithCycleCountInd AS plants ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_MaterialKPIForCycleCounting ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_CycleCountingSettings AS _CycleCounting ON _CycleCounting.CycleCountType = CycleCountType AND _CycleCounting.Plant = masterData.Plant  -- association [0..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [0..1]
LEFT OUTER JOIN I_PlantCompanyCodeCurrency AS _PlantCompanyCodeCurrency ON Plant = _PlantCompanyCodeCurrency.Plant  -- association [0..1]
;