I_PurchaseOrderStatus

DDL: I_PURCHASEORDERSTATUS SQL: IMMPOHDRSTATUS Type: view COMPOSITE

Status of a purchase order

I_PurchaseOrderStatus is a Composite CDS View that provides data about "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 (15)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
Metadata.ignorePropagatedAnnotations true view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
AbapCatalog.sqlViewName IMMPOHDRSTATUS view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Status of a purchase order view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.semanticKey PurchaseOrder view
ObjectModel.representativeKey PurchaseOrder view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrder PurchaseOrder
PurchaseOrderType PurchaseOrderType
PurchasingOrganization PurchasingOrganization
PurchasingGroup PurchasingGroup

@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
// =========================================================================

//                  Status of Purchase Order Header

// =========================================================================

// 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

// =========================================================================

@Metadata.ignorePropagatedAnnotations:true
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AbapCatalog.sqlViewName: 'IMMPOHDRSTATUS'
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Status of a purchase order'
@ObjectModel.supportedCapabilities:[#SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE]
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.semanticKey: 'PurchaseOrder'
@ObjectModel.representativeKey: 'PurchaseOrder'
define view I_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 mmpur_doc_status)
          when 'L' then cast('10' as mmpur_doc_status)
          when 'C' then cast('10' as mmpur_doc_status)  //3365420

            else case header.PurchasingCompletenessStatus
              when 'X' then cast('01' as mmpur_doc_status)
                else case header.PurchasingProcessingStatus
                  when '08' then cast('38' as mmpur_doc_status)
                    else case header.ReleaseIsNotCompleted
                      when 'X' then cast('02' as mmpur_doc_status)
                        else case when (om_error.appl_object_id is null) then     // ^2879307

                          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 mmpur_doc_status)
                                   else cast('04' as mmpur_doc_status)
                                   end
                                else cast('04' as mmpur_doc_status)
                                end
                             else cast('05' as mmpur_doc_status)                      // v2879307

                             end
                          else cast('37' as mmpur_doc_status)
                          end
                        end
                    end
                end
            end             as PurchasingDocumentStatus,


      PurchaseOrderType,
      PurchasingOrganization,
      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":""
}
}*/