P_FirstStockOutValues
First Stock Out Values
P_FirstStockOutValues is a Consumption CDS View that provides data about "First Stock Out Values" in SAP S/4HANA. It reads from 1 data source (PPH_DDL_DDMRP_PROJCTD_STCK_AOR) and exposes 20 fields with key fields Material, Plant, MRPArea.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| PPH_DDL_DDMRP_PROJCTD_STCK_AOR | PPH_DDL_DDMRP_PROJCTD_STCK_AOR | from |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PFIRSTSTKVAL | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | First Stock Out Values | view |
Fields (20)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | _pstk | matnr | Vehicle Model |
| KEY | Plant | _pstk | werks | Receiving Plant |
| KEY | MRPArea | _pstk | berid | Single-Character Flag |
| MaterialSafetyStockQty | _pstk | sft_stk | ||
| DecoupledLeadTime | _pstk | decoupled_lead_time_date | ||
| StockOutAlertIsPresent | first_below_zero | |||
| below_zero_dateendasFirstStkOutDate | ||||
| dec132endasFirstStkOutProjtdSFTPct | ||||
| ThresholdAlertIsPresent | first_below_on_hand_alrt_thld | |||
| below_thld_dateendasFirstBelowThldDate | ||||
| dec132endasFirstBelowThldProjtdSFTPct | ||||
| SafetyStockAlertIsPresent | first_below_safety | |||
| below_sft_dateendasFirstBelowSFTDate | ||||
| dec132endasFirstBelowSFTProjtdSFTPct | ||||
| NetFlowPositionQuantity | ||||
| OpenSupplyQuantity | _pstk | open_supply | ||
| open_demandasOpenDemandQuantity | ||||
| spike_demandasBufferSpikeThreshold | ||||
| OnHandStockQuantity | ||||
| spike_demandasQualifiedDemandQuantity |
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_FirstStockOutValues.
-- 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: PFIRSTSTKVAL
CREATE VIEW P_FirstStockOutValues AS
SELECT
_pstk.matnr AS Material,
_pstk.werks AS Plant,
_pstk.berid AS MRPArea,
_pstk.sft_stk AS MaterialSafetyStockQty,
_pstk.decoupled_lead_time_date AS DecoupledLeadTime,
first_below_zero AS StockOutAlertIsPresent,
case when first_below_zero = 'X' then _pstk.below_zero_date end as FirstStkOutDate AS below_zero_dateendasFirstStkOutDate,
case when first_below_zero = 'X' and _pstk.below_zero_sft_stk != 0.000 then cast(((cast(1 as abap.dec(13,4)) - (DIVISION((_pstk.below_zero_sft_stk - _pstk.below_zero_proj_stk), _pstk.below_zero_sft_stk, 4))) * 100) as abap.dec(13,2)) end as FirstStkOutProjtdSFTPct AS dec132endasFirstStkOutProjtdSFTPct,
first_below_on_hand_alrt_thld AS ThresholdAlertIsPresent,
case when first_below_on_hand_alrt_thld = 'X' then _pstk.below_thld_date end as FirstBelowThldDate AS below_thld_dateendasFirstBelowThldDate,
case when first_below_on_hand_alrt_thld = 'X' and _pstk.below_thld_sft_stk != 0.000 then cast(((cast(1 as abap.dec(13,4)) - (DIVISION((_pstk.below_thld_sft_stk - _pstk.below_thld_proj_stk), _pstk.below_thld_sft_stk, 4))) * 100) as abap.dec(13,2)) end as FirstBelowThldProjtdSFTPct AS dec132endasFirstBelowThldProjtdSFTPct,
first_below_safety AS SafetyStockAlertIsPresent,
case when first_below_safety = 'X' then _pstk.below_sft_date end as FirstBelowSFTDate AS below_sft_dateendasFirstBelowSFTDate,
case when first_below_safety = 'X' and _pstk.below_sft_sft_stk != 0.000 then cast(((cast(1 as abap.dec(13,4)) - (DIVISION((_pstk.below_sft_sft_stk - _pstk.below_sft_proj_stk), _pstk.below_sft_sft_stk, 4))) * 100) as abap.dec(13,2)) end as FirstBelowSFTProjtdSFTPct AS dec132endasFirstBelowSFTProjtdSFTPct,
coalesce( ((_pstk.on_hand_stock + _pstk.open_supply)- (_pstk.open_demand + _pstk.spike_demand)), 0 ) AS NetFlowPositionQuantity,
_pstk.open_supply AS OpenSupplyQuantity,
coalesce(_pstk.on_hand_stock,0) AS OnHandStockQuantity
FROM PPH_DDL_DDMRP_PROJCTD_STCK_AOR
;
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