P_StockLevelMngNumFields

DDL: P_STOCKLEVELMNGNUMFIELDS SQL: PSTCKLVLMNGNUM Type: view CONSUMPTION Package: ODATA_PP_DD_STLM

Numeric Fields for Stock Level Management

P_StockLevelMngNumFields is a Consumption CDS View that provides data about "Numeric Fields for Stock Level Management" in SAP S/4HANA. It reads from 1 data source (P_StockLevelMngCalcFields) and exposes 60 fields with key fields MRPArea, Material, Plant, ProposalStartDate, ProposalVersion. It has 1 association to related views. Part of development package ODATA_PP_DD_STLM.

Data Sources (1)

SourceAliasJoin Type
P_StockLevelMngCalcFields _CalFields from

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_DifferenceInDaysText _DifferenceInDaysText _DifferenceInDaysText.DifferenceInDays = _CalFields.DifferenceInDaysDesc and _DifferenceInDaysText.Language = $session.system_language

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PSTCKLVLMNGNUM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #CONSUMPTION view

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY MRPArea MRPArea MRP Area
KEY Material Material Vehicle Model
KEY Plant Plant Valuation Area
KEY ProposalStartDate P_StockLevelMngCalcFields ProposalStartDate
KEY ProposalVersion P_StockLevelMngCalcFields ProposalVersion
AvgDailyUsageHorizonEndDate
AvgDailyUsageHorizonStartDate
BufLvlProposalHorizonStartDate
AvgDailyUsageDifference
LeadTimeDifference
VariabilityFactorDifference
LeadTimeFactorDifference
AvgDailyUsageDeviationRate
VariabilityFactorDeviationRate
LeadTimeDeviationRate
LeadTimeFactorDeviationRate
CurrentRedZone CurrentRedZone
CurrentYellowZone CurrentYellowZone
CurrentGreenZone CurrentGreenZone
ProposedRedZone ProposedRedZone
ProposedYellowZone ProposedYellowZone
ProposedGreenZone ProposedGreenZone
RedZoneDifference RedZoneDifference
YellowZoneDifference YellowZoneDifference
GreenZoneDifference GreenZoneDifference
MaxStockDifference
CurrentLeadTime P_StockLevelMngCalcFields CurrentLeadTime
BufferLevelStartDate P_StockLevelMngCalcFields BufferLevelStartDate
CurrentAverageDailyUsage P_StockLevelMngCalcFields CurrentAvgDailyUsage
CurrentLeadTimeFactor P_StockLevelMngCalcFields CurrentLeadTimeFactor
CurrentVariabilityFactor P_StockLevelMngCalcFields CurrentVariabilityFactor
ProposalEndDate P_StockLevelMngCalcFields ProposalEndDate
ProposedAverageDailyUsage P_StockLevelMngCalcFields ProposedAverageDailyUsage
ProposedLeadTime P_StockLevelMngCalcFields ProposedLeadTime
ProposedLeadTimeFactor P_StockLevelMngCalcFields ProposedLeadTimeFactor
ProposedVariabilityFactor P_StockLevelMngCalcFields ProposedVariabilityFactor
StockLevelProposalID P_StockLevelMngCalcFields StockLevelProposalID
StockLevelProposalStatus P_StockLevelMngCalcFields StockLevelProposalStatus
AvgDailyUsageUnit P_StockLevelMngCalcFields AvgDailyUsageUnit
ProposedMaterialBufferProfile P_StockLevelMngCalcFields ProposedMaterialBufferProfile
ProposedMatlBufferProfileText P_StockLevelMngCalcFields ProposedMatlBufferProfileText
ProcurementTypeDescription P_StockLevelMngCalcFields ProcurementTypeDescription
VariabilityDescription P_StockLevelMngCalcFields VariabilityDescription
ReplenishmentLeadTimeDesc P_StockLevelMngCalcFields ReplenishmentLeadTimeDesc
DifferenceInDaysDesc P_StockLevelMngCalcFields DifferenceInDaysDesc
UnitOfMeasure
ActualUnitOfMeasure
HorizonDaysInPast
MatlPrpslAdjmtFctrIsApplied P_StockLevelMngCalcFields MatlPrpslAdjmtFctrIsApplied
VariabilityQuantity P_StockLevelMngCalcFields VariabilityQuantity
VariabilityUnit P_StockLevelMngCalcFields VariabilityUnit
ReplenishmentLeadTimeValue P_StockLevelMngCalcFields ReplenishmentLeadTimeValue
ProposedMatlVariabilityCode P_StockLevelMngCalcFields ProposedMatlVariabilityCode
ProposedMatlVariabilityQty P_StockLevelMngCalcFields ProposedMatlVariabilityQty
ProposedMatlVariabilityUnit P_StockLevelMngCalcFields ProposedMatlVariabilityUnit
ProposedMatlLeadTimeCode P_StockLevelMngCalcFields ProposedMatlLeadTimeCode
ProposedMatlLeadTime P_StockLevelMngCalcFields ProposedMatlLeadTime
CurrentMatlLeadTimeCode P_StockLevelMngCalcFields CurrentMatlLeadTimeCode
CurrentMatlVariabilityCode P_StockLevelMngCalcFields CurrentMatlVariabilityCode
_StockActual _StockActual

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 P_StockLevelMngNumFields.
-- 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: PSTCKLVLMNGNUM

CREATE VIEW P_StockLevelMngNumFields AS
SELECT
  MRPArea,
  Material,
  Plant,
  _CalFields.ProposalStartDate AS ProposalStartDate,
  _CalFields.ProposalVersion AS ProposalVersion,
  dats_add_days(_CalFields.ProposalStartDate, -1*1, 'NULL') AS AvgDailyUsageHorizonEndDate,
  dats_add_days(_CalFields.ProposalStartDate,-1*(_CalFields.HorizonDaysInPast + 1), 'NULL') AS AvgDailyUsageHorizonStartDate,
  DATS_ADD_DAYS( cast(_CalFields.ProposalStartDate as dats) ,(-1 * cast(_CalFields.TotalNoOfDays as abap.int4)),'NULL') AS BufLvlProposalHorizonStartDate,
  cast(cast(division(AvgDailyUsageDifference, 1, 3) as abap.quan(13,3)) as pph_avgdailyusagedifference preserving type ) AS AvgDailyUsageDifference,
  cast(cast(division(LeadTimeDifference, 1, 2) as abap.dec(7,2)) as pph_leadtimedifference preserving type ) AS LeadTimeDifference,
  division(VariabilityFactorDifference, 1, 2) AS VariabilityFactorDifference,
  division(LeadTimeFactorDifference,1,2) AS LeadTimeFactorDifference,
  cast(fltp_to_dec(AvgDailyUsageDeviationRate as abap.dec( 12, 2 )) as pph_avgdailyusagedeviationrate preserving type ) AS AvgDailyUsageDeviationRate,
  fltp_to_dec(VariabilityFactorDeviationRate as abap.dec( 12, 2 )) AS VariabilityFactorDeviationRate,
  fltp_to_dec(LeadTimeDeviationRate as abap.dec( 12, 2 )) AS LeadTimeDeviationRate,
  cast(fltp_to_dec(LeadTimeFactorDeviationRate as abap.dec( 12, 2 )) as pph_leadtimedeviationrate preserving type ) AS LeadTimeFactorDeviationRate,
  CurrentRedZone,
  CurrentYellowZone,
  CurrentGreenZone,
  ProposedRedZone,
  ProposedYellowZone,
  ProposedGreenZone,
  RedZoneDifference,
  YellowZoneDifference,
  GreenZoneDifference,
  cast(cast(_CalFields.MaxStockDifference as abap.quan(13,3)) as pph_maxstockdifference preserving type) AS MaxStockDifference,
  _CalFields.CurrentLeadTime AS CurrentLeadTime,
  _CalFields.BufferLevelStartDate AS BufferLevelStartDate,
  _CalFields.CurrentAvgDailyUsage AS CurrentAverageDailyUsage,
  _CalFields.CurrentLeadTimeFactor AS CurrentLeadTimeFactor,
  _CalFields.CurrentVariabilityFactor AS CurrentVariabilityFactor,
  _CalFields.ProposalEndDate AS ProposalEndDate,
  _CalFields.ProposedAverageDailyUsage AS ProposedAverageDailyUsage,
  _CalFields.ProposedLeadTime AS ProposedLeadTime,
  _CalFields.ProposedLeadTimeFactor AS ProposedLeadTimeFactor,
  _CalFields.ProposedVariabilityFactor AS ProposedVariabilityFactor,
  _CalFields.StockLevelProposalID AS StockLevelProposalID,
  _CalFields.StockLevelProposalStatus AS StockLevelProposalStatus,
  _CalFields.AvgDailyUsageUnit AS AvgDailyUsageUnit,
  _CalFields.ProposedMaterialBufferProfile AS ProposedMaterialBufferProfile,
  _CalFields.ProposedMatlBufferProfileText AS ProposedMatlBufferProfileText,
  _CalFields.ProcurementTypeDescription AS ProcurementTypeDescription,
  _CalFields.VariabilityDescription AS VariabilityDescription,
  _CalFields.ReplenishmentLeadTimeDesc AS ReplenishmentLeadTimeDesc,
  _CalFields.DifferenceInDaysDesc AS DifferenceInDaysDesc,
  cast ('%' as meins) AS UnitOfMeasure,
  cast('TAG' as msehi ) AS ActualUnitOfMeasure,
  dats_days_between(_CalFields.ProposalStartDate, cast($session.system_date as sydatum) ) + cast(_CalFields.HorizonDaysInPast as abap.int4) AS HorizonDaysInPast,
  _CalFields.MatlPrpslAdjmtFctrIsApplied AS MatlPrpslAdjmtFctrIsApplied,
  _CalFields.VariabilityQuantity AS VariabilityQuantity,
  _CalFields.VariabilityUnit AS VariabilityUnit,
  _CalFields.ReplenishmentLeadTimeValue AS ReplenishmentLeadTimeValue,
  _CalFields.ProposedMatlVariabilityCode AS ProposedMatlVariabilityCode,
  _CalFields.ProposedMatlVariabilityQty AS ProposedMatlVariabilityQty,
  _CalFields.ProposedMatlVariabilityUnit AS ProposedMatlVariabilityUnit,
  _CalFields.ProposedMatlLeadTimeCode AS ProposedMatlLeadTimeCode,
  _CalFields.ProposedMatlLeadTime AS ProposedMatlLeadTime,
  _CalFields.CurrentMatlLeadTimeCode AS CurrentMatlLeadTimeCode,
  _CalFields.CurrentMatlVariabilityCode AS CurrentMatlVariabilityCode
FROM P_StockLevelMngCalcFields AS _CalFields
LEFT OUTER JOIN I_DifferenceInDaysText AS _DifferenceInDaysText ON _DifferenceInDaysText.DifferenceInDays = _CalFields.DifferenceInDaysDesc AND _DifferenceInDaysText.Language = $session.system_language  -- association [1..1]
;