I_PPS_PurchaseOrderStatus

DDL: I_PPS_PURCHASEORDERSTATUS SQL: PPSPOHDRSTATUS Type: view COMPOSITE

PPS Status of a purchase order

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.

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrder header from

Annotations (13)

NameValueLevelField
AbapCatalog.compiler.compareFilter true view
Metadata.ignorePropagatedAnnotations true view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
AbapCatalog.sqlViewName PPSPOHDRSTATUS view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label PPS Status of a purchase order view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.representativeKey PurchaseOrder view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrder PurchaseOrder
PurchaseOrderType I_PurchaseOrder PurchaseOrderType
PurchasingOrganization I_PurchaseOrder PurchasingOrganization
PurchasingGroup I_PurchaseOrder PurchasingGroup
//@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 as In 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'
define view I_PPS_PurchaseOrderStatus
  as select from           I_PurchaseOrder             as header
    left outer to one join P_PurchaseOrderStatusHist   as pos_ekbe on header.PurchaseOrder = pos_ekbe.PurchaseOrder
    left outer to one join P_PurchaseOrderStatusOMApoc as om_new   on header.PurchaseOrder = om_new.appl_object_id
    left outer to one join P_PurchaseOrderStatusOMNast as om_old   on header.PurchaseOrder = om_old.objky
    left outer 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' then cast('10' as pps_e_mmpur_doc_status)
          when 'L' then cast('10' as pps_e_mmpur_doc_status)
       else case  header.PurchasingCompletenessStatus
              when 'X' then cast('14' as pps_e_mmpur_doc_status)
                else case header.PurchasingProcessingStatus
                         when '08'
                         then cast('38' as pps_e_mmpur_doc_status)
                         when '05'
                          then cast('42' as pps_e_mmpur_doc_status)
//                         when '02'

//                          then cast('42' as pps_e_mmpur_doc_status)

                          else
                           case header.ReleaseIsNotCompleted
                             when 'X'
                             then cast('02' as pps_e_mmpur_doc_status)
                               else case when (om_error.appl_object_id is null) then
                                 case when (pos_ekbe.PurchaseOrder is null) then
                                    case when (om_new.appl_object_id is null) then
                                       case when (om_old.objky is null) then cast('03' as pps_e_mmpur_doc_status)
                                          else cast('04' as pps_e_mmpur_doc_status)
                                          end
                                       else cast('04' as pps_e_mmpur_doc_status)
                                       end
                                    else cast('05' as pps_e_mmpur_doc_status)
                                    end
                                 else cast('37' as pps_e_mmpur_doc_status)
                                 end
                               end
                           end
                end
            end             as 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":""
}
}*/