P_EnhPhysInvtryActvStkSepVal

DDL: P_ENHPHYSINVTRYACTVSTKSEPVAL SQL: PPIEACTSTKSEPVL Type: view COMPOSITE

P_EnhPhysInvtryActvStkSepVal is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_PhysInvtryDocItemPerYear, P_EnhPhysInvtryActvStkSep) and exposes 41 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
P_PhysInvtryDocItemPerYear P_PhysInvtryDocItemPerYear left_outer
P_EnhPhysInvtryActvStkSep sep from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_ProductPlantBasic _ProductPlantBasic $projection.Material = _ProductPlantBasic.Product and $projection.Plant = _ProductPlantBasic.Plant

Annotations (7)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName PPIEACTSTKSEPVL view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_ALLOWED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (41)

KeyFieldSource TableSource FieldDescription
KEY Material
KEY Plant P_EnhPhysInvtryActvStkSep Plant Valuation Area
KEY StorageLocation
KEY Batch P_EnhPhysInvtryActvStkSep Batch Lot No.
KEY Supplier P_EnhPhysInvtryActvStkSep Supplier Supplier
KEY SalesOrder P_EnhPhysInvtryActvStkSep SalesOrder SD Document
KEY SalesOrderItem P_EnhPhysInvtryActvStkSep SalesOrderItem Sales Order Item
KEY WBSElement P_EnhPhysInvtryActvStkSep WBSElement WBS Internal ID
KEY Customer P_EnhPhysInvtryActvStkSep Customer Sold-to Party
KEY StockOwner P_EnhPhysInvtryActvStkSep StockOwner Owner of stock
KEY InventoryStockType P_EnhPhysInvtryActvStkSep InventoryStockType Stock Type
KEY InventorySpecialStockType P_EnhPhysInvtryActvStkSep InventorySpecialStockType Special Stock Type
KEY MaterialBaseUnit P_EnhPhysInvtryActvStkSep MaterialBaseUnit Valuation Unit
KEY MaterialIsPostedToStock P_EnhPhysInvtryActvStkSep MaterialIsPostedToStock
Batchendascharg_dasRealProductBatch
CycleCountType CycleCountType Cycle Count Type
NmbrOfPhysInvtryPerFiscalYear NmbrOfPhysInvtryPerFiscalYear
PhysInvtryIntvlForCycCounting PhysInvtryIntvlForCycCounting
PhysInvtryFloatTimeCycCounting PhysInvtryFloatTimeCycCounting
WBSElementInternalID P_EnhPhysInvtryActvStkSep WBSElementInternalID WBS Internal ID
ProductType ProductType Product Type Group
ProductGroup P_EnhPhysInvtryActvStkSep ProductGroup Product Sold Group
CompanyCodeCurrency CompanyCodeCurrency Local Currency
MatlWrhsStkQtyInMatlBaseUnit MatlWrhsStkQtyInMatlBaseUnit Quantity
SalesOrderelseendasSalesOrderVal
InventoryValuationType
SearchForValuationType batch InventoryValuationType Valuation Type
PhysicalInventoryLastCountDate PhysicalInventoryLastCountDate Count Date
NumberOfPhysInventoryCounts NumberOfPhysInventoryCounts
NmbrOfDaysSinceLastPInvCount NmbrOfDaysSinceLastPInvCount
PhysicalInventoryItemIsCounted PhysicalInventoryItemIsCounted Is Counted
GdsIssQtySinceLastCountInBsUnt
AvgStkQtySinceLastCountCorrect
DifferenceAmtPerYrInCoCodeCrcy DifferenceAmtPerYrInCoCodeCrcy
NrOfGdsMvtSinceLastPInvCnt
NumberOfPInvAdjustmentsPerYear
PInvDiffQtyPerYearInBaseUnit
NrOfGdsRcptSinceLastPInvCount
GdsRcptQtySinceLastCtInBsUnt
NrOfGoodsIssSinceLastPInvCount
CurrentDate CurrentDate

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_EnhPhysInvtryActvStkSepVal.
-- 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: PPIEACTSTKSEPVL

CREATE VIEW P_EnhPhysInvtryActvStkSepVal AS
SELECT
  cast(sep.Material as matnr preserving type) AS Material,
  sep.Plant AS Plant,
  cast(sep.StorageLocation as pi_storage_location preserving type) AS StorageLocation,
  sep.Batch AS Batch,
  sep.Supplier AS Supplier,
  sep.SalesOrder AS SalesOrder,
  sep.SalesOrderItem AS SalesOrderItem,
  sep.WBSElement AS WBSElement,
  sep.Customer AS Customer,
  sep.StockOwner AS StockOwner,
  sep.InventoryStockType AS InventoryStockType,
  sep.InventorySpecialStockType AS InventorySpecialStockType,
  sep.MaterialBaseUnit AS MaterialBaseUnit,
  sep.MaterialIsPostedToStock AS MaterialIsPostedToStock,
  cast( case when ( _ProductPlantBasic.ValuationCategory <> '' and _ProductPlantBasic.IsBatchManagementRequired = '' ) then ( '' ) else ( sep.Batch ) end as charg_d ) as RealProductBatch AS Batchendascharg_dasRealProductBatch,
  CycleCountType,
  NmbrOfPhysInvtryPerFiscalYear,
  PhysInvtryIntvlForCycCounting,
  PhysInvtryFloatTimeCycCounting,
  sep.WBSElementInternalID AS WBSElementInternalID,
  ProductType,
  sep.ProductGroup AS ProductGroup,
  CompanyCodeCurrency,
  MatlWrhsStkQtyInMatlBaseUnit,
  case when ( sep.InventorySpecialStockType = 'E' or sep.InventorySpecialStockType = 'F' ) and sd.InventorySpecialStockValnType = 'M' then sep.SalesOrder else '' end as SalesOrderVal AS SalesOrderelseendasSalesOrderVal,
  coalesce(batch.InventoryValuationType, '') AS InventoryValuationType,
  batch.InventoryValuationType AS SearchForValuationType,
  PhysicalInventoryLastCountDate,
  NumberOfPhysInventoryCounts,
  NmbrOfDaysSinceLastPInvCount,
  PhysicalInventoryItemIsCounted,
  cast(GdsIssQtySinceLastCountInBsUnt as pi_gi_qty_since_last_cnt) AS GdsIssQtySinceLastCountInBsUnt,
  FLTP_TO_DEC( AvgStkQtySinceLastCountCorrect as abap.dec(31,14) ) AS AvgStkQtySinceLastCountCorrect,
  DifferenceAmtPerYrInCoCodeCrcy,
  cast(NrOfGdsMvtSinceLastPInvCnt as pi_nr_of_gm_since_last_cnt) AS NrOfGdsMvtSinceLastPInvCnt,
  cast(NumberOfPInvAdjustmentsPerYear as pi_nr_of_adjstmnt_per_year) AS NumberOfPInvAdjustmentsPerYear,
  cast(PInvDiffQtyPerYearInBaseUnit as pi_difference_qty_per_year) AS PInvDiffQtyPerYearInBaseUnit,
  cast(NrOfGdsRcptSinceLastPInvCount as pi_nr_of_gr_since_last_cnt) AS NrOfGdsRcptSinceLastPInvCount,
  cast(GdsRcptQtySinceLastCtInBsUnt as pi_gr_qty_since_last_cnt) AS GdsRcptQtySinceLastCtInBsUnt,
  cast(NrOfGoodsIssSinceLastPInvCount as pi_nr_of_gi_since_last_cnt) AS NrOfGoodsIssSinceLastPInvCount,
  CurrentDate
FROM P_EnhPhysInvtryActvStkSep AS sep
LEFT OUTER JOIN P_PhysInvtryDocItemPerYear ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_ProductPlantBasic AS _ProductPlantBasic ON Material = _ProductPlantBasic.Product AND Plant = _ProductPlantBasic.Plant  -- association [0..1]
;