P_AssgblStoreForProcmtProdExt
P_AssgblStoreForProcmtProdExt is a Consumption CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 7 fields with key fields Product, Store. It has 1 association to related views.
Data Sources (6)
| Source | Alias | Join Type |
|---|---|---|
| I_ProductPlant | I_ProductPlant | left_outer |
| I_LoglProdAssgmtSuplrToStore | LoglProdAssgmtSuplrToStore | left_outer |
| I_LoglProductAssgmtDCToStore | LoglProductAssgmtDCToStore | left_outer |
| P_StoreGrpFromClfnStore | P_StoreGrpFromClfnStore | left_outer |
| I_Plant | Plant | cross |
| I_ActiveLogisticalProduct | Product | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_ValidityStartDate | datum | |
| P_ValidityEndDate | datum | |
| data | logistical |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_ActiveLogisticalProduct | _ActiveLogisticalProduct | $projection.Product = _ActiveLogisticalProduct.Product |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.sqlViewName | PASNSTRPROCPRODE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view |
Fields (7)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Product | I_ActiveLogisticalProduct | Product | |
| KEY | Store | I_Plant | Plant | |
| StoreName | I_Plant | PlantName | ||
| CityName | ||||
| StreetName | ||||
| StoreGroupInternalID | _AssgdStoreGroup | StoreGroupInternalID | ||
| _ActiveLogisticalProduct | _ActiveLogisticalProduct |
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.sqlViewName: 'PASNSTRPROCPRODE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@ObjectModel.usageType.serviceQuality: #C
@VDM.viewType: #CONSUMPTION
@VDM.private: true
define view P_AssgblStoreForProcmtProdExt
with parameters
P_ValidityStartDate : datum,
P_ValidityEndDate : datum
-- no checks for purchasing info records (especially no time-dependency thereof)
-- no checks for EKOrgs
-- no WRF3 checks
-- Superset of data: logistical products in stores
as select from I_ActiveLogisticalProduct as Product
cross join I_Plant as Plant
-- Condition: If a MARC entry already exists, the respective product must be defined as 'external procurement'
left outer join I_ProductPlant on I_ProductPlant.Product = Product.Product
and I_ProductPlant.Plant = Plant.Plant
-- Condition: No existing or overlaping assignments
left outer join I_LoglProductAssgmtDCToStore as LoglProductAssgmtDCToStore on Plant.Plant = LoglProductAssgmtDCToStore.Store
and Product.Product = LoglProductAssgmtDCToStore.Material
-- restrict time-dependent overlaps
and (
-- Start Date is within requested period
(
LoglProductAssgmtDCToStore.ValidityStartDate >= $parameters.P_ValidityStartDate
and LoglProductAssgmtDCToStore.ValidityStartDate <= $parameters.P_ValidityEndDate
)
or -- End Date is within requested period
(
LoglProductAssgmtDCToStore.ValidityEndDate >= $parameters.P_ValidityStartDate
and LoglProductAssgmtDCToStore.ValidityEndDate <= $parameters.P_ValidityEndDate
)
or -- Start Date and End Date wrap requested period
(
LoglProductAssgmtDCToStore.ValidityStartDate <= $parameters.P_ValidityStartDate
and LoglProductAssgmtDCToStore.ValidityEndDate >= $parameters.P_ValidityEndDate
)
)
left outer join I_LoglProdAssgmtSuplrToStore as LoglProdAssgmtSuplrToStore on Plant.Plant = LoglProdAssgmtSuplrToStore.Store
and Product.Product = LoglProdAssgmtSuplrToStore.Material
-- restrict time-dependent overlaps
and (
-- Start Date is within requested period
(
LoglProdAssgmtSuplrToStore.ValidityStartDate >= $parameters.P_ValidityStartDate
and LoglProdAssgmtSuplrToStore.ValidityStartDate <= $parameters.P_ValidityEndDate
)
or -- End Date is within requested period
(
LoglProdAssgmtSuplrToStore.ValidityEndDate >= $parameters.P_ValidityStartDate
and LoglProdAssgmtSuplrToStore.ValidityEndDate <= $parameters.P_ValidityEndDate
)
or -- Start Date and End Date wrap requested period
(
LoglProdAssgmtSuplrToStore.ValidityStartDate <= $parameters.P_ValidityStartDate
and LoglProdAssgmtSuplrToStore.ValidityEndDate >= $parameters.P_ValidityEndDate
)
)
left outer join P_StoreGrpFromClfnStore( P_SAPClient : $session.client) as _AssgdStoreGroup on Plant.Plant = _AssgdStoreGroup.Store
association [1..1] to I_ActiveLogisticalProduct as _ActiveLogisticalProduct on $projection.Product = _ActiveLogisticalProduct.Product
{
key Product.Product as Product,
key Plant.Plant as Store,
Plant.PlantName as StoreName,
Plant._Address.CityName,
Plant._Address.StreetName,
_AssgdStoreGroup.StoreGroupInternalID,
/* Exposed associations */
_ActiveLogisticalProduct
}
where
Plant.PlantCategory = 'A' -- only store
and LoglProductAssgmtDCToStore.SourceListRecord is null -- no match in source list (anti-join), thus no time overlap with existing assignments
and LoglProdAssgmtSuplrToStore.SourceListRecord is null -- no match in source list (anti-join), thus no time overlap with existing assignments
-- Source of Supply (MARC entry) optional, but if defined then external procurement
and(
I_ProductPlant.SourceOfSupplyCategory is null
or I_ProductPlant.SourceOfSupplyCategory = '1'
or I_ProductPlant.SourceOfSupplyCategory = '3'
or I_ProductPlant.SourceOfSupplyCategory = '4'
or I_ProductPlant.SourceOfSupplyCategory = 'A'
or I_ProductPlant.SourceOfSupplyCategory = 'B'
or I_ProductPlant.SourceOfSupplyCategory = 'C'
or I_ProductPlant.SourceOfSupplyCategory = 'D'
or I_ProductPlant.SourceOfSupplyCategory = 'E'
or I_ProductPlant.SourceOfSupplyCategory = 'F'
or I_ProductPlant.SourceOfSupplyCategory = 'G'
or I_ProductPlant.SourceOfSupplyCategory = 'H'
or I_ProductPlant.SourceOfSupplyCategory = 'I'
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACTIVELOGISTICALPRODUCT",
"I_ADDRESS",
"I_LOGLPRODASSGMTSUPLRTOSTORE",
"I_LOGLPRODUCTASSGMTDCTOSTORE",
"I_PLANT",
"I_PRODUCTPLANT"
],
"ASSOCIATED":
[
"I_ACTIVELOGISTICALPRODUCT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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