P_PurchaseOrderItemStatus is a Consumption CDS View that provides data about "Status of a purchase order item" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrderItem) and exposes 5 fields with key fields PurchaseOrder, Purchaseorderitem.
@AbapCatalog.preserveKey: true@AbapCatalog.compiler.compareFilter: true// =========================================================================
// Status of Purchase Order Item
// =========================================================================
// The following status values are supported for PO Header:
// 01 Draft
// 02 In Approval
// 03 Not Sent Yet
// 04 Sent
// 05 Follow-On Documents
// 10 Deleted
// 37 Output Error
// 38 Rejected
// 26 Missing Confirmation
// =========================================================================
@VDM.viewType: #CONSUMPTION@VDM.private : true@AccessControl.authorizationCheck: #CHECK@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED@AbapCatalog.sqlViewName: 'PPOITEMSTATUS'
@ClientHandling.algorithm: #SESSION_VARIABLE@EndUserText.label: 'Status of a purchase order item'
//@ObjectModel.supportedCapabilities: #SQL_DATA_SOURCE@ObjectModel.usageType.serviceQuality: #C@ObjectModel.usageType.sizeCategory: #L@ObjectModel.usageType.dataClass: #TRANSACTIONALdefineview P_PurchaseOrderItemStatus
asselectfrom I_PurchaseOrderItem as ekpo
leftouter to one join C_Purdoclistpoitemstatusekbe as pos_ekbe on ekpo.PurchaseOrder = pos_ekbe.PurchasingDocument
and ekpo.PurchaseOrderItem = pos_ekbe.PurchasingDocumentItem
leftouter to one join P_PurgDocSupplierConfCount as folon on ekpo.PurchaseOrder = folon.PurchasingDocument
and ekpo.PurchaseOrderItem = folon.PurchasingDocumentItem
leftouter to one join P_PurchaseOrderStatusOMApoc as om_new on ekpo.PurchaseOrder = om_new.appl_object_id
leftouter to one join P_PurchaseOrderStatusOMNast as om_old on ekpo.PurchaseOrder = om_old.objky
leftouter to one join
P_PurchaseOrderStatusOMErr as om_error on ekpo.PurchaseOrder = om_error.appl_object_id
{
key ekpo.PurchaseOrder as PurchaseOrder,
key ekpo.PurchaseOrderItem as Purchaseorderitem,
case ekpo._PurchaseOrder.PurchasingProcessingStatus
when '08' thencast('38' as mmpur_doc_status)
elsecase ekpo._PurchaseOrder.ReleaseIsNotCompleted
when 'X' thencast('02' as mmpur_doc_status)
elsecasewhen (om_error.appl_object_id isnull) thencasewhen (pos_ekbe.PurchasingDocument isnull) thencasewhen ( ekpo.SupplierConfirmationControlKey != '' and folon.ConfCount isnull )
thencast('26' as mmpur_doc_status)
elsecasewhen (om_new.appl_object_id isnull) thencasewhen (om_old.objky isnull) thencast('03' as mmpur_doc_status)
elsecast('04' as mmpur_doc_status)
endelsecast('04' as mmpur_doc_status)
endendelsecast('05' as mmpur_doc_status)
endelsecast('37' as mmpur_doc_status)
endendendas PurchasingDocumentStatus,
ekpo._PurchaseOrder.PurchaseOrderType,
ekpo._PurchaseOrder.PurchasingOrganization,
ekpo._PurchaseOrder.PurchasingGroup
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_PURDOCLISTPOITEMSTATUSEKBE",
"I_PURCHASEORDER",
"I_PURCHASEORDERITEM",
"P_PURCHASEORDERSTATUSOMAPOC",
"P_PURCHASEORDERSTATUSOMERR",
"P_PURCHASEORDERSTATUSOMNAST",
"P_PURGDOCSUPPLIERCONFCOUNT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/