I_PrepaymentDocumentMarketData
Market Value for the Prepayment Document
I_PrepaymentDocumentMarketData is a Composite CDS View that provides data about "Market Value for the Prepayment Document" in SAP S/4HANA. It reads from 1 data source (I_PrepaymentDocFixedValData) and exposes 10 fields with key fields PrepaymentRefDocCondition, PrepaymentRefDocConditionItem.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PrepaymentDocFixedValData | PricingVal | from |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Market Value for the Prepayment Document | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (10)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PrepaymentRefDocCondition | I_PrepaymentDocFixedValData | PrepaymentRefDocCondition | |
| KEY | PrepaymentRefDocConditionItem | I_PrepaymentDocFixedValData | PrepaymentRefDocConditionItem | |
| TradingContract | I_PrepaymentDocFixedValData | TradingContract | ||
| CompanyCode | I_PrepaymentDocFixedValData | CompanyCode | ||
| Counterparty | I_PrepaymentDocFixedValData | Counterparty | ||
| PurchasingDocumentItem | ||||
| curr232asPrepaymentTotalAmt | ||||
| PrepaymentRefDocFixedPriceCrcy | I_PrepaymentDocFixedValData | PrepaymentRefDocFixedPriceCrcy | ||
| PrepaymentTotalAmtIsFixedPrice | I_PrepaymentDocFixedValData | PrepaymentTotalAmtIsFixedPrice | ||
| PrepaymentWrkCtrDocPricingOptn | I_PrepaymentDocFixedValData | PrepaymentWrkCtrDocPricingOptn |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Market Value for the Prepayment Document'
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType : #COMPOSITE
@ObjectModel.usageType :
{serviceQuality : #D,
sizeCategory : #L,
dataClass : #MIXED}
------------------------------------------------------------------------------------------------
-- This view will calculate Market Price and Document Item Total Amount in Document Currency
-- Document Item Total Amount = Fixed Price + Market Price
-- where Market Price = Market Quantity * Market Unit Price (Basis/Future)
------------------------------------------------------------------------------------------------
define view entity I_PrepaymentDocumentMarketData
as select from I_PrepaymentDocFixedValData as PricingVal
{
key PricingVal.PrepaymentRefDocCondition as PrepaymentRefDocCondition,
key PricingVal.PrepaymentRefDocConditionItem as PrepaymentRefDocConditionItem,
PricingVal.TradingContract,
PricingVal.CompanyCode,
PricingVal.Counterparty,
cast( right( PricingVal.PrepaymentRefDocConditionItem, 5 ) as abap.numc(5)) as PurchasingDocumentItem,
@Semantics.amount.currencyCode: 'PrepaymentRefDocFixedPriceCrcy'
cast(cast( sum(
case when PricingVal.MTMCalculationGroup = 'B' -- Basis
then curr_to_decfloat_amount(PricingVal.PrepaymentRefDocFixedPrice) +
PricingVal.PrepaymentDocCmmdtyMarketQty *
coalesce(round(curr_to_decfloat_amount(PricingVal.PrepaymentRefDocBasisPrice),4) ,
curr_to_decfloat_amount(PricingVal.ConditionTermRate))
when PricingVal.MTMCalculationGroup = 'F' -- Future
then curr_to_decfloat_amount(PricingVal.PrepaymentRefDocFixedPrice) +
PricingVal.PrepaymentDocCmmdtyMarketQty *
coalesce( round( curr_to_decfloat_amount(PricingVal.PrepaymentRefDocFuturePrice) ,4),
curr_to_decfloat_amount(PricingVal.ConditionTermRate ))
else 0 end ) as abap.dec(23,2)) as abap.curr(23,2)) as PrepaymentTotalAmt,
PricingVal.PrepaymentRefDocFixedPriceCrcy as PrepaymentRefDocFixedPriceCrcy,
PricingVal.PrepaymentTotalAmtIsFixedPrice as PrepaymentTotalAmtIsFixedPrice,
PricingVal.PrepaymentWrkCtrDocPricingOptn as PrepaymentWrkCtrDocPricingOptn
}
group by PricingVal.PrepaymentRefDocCondition,
PricingVal.TradingContract,
PricingVal.PrepaymentRefDocConditionItem,
PricingVal.PrepaymentRefDocFixedPriceCrcy,
PricingVal.PrepaymentTotalAmtIsFixedPrice,
PricingVal.CompanyCode,
PricingVal.Counterparty,
PricingVal.PrepaymentWrkCtrDocPricingOptn
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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