P_EquipmentStatus

DDL: P_EQUIPMENTSTATUS SQL: PEQUIPMENTSTATUS Type: view COMPOSITE

P_EquipmentStatus is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_Equipment, I_StatusObjectActiveStatus) and exposes 2 fields with key field Equipment.

Data Sources (2)

SourceAliasJoin Type
I_Equipment Equipment from
I_StatusObjectActiveStatus jest inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PEQUIPMENTSTATUS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY Equipment I_Equipment Equipment
MaintObjectInternalID I_Equipment MaintObjectInternalID
@AbapCatalog.sqlViewName: 'PEQUIPMENTSTATUS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.viewType: #COMPOSITE   // technically a BASIC but due to view layering a COMPOSITE)

@VDM.private: true
// provides the non-aggregated status

// to be used in aggregation views such as P_OrderStatusAggr only

define view P_EquipmentStatus
  as select from I_Equipment                as Equipment
    inner join   I_StatusObjectActiveStatus as jest on jest.StatusObject = Equipment.MaintObjectInternalID
{
  key Equipment.Equipment,
      Equipment.MaintObjectInternalID,

      case jest.StatusCode
          when 'I0099' then 'X'
          else ''
        end as EquipmentIsAvailable,
      case jest.StatusCode
        when 'I0184' then 'X'
        else ''
      end   as EquipmentIsInWarehouse,
      case jest.StatusCode
        when 'I0188' then 'X'
        else ''
      end   as EquipmentIsAtCustomer,
      case jest.StatusCode
        when 'I0186' then 'X'
        else ''
      end   as EquipmentIsAssignedToDelivery,
      case jest.StatusCode
        when 'I0076' then 'X'
        else ''
      end   as EquipmentIsMarkedForDeletion,
      case jest.StatusCode
        when 'I0100' then 'X'
        else ''
        end as EquipmentIsInstalled,
      case jest.StatusCode
        when 'I0320' then 'X'
        else ''
        end as EquipmentIsInactive,
      case jest.StatusCode
      when 'I0116' then 'X'
      else ''
      end   as EquipIsAllocToSuperiorEquip
}
where
  (
       jest.StatusCode   =    'I0099'
    or jest.StatusCode   =    'I0184'
    or jest.StatusCode   =    'I0188'
    or jest.StatusCode   =    'I0186'
    or jest.StatusCode   =    'I0076'
    or jest.StatusCode   =    'I0100'
    or jest.StatusCode   =    'I0320'
    or jest.StatusCode   =    'I0116'
  )
  and  jest.StatusObject like 'IE%';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EQUIPMENT",
"I_STATUSOBJECTACTIVESTATUS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/