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.
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_groupCREATE VIEW I_MaterialKPIForCycleCounting ASSELECT
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
INNERJOIN P_PlantsWithCycleCountInd AS plants ON /* join condition not captured in parsed metadata */
LEFTOUTERJOIN P_MaterialKPIForCycleCounting ON /* join condition not captured in parsed metadata */
LEFTOUTERJOIN I_CycleCountingSettings AS _CycleCounting ON _CycleCounting.CycleCountType = CycleCountType AND _CycleCounting.Plant = masterData.Plant -- association [0..1]LEFTOUTERJOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [0..1]LEFTOUTERJOIN I_PlantCompanyCodeCurrency AS _PlantCompanyCodeCurrency ON Plant = _PlantCompanyCodeCurrency.Plant -- association [0..1]
;