P_PhysInvtryDocItemPerYear
PI Difference per year
P_PhysInvtryDocItemPerYear is a Composite CDS View that provides data about "PI Difference per year" in SAP S/4HANA. It reads from 1 data source (P_MappedPhysInvtryItem) and exposes 16 fields. Part of development package ODATA_MM_IM_PI_MASS_CREATE.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_MappedPhysInvtryItem | P_MappedPhysInvtryItem | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_StartDate | vdm_v_start_date |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_ALLOWED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (16)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| Material | Material | |||
| Plant | Plant | |||
| StorageLocation | StorageLocation | |||
| Supplier | Supplier | |||
| Customer | Customer | |||
| Batch | Batch | |||
| InventorySpecialStockType | InventorySpecialStockType | |||
| InventoryStockType | InventoryStockType | |||
| SalesOrder | SalesOrder | |||
| SalesOrderItem | SalesOrderItem | |||
| WBSElementInternalID | WBSElementInternalID | |||
| StockOwner | StockOwner | |||
| Currency | Currency | |||
| MaterialBaseUnit | MaterialBaseUnit | |||
| PInvDiffQtyPerYearInBaseUnit | ||||
| NumberOfPInvAdjustmentsPerYear |
@AccessControl.authorizationCheck: #NOT_ALLOWED
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_PhysInvtryDocItemPerYear
with parameters
P_StartDate : vdm_v_start_date
as select from P_MappedPhysInvtryItem
{
Material,
Plant,
StorageLocation,
Supplier,
Customer,
Batch,
InventorySpecialStockType,
InventoryStockType,
SalesOrder,
SalesOrderItem,
WBSElementInternalID,
StockOwner,
Currency,
MaterialBaseUnit,
@Semantics.amount.currencyCode:'Currency'
sum(
case
when Quantity > BookQtyBfrCountInMatlBaseUnit then DifferenceAmountInCoCodeCrcy
else -DifferenceAmountInCoCodeCrcy
end
) as DifferenceAmtPerYrInCoCodeCrcy,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
sum( DifferenceQuantityInBaseUnit ) as PInvDiffQtyPerYearInBaseUnit,
count(*) as NumberOfPInvAdjustmentsPerYear //count(PhysicalInventoryLastCountDate)
}
where PhysInvtryDifferenceIsPosted = 'X'
and PhysicalInventoryLastCountDate <= $parameters.P_StartDate
and PhysicalInventoryLastCountDate > dats_add_months($parameters.P_StartDate, -12,'UNCHANGED')
and DifferenceQuantityInBaseUnit <> 0
group by
Material,
Plant,
StorageLocation,
Supplier,
Customer,
Batch,
InventorySpecialStockType,
InventoryStockType,
SalesOrder,
SalesOrderItem,
WBSElementInternalID,
StockOwner,
Currency,
MaterialBaseUnit
// CurrentDate
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