I_PPS_PurchaseOrderStatus is a Composite CDS View that provides data about "PPS Status of a purchase order" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrder) and exposes 4 fields with key field PurchaseOrder.
//@JIRA-KEY<S4PPS-8720>
@AbapCatalog.compiler.compareFilter: true// =========================================================================
// Status of Purchase Order Header
// =========================================================================
// The following status values are supported for PO Header:
// 01 Draft - not anymore asIn preparation & draft has the same pre condition
// 02 In Approval
// 03 Not Sent Yet
// 04 Sent
// 05 Follow-On Documents
// 10 Deleted
// 37 Output Error
// 38 Rejected
// 14 In Preparation
// =========================================================================
@Metadata.ignorePropagatedAnnotations:true@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API@VDM.viewType: #COMPOSITE@AccessControl.authorizationCheck: #MANDATORY@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED@AbapCatalog.sqlViewName: 'PPSPOHDRSTATUS'
@ClientHandling.algorithm: #SESSION_VARIABLE@EndUserText.label: 'PPS Status of a purchase order'
@ObjectModel.usageType.serviceQuality: #C@ObjectModel.usageType.sizeCategory: #XL@ObjectModel.usageType.dataClass: #MIXED@ObjectModel.semanticKey:['PurchaseOrder']@ObjectModel.representativeKey: 'PurchaseOrder'
defineview I_PPS_PurchaseOrderStatus
asselectfrom I_PurchaseOrder as header
leftouter to one join P_PurchaseOrderStatusHist as pos_ekbe on header.PurchaseOrder = pos_ekbe.PurchaseOrder
leftouter to one join P_PurchaseOrderStatusOMApoc as om_new on header.PurchaseOrder = om_new.appl_object_id
leftouter to one join P_PurchaseOrderStatusOMNast as om_old on header.PurchaseOrder = om_old.objky
leftouter to one join P_PurchaseOrderStatusOMErr as om_error on header.PurchaseOrder = om_error.appl_object_id
{
key header.PurchaseOrder as PurchaseOrder,
case header.PurchasingDocumentDeletionCode
when 'X' thencast('10' as pps_e_mmpur_doc_status)
when 'L' thencast('10' as pps_e_mmpur_doc_status)
elsecase header.PurchasingCompletenessStatus
when 'X' thencast('14' as pps_e_mmpur_doc_status)
elsecase header.PurchasingProcessingStatus
when '08'
thencast('38' as pps_e_mmpur_doc_status)
when '05'
thencast('42' as pps_e_mmpur_doc_status)
// when '02'
// thencast('42' as pps_e_mmpur_doc_status)
elsecase header.ReleaseIsNotCompleted
when 'X'
thencast('02' as pps_e_mmpur_doc_status)
elsecasewhen (om_error.appl_object_id isnull) thencasewhen (pos_ekbe.PurchaseOrder isnull) thencasewhen (om_new.appl_object_id isnull) thencasewhen (om_old.objky isnull) thencast('03' as pps_e_mmpur_doc_status)
elsecast('04' as pps_e_mmpur_doc_status)
endelsecast('04' as pps_e_mmpur_doc_status)
endelsecast('05' as pps_e_mmpur_doc_status)
endelsecast('37' as pps_e_mmpur_doc_status)
endendendendendas PurchasingDocumentStatus,
header.PurchaseOrderType,
header.PurchasingOrganization,
header.PurchasingGroup
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASEORDER",
"P_PURCHASEORDERSTATUSHIST",
"P_PURCHASEORDERSTATUSOMAPOC",
"P_PURCHASEORDERSTATUSOMERR",
"P_PURCHASEORDERSTATUSOMNAST"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/