P_PurchaseOrderNetAmountP01
Calculate Net Amount of Purchase Order
P_PurchaseOrderNetAmountP01 is a Consumption CDS View that provides data about "Calculate Net Amount of Purchase Order" in SAP S/4HANA. It reads from 2 data sources (I_PurchaseOrder, I_PurchaseOrderItem) and exposes 2 fields with key field PurchaseOrder. Part of development package ODATA_MM_ANALYTICS.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrder | PurchaseOrder | from |
| I_PurchaseOrderItem | PurchaseOrderItem | inner |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | vdm_validitystart | |
| P_EndDate | vdm_validityend |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | I_PurchaseOrder | PurchaseOrder | |
| DisplayCurrency |
@VDM.viewType : #CONSUMPTION
@VDM.private: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view entity P_PurchaseOrderNetAmountP01
with parameters
P_DisplayCurrency : displaycurrency,
P_StartDate : vdm_validitystart,
P_EndDate : vdm_validityend
as select from I_PurchaseOrder as PurchaseOrder
inner join I_PurchaseOrderItem as PurchaseOrderItem on PurchaseOrder.PurchaseOrder = PurchaseOrderItem.PurchaseOrder
{
key PurchaseOrder.PurchaseOrder,
cast( $parameters.P_DisplayCurrency as displaycurrency) as DisplayCurrency,
@Semantics.amount.currencyCode: 'DisplayCurrency'
sum( currency_conversion( amount => PurchaseOrderItem.NetAmount,
source_currency => PurchaseOrderItem.DocumentCurrency,
target_currency => $parameters.P_DisplayCurrency,
exchange_rate_date => PurchaseOrder.PurchaseOrderDate,
exchange_rate_type => 'M',
error_handling => 'FAIL_ON_ERROR'
) ) as PurOrdNetAmountInDisplayCrcy
}
where
PurchaseOrder.PurchasingDocumentDeletionCode = ''
and PurchaseOrderItem.PurchasingDocumentDeletionCode = ''
and PurchaseOrder.PurchaseOrderDate between $parameters.P_StartDate and $parameters.P_EndDate
and PurchaseOrderItem.DocumentCurrency != ''
group by
PurchaseOrder.PurchaseOrder
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