P_InvPrice_Union_Old
P_InvPrice_Union_Old is a Basic CDS View in SAP S/4HANA. It reads from 1 data source (ckmlhd) and exposes 33 fields with key fields CostEstimate, Ledger, CurrencyRole. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| ckmlhd | hd | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_CalendarDate | calendardate |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | R_LedgerValuationCrcyRole | _CurrencyInfo | _CurrencyInfo.LedgerValuationCurrencyRole = cr.curtp |
| [0..1] | I_MatlLedgerValnCrcyRoleName | _MLCurrencyInfo | _MLCurrencyInfo.LedgerValuationCurrencyRole = cr.curtp and _MLCurrencyInfo.CompanyCode = tk.bukrs |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PINVPRUNIOLD | view | |
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #BASIC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view |
Fields (33)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CostEstimate | ckmlhd | kalnr | ProdCostEst.No. |
| KEY | Ledger | |||
| KEY | CurrencyRole | cr | curtp | Valuation Area |
| MaxFiscPerCKMLPP | zp | MaxFiscPerCKMLPP | ||
| FiscalPeriod | cr | poper | Posting periods | |
| FiscalYear | cr | bdatj | Year | |
| Material | ckmlhd | matnr | Vehicle Model | |
| ValuationArea | ckmlhd | bwkey | Valuation Area | |
| InventoryValuationType | ckmlhd | bwtar | Valuation Type | |
| SalesOrder | ckmlhd | vbeln | SD Sched. Agmt | |
| SalesOrderItem | ckmlhd | posnr | WBS Element | |
| Supplier | ckmlhd | lifnr | Vendor no. | |
| WBSElementInternalID | ckmlhd | pspnr | WBS Element | |
| CompanyCode | tk | bukrs | Value | |
| BaseUnit | pp | meins | Valuation Unit | |
| InventorySpecialStockType | ckmlhd | sobkz | Special Stock | |
| InventorySpecialStockValnType | ckmlhd | kzbws | Valuation | |
| IsSupplierStockValuation | ckmlhd | xobew | Vendor stk val. | |
| PriceDeterminationControl | ckmlhd | mlast | Price Determ. | |
| MatlPrcMigratedUntilFsclYrPerd | ckmlhd | price_sdm_yearper | Price SDM YearPeriod | |
| MaterialPriceControl | cr | vprsv | Price control | |
| MaterialPriceUnitQty | ||||
| Currency | cr | waers | Transaction Currency | |
| stprs0endasInventoryPrice | ||||
| StandardPrice | cr | stprs | Standard price | |
| MovingAveragePrice | cr | pvprs | Per. Unit Price | |
| LedgerName | _MLCurrencyInfo | LedgerName | Ledger Name | |
| CurrencyRoleName | _CurrencyInfo | CurrencyRoleName | ||
| LegalCurrencyRole | _CurrencyInfo | LegalCurrencyRole | ||
| LegalCurrencyRoleName | _CurrencyInfo | LegalCurrencyRoleName | ||
| AccountingValuationView | ||||
| AcctgValnVwSubviewCombinedName | _CurrencyInfo | AcctgValnVwSubviewCombinedName | ||
| LedgerValnCrcyRoleIsUsedInLogs | _MLCurrencyInfo | LedgerValnCrcyRoleIsUsedInLogs | Is Log. Curr. Type |
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_InvPrice_Union_Old.
-- 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: PINVPRUNIOLD
-- Parameters: P_CalendarDate : calendardate
CREATE VIEW P_InvPrice_Union_Old AS
SELECT
hd.kalnr AS CostEstimate,
coalesce(_MLCurrencyInfo.Ledger, cast(' ' as fins_ledger)) AS Ledger,
cr.curtp AS CurrencyRole,
zp.MaxFiscPerCKMLPP AS MaxFiscPerCKMLPP,
cr.poper AS FiscalPeriod,
cr.bdatj AS FiscalYear,
hd.matnr AS Material,
hd.bwkey AS ValuationArea,
hd.bwtar AS InventoryValuationType,
hd.vbeln AS SalesOrder,
hd.posnr AS SalesOrderItem,
hd.lifnr AS Supplier,
hd.pspnr AS WBSElementInternalID,
tk.bukrs AS CompanyCode,
pp.meins AS BaseUnit,
hd.sobkz AS InventorySpecialStockType,
hd.kzbws AS InventorySpecialStockValnType,
hd.xobew AS IsSupplierStockValuation,
hd.mlast AS PriceDeterminationControl,
hd.price_sdm_yearper AS MatlPrcMigratedUntilFsclYrPerd,
cr.vprsv AS MaterialPriceControl,
coalesce(cr.peinh, 1) AS MaterialPriceUnitQty,
cr.waers AS Currency,
case cr.vprsv when 'S' then coalesce(cr.stprs, 0) when 'V' then coalesce(cr.pvprs, 0) else coalesce(cr.stprs, 0) end as InventoryPrice AS stprs0endasInventoryPrice,
cr.stprs AS StandardPrice,
cr.pvprs AS MovingAveragePrice,
_MLCurrencyInfo.LedgerName AS LedgerName,
_CurrencyInfo.CurrencyRoleName AS CurrencyRoleName,
_CurrencyInfo.LegalCurrencyRole AS LegalCurrencyRole,
_CurrencyInfo.LegalCurrencyRoleName AS LegalCurrencyRoleName,
cast(_CurrencyInfo.AccountingValuationView as fins_valutyp) AS AccountingValuationView,
_CurrencyInfo.AcctgValnVwSubviewCombinedName AS AcctgValnVwSubviewCombinedName,
_MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs AS LedgerValnCrcyRoleIsUsedInLogs
FROM ckmlhd AS hd
LEFT OUTER JOIN R_LedgerValuationCrcyRole AS _CurrencyInfo ON _CurrencyInfo.LedgerValuationCurrencyRole = cr.curtp -- association [0..1]
LEFT OUTER JOIN I_MatlLedgerValnCrcyRoleName AS _MLCurrencyInfo ON _MLCurrencyInfo.LedgerValuationCurrencyRole = cr.curtp AND _MLCurrencyInfo.CompanyCode = tk.bukrs -- association [0..1]
;
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