I_PurchaseOrderQuickView
Purchase Order Data
I_PurchaseOrderQuickView is a Composite CDS View that provides data about "Purchase Order Data" in SAP S/4HANA. It reads from 5 data sources (I_PurgDocAccountAssignment, P_DDPurchaseOrder, I_PurgInfoRecdOrgPlantData, I_ProductSupplyPlanning, I_WBSElementByInternalKey) and exposes 77 fields with key fields PurchasingDocument, PurchasingDocumentItem, ScheduleLine. It has 7 associations to related views.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| I_PurgDocAccountAssignment | Acct | left_outer |
| P_DDPurchaseOrder | P_DDPurchaseOrder | from |
| I_PurgInfoRecdOrgPlantData | PIR | left_outer |
| I_ProductSupplyPlanning | Prod | left_outer |
| I_WBSElementByInternalKey | WBSElement | left_outer |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_MRPElementCategory | delkz |
Associations (7)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_PurgDocumentItemCategory | _PurgDocumentItemCategory | $projection.MaterialProcurementCategory = _PurgDocumentItemCategory.PurchasingDocumentItemCategory |
| [0..1] | I_WBSElement | _WBSElement | $projection.WBSElement = _WBSElement.WBSElement |
| [0..1] | I_UnitOfMeasure | _BaseUnit | $projection.PurchaseOrderItemQuantityUnit = _BaseUnit.UnitOfMeasure |
| [0..1] | I_RoundingPrfText | _RoundingProfile | $projection.MaterialRoundingProfile = _RoundingProfile.MaterialRoundingProfile and $projection.MRPPlant = _RoundingProfile.Plant |
| [0..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [0..1] | P_DDMRPController | _MRPController | $projection.SupplyingPlant = _MRPController.Plant and $projection.MRPController = _MRPController.MRPController |
| [0..1] | I_Plant | _SupplyingPlant | $projection.SupplyingPlant = _SupplyingPlant.Plant |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | IPOQV | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Purchase Order Data | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #COMPOSITE | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view |
Fields (77)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchasingDocument | Item | PurchasingDocument | |
| KEY | PurchasingDocumentItem | Item | PurchasingDocumentItem | |
| KEY | ScheduleLine | ScheduleLine | ||
| Material | Material | |||
| MaterialName | MaterialName | |||
| PurchasingDocumentCategory | PurchasingDocumentCategory | |||
| PurchasingDocumentType | PurchasingDocumentType | |||
| PurchasingDocumentTypeName | PurchasingDocumentTypeName | |||
| MaterialProcurementCategory | PurchasingDocumentItemCategory | |||
| SupplierMaterialNumber | SupplierMaterialNumber | |||
| InventorySpecialStockType | InventorySpecialStockType | |||
| MRPPlant | MRPPlant | |||
| SupplyingPlant | SupplyingPlant | |||
| SupplyingPlantName | _SupplyingPlant | PlantName | ||
| PurchasingInfoRecord | Item | PurchasingInfoRecord | ||
| PurchasingOrganization | Item | PurchasingOrganization | ||
| PurchasingGroup | Item | PurchasingGroup | ||
| PurchasingGroupName | PurchasingGroupName | |||
| PurchasingGroupPhoneNumber | PurchasingGroupPhoneNumber | |||
| PurchasingGroupEmailAddress | PurchasingGroupEmailAddress | |||
| PlannedDeliveryDurationInDays | Item | PlannedDeliveryDurationInDays | ||
| GoodsReceiptDurationInDays | GoodsReceiptDurationInDays | |||
| DeliveryDate | DeliveryDate | |||
| ProductAvailabilityDate | ProductAvailabilityDate | |||
| ScheduleLineOrderDate | ScheduleLineOrderDate | |||
| PartialDeliveryIsAllowed | PartialDeliveryIsAllowed | |||
| PurchaseContract | PurchaseContract | |||
| PurchaseContractItem | PurchaseContractItem | |||
| PurchaseOrderItemQuantityUnit | Item | OrderQuantityUnit | ||
| OrderQuantity | OrderQuantity | |||
| ScheduleLineOrderQuantity | ScheduleLineOrderQuantity | |||
| RoughGoodsReceiptQty | RoughGoodsReceiptQty | |||
| ScheduleLineOpenQuantity | ScheduleLineOpenQuantity | |||
| MRPRelevantQuantity | ||||
| StockInTransitQuantity | ||||
| MRPElementOpenQuantity | ||||
| OrderPriceUnitToOrderUnitNmrtr | Item | OrderPriceUnitToOrderUnitNmrtr | ||
| OrdPriceUnitToOrderUnitDnmntr | Item | OrdPriceUnitToOrderUnitDnmntr | ||
| MRPController | I_ProductSupplyPlanning | MRPResponsible | ||
| MRPControllerName | _MRPController | MRPControllerName | ||
| InternalContactPersonName | _MRPController | InternalContactName | ||
| MRPControllerPhoneNumber | _MRPController | PhoneNumber | ||
| ContactPersonEmailAddress | _MRPController | EmailAddress | ||
| Supplier | Item | Supplier | ||
| SupplierName | _Supplier | SupplierName | ||
| SupplierFullName | _Supplier | SupplierFullName | ||
| SupplierPhoneNumber | _Supplier | PhoneNumber1 | ||
| InternalContactEmailAddress | ||||
| SalesDocument | I_PurgDocAccountAssignment | SalesOrder | ||
| SalesDocumentItem | I_PurgDocAccountAssignment | SalesOrderItem | ||
| SalesDocumentType | ||||
| SalesOrderItemMaterial | ||||
| SalesOrderItemMaterialName | ||||
| Customer | ||||
| CustomerName | ||||
| CustomerFullName | ||||
| PhoneNumber | ||||
| EmailAddress | ||||
| WBSElementInternalID | I_PurgDocAccountAssignment | WBSElementInternalID | ||
| WBSElement | I_WBSElementByInternalKey | WBSElement | ||
| WBSDescription | I_WBSElementByInternalKey | WBSDescription | ||
| WBSElementDescription | ||||
| ProjectInternalID | I_WBSElementByInternalKey | ProjectInternalID | ||
| WBSElementObject | I_WBSElementByInternalKey | WBSElementObject | ||
| Project | ||||
| ProjectDescription | ||||
| StandardPurchaseOrderQuantity | I_PurgInfoRecdOrgPlantData | StandardPurchaseOrderQuantity | ||
| MaximumOrderQuantity | I_PurgInfoRecdOrgPlantData | MaximumOrderQuantity | ||
| MinimumPurchaseOrderQuantity | I_PurgInfoRecdOrgPlantData | MinimumPurchaseOrderQuantity | ||
| MaterialStagingTime | I_PurgInfoRecdOrgPlantData | MaterialStagingTime | ||
| MaterialFixedLotSizeQuantity | I_ProductSupplyPlanning | FixedLotSizeQuantity | ||
| MaterialMinLotSizeQuantity | I_ProductSupplyPlanning | MinimumLotSizeQuantity | ||
| MaterialMaxLotSizeQuantity | I_ProductSupplyPlanning | MaximumLotSizeQuantity | ||
| LotSizeRoundingQuantity | I_ProductSupplyPlanning | LotSizeRoundingQuantity | ||
| MaterialRoundingProfile | I_ProductSupplyPlanning | RoundingProfile | ||
| MaterialRoundingProfileName | ||||
| MRPElementCategory |
@AbapCatalog.sqlViewName: 'IPOQV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase Order Data'
@ObjectModel.usageType: {serviceQuality: #X, sizeCategory: #XXL, dataClass: #MIXED}
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
define view I_PurchaseOrderQuickView
with parameters
P_MRPElementCategory : delkz
as select from P_DDPurchaseOrder( P_MRPElementCategory:$parameters.P_MRPElementCategory) as Item
left outer join I_PurgDocAccountAssignment as Acct on Acct.PurchasingDocument = Item.PurchasingDocument // EKKN
and Acct.PurchasingDocumentItem = Item.PurchasingDocumentItem
and Acct.AccountAssignmentNumber = '01'
left outer join I_PurgInfoRecdOrgPlantData as PIR on PIR.PurchasingInfoRecord = Item.PurchasingInfoRecord // EINE
and PIR.PurchasingOrganization = Item.PurchasingOrganization
and PIR.Plant = Item.MRPPlant
left outer join I_ProductSupplyPlanning as Prod on Prod.Product = Item.Material // MARC
and Prod.Plant = Item.MRPPlant
left outer join I_WBSElementByInternalKey as WBSElement on WBSElement.WBSElementInternalID = Acct.WBSElementInternalID // PRPS
association [0..1] to I_PurgDocumentItemCategory as _PurgDocumentItemCategory on $projection.MaterialProcurementCategory = _PurgDocumentItemCategory.PurchasingDocumentItemCategory
association [0..1] to I_WBSElement as _WBSElement on $projection.WBSElement = _WBSElement.WBSElement
association [0..1] to I_UnitOfMeasure as _BaseUnit on $projection.PurchaseOrderItemQuantityUnit = _BaseUnit.UnitOfMeasure
// association [0..1] to I_MRPController as _MRPController on $projection.SupplyingPlant = _MRPController.Plant //T024 & ADR3
// and $projection.MRPController = _MRPController.MRPController
// association [0..1] to I_MRPControllerEmail as _MRPControllerEmail on $projection.SupplyingPlant = _MRPControllerEmail.Plant //ADR6
// and $projection.MRPController = _MRPControllerEmail.MRPController
association [0..1] to I_RoundingPrfText as _RoundingProfile on $projection.MaterialRoundingProfile = _RoundingProfile.MaterialRoundingProfile //RDTX
and $projection.MRPPlant = _RoundingProfile.Plant
association [0..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier
association [0..1] to P_DDMRPController as _MRPController on $projection.SupplyingPlant = _MRPController.Plant
and $projection.MRPController = _MRPController.MRPController
association [0..1] to I_Plant as _SupplyingPlant on $projection.SupplyingPlant = _SupplyingPlant.Plant
{
//Item
key Item.PurchasingDocument,
key Item.PurchasingDocumentItem,
key ScheduleLine,
Material,
MaterialName,
PurchasingDocumentCategory,
PurchasingDocumentType,
PurchasingDocumentTypeName,
PurchasingDocumentItemCategory as MaterialProcurementCategory,
SupplierMaterialNumber,
InventorySpecialStockType,
MRPPlant,
SupplyingPlant,
_SupplyingPlant.PlantName as SupplyingPlantName,
Item.PurchasingInfoRecord,
Item.PurchasingOrganization,
Item.PurchasingGroup,
PurchasingGroupName,
PurchasingGroupPhoneNumber,
PurchasingGroupEmailAddress,
Item.PlannedDeliveryDurationInDays,
GoodsReceiptDurationInDays,
DeliveryDate,
ProductAvailabilityDate,
ScheduleLineOrderDate,
PartialDeliveryIsAllowed,
PurchaseContract,
PurchaseContractItem,
@Semantics.unitOfMeasure: true
Item.OrderQuantityUnit as PurchaseOrderItemQuantityUnit,
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
OrderQuantity, // Ordered Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
ScheduleLineOrderQuantity, // Schedule Line Ordered Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
RoughGoodsReceiptQty, // Good Recepit Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
ScheduleLineOpenQuantity, // Schedule Line Open Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
cast(0 as dabmg) as MRPRelevantQuantity, // Notified Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
cast(0 as mng01) as StockInTransitQuantity, // InTransit Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
cast(0 as mng01) as MRPElementOpenQuantity, // MRP Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
case $parameters.P_MRPElementCategory
when 'U1'
then Item.ScheduleLineIssuedQuantity
end as ScheduleLineIssuedQuantity, // Issued Quantity
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderItemQuantityUnit'
@DefaultAggregation: #NONE
case $parameters.P_MRPElementCategory
when 'U1'
then Item.StockTransferDeliveredQuantity
end as StockTransferDeliveredQuantity, // Delivered Quantity for STO
Item.OrderPriceUnitToOrderUnitNmrtr,
Item.OrdPriceUnitToOrderUnitDnmntr,
//MRP Contoller
Prod.MRPResponsible as MRPController,
_MRPController.MRPControllerName,
_MRPController.InternalContactName as InternalContactPersonName,
_MRPController.PhoneNumber as MRPControllerPhoneNumber,
_MRPController.EmailAddress as ContactPersonEmailAddress,
//Supplier
Item.Supplier as Supplier,
_Supplier.SupplierName,
_Supplier.SupplierFullName,
_Supplier.PhoneNumber1 as SupplierPhoneNumber,
_Supplier._StandardAddress._DefaultEmailAddress.EmailAddress as InternalContactEmailAddress, //Supplier Email ID
//Sales Data
Acct.SalesOrder as SalesDocument,
Acct.SalesOrderItem as SalesDocumentItem,
Acct._SalesOrder.SalesOrderType as SalesDocumentType,
Acct._SalesOrderItem.Material as SalesOrderItemMaterial,
Acct._SalesOrderItem._Material._Text[1: Language = $session.system_language ].MaterialName as SalesOrderItemMaterialName,
Acct._SalesOrder.SoldToParty as Customer,
Acct._SalesOrder._SoldToParty.CustomerName,
Acct._SalesOrder._SoldToParty.CustomerFullName,
Acct._SalesOrder._SoldToParty._StandardAddress.PhoneNumber,
Acct._SalesOrder._SoldToParty._StandardAddress._DefaultEmailAddress.EmailAddress, // Customer Email ID
// WBS Element data
Acct.WBSElementInternalID,
WBSElement.WBSElement,
WBSElement.WBSDescription,
_WBSElement._WBSElementLangBsdDesc[1: Language = $session.system_language ].WBSElementLangBsdDescription as WBSElementDescription,
WBSElement.ProjectInternalID,
WBSElement.WBSElementObject,
WBSElement._Project.Project,
WBSElement._Project.ProjectDescription,
// EINE data
PIR.StandardPurchaseOrderQuantity,
PIR.MaximumOrderQuantity,
PIR.MinimumPurchaseOrderQuantity,
PIR.MaterialStagingTime,
// MARC data
Prod.FixedLotSizeQuantity as MaterialFixedLotSizeQuantity,
Prod.MinimumLotSizeQuantity as MaterialMinLotSizeQuantity,
Prod.MaximumLotSizeQuantity as MaterialMaxLotSizeQuantity,
Prod.LotSizeRoundingQuantity,
Prod.RoundingProfile as MaterialRoundingProfile,
_RoundingProfile[1: Language = $session.system_language].MaterialRoundingProfileName,
// case $parameters.P_MRPElementCategory
// when 'BE'
// then case
// when Item.PurchasingDocumentCategory = 'L'
// then '013' // Scheduling Agreement
// else case
// when Item.PurchasingDocumentItemCategory = '7'
// then '011' //STO(Inbound)
// else case
// when Item.Supplier is not null and Item.Supplier <> ' ' and Item.Supplier <> ''
// then '010' //Purchase Order
// else '000'
// end
// end
// end
// when 'LE'
// then case
// when Item.PurchasingDocumentCategory = 'L'
// then '013' // Scheduling Agreement
// end
// when 'U1'
// then '012' //STO(Outbound)
// else '000'
// end as QuickViewCategory,
$parameters.P_MRPElementCategory as MRPElementCategory
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRESS",
"I_ADDRESSEMAILADDRESS",
"I_CUSTOMER",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_PLANT",
"I_PRODUCTSUPPLYPLANNING",
"I_PROJECTBYINTERNALKEY",
"I_PURGDOCACCOUNTASSIGNMENT",
"I_PURGINFORECDORGPLANTDATA",
"I_ROUNDINGPRFTEXT",
"I_SALESORDER",
"I_SALESORDERITEM",
"I_SUPPLIER",
"I_WBSELEMENT",
"I_WBSELEMENTBYINTERNALKEY",
"I_WBSELEMENTTEXT",
"P_DDMRPCONTROLLER",
"P_DDPURCHASEORDER"
],
"ASSOCIATED":
[
"I_PLANT",
"I_PURGDOCUMENTITEMCATEGORY",
"I_ROUNDINGPRFTEXT",
"I_SUPPLIER",
"I_UNITOFMEASURE",
"I_WBSELEMENT",
"P_DDMRPCONTROLLER"
],
"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