P_PurchaseOrderItemStatus

DDL: P_PURCHASEORDERITEMSTATUS SQL: PPOITEMSTATUS Type: view CONSUMPTION

Status of a purchase order item

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.

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrderItem ekpo from

Annotations (12)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
AbapCatalog.sqlViewName PPOITEMSTATUS view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Status of a purchase order item view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrderItem PurchaseOrder
KEY Purchaseorderitem I_PurchaseOrderItem PurchaseOrderItem
PurchaseOrderType
PurchasingOrganization
PurchasingGroup
@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: #TRANSACTIONAL


define view P_PurchaseOrderItemStatus 
  as select from    I_PurchaseOrderItem          as ekpo
     left outer to one join C_Purdoclistpoitemstatusekbe as pos_ekbe on  ekpo.PurchaseOrder     = pos_ekbe.PurchasingDocument
                                                             and ekpo.PurchaseOrderItem = pos_ekbe.PurchasingDocumentItem
    left outer to one join P_PurgDocSupplierConfCount as folon on  ekpo.PurchaseOrder     = folon.PurchasingDocument
                                                                  and ekpo.PurchaseOrderItem = folon.PurchasingDocumentItem
    left outer to one join P_PurchaseOrderStatusOMApoc  as om_new   on ekpo.PurchaseOrder = om_new.appl_object_id             
    left outer to one join P_PurchaseOrderStatusOMNast  as om_old   on ekpo.PurchaseOrder = om_old.objky   
    left outer 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' then cast('38' as mmpur_doc_status)
                    else case ekpo._PurchaseOrder.ReleaseIsNotCompleted
                      when 'X' then cast('02' as mmpur_doc_status)
                        else case when (om_error.appl_object_id is null) then     
                          case when (pos_ekbe.PurchasingDocument is null) then
                             case when ( ekpo.SupplierConfirmationControlKey != '' and folon.ConfCount is null )
                                  then cast('26' as  mmpur_doc_status)
                             else case when (om_new.appl_object_id is null) then
                                case when (om_old.objky is null) then cast('03' as mmpur_doc_status)
                                   else cast('04' as mmpur_doc_status)
                                   end
                                else cast('04' as mmpur_doc_status)
                                end
                              end  
                             else cast('05' as mmpur_doc_status)                     
                             end
                          else cast('37' as mmpur_doc_status)
                          end
                        end
            end             as 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":""
}
}*/