P_EquipMatlSerialNumberStatus is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_Equipment, I_StatusObjectActiveStatus) and exposes 4 fields with key fields Material, SerialNumber.
@AbapCatalog.sqlViewName: 'PEQMATLSRNUMSTAT'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED//@EndUserText.label: 'Status of Material Serial Number'
@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: truedefineview P_EquipMatlSerialNumberStatus
asselectfrom I_Equipment as Equipment
innerjoin I_StatusObjectActiveStatus as jest on jest.StatusObject = Equipment.MaintObjectInternalID
{
key Equipment.Material,
key Equipment.SerialNumber,
Equipment.MaintObjectInternalID,
case jest.StatusCode
when 'I0099' then 'X'
else ''
endas MatlSrlNmbrIsAvailable,
case jest.StatusCode
when 'I0013' then 'X'
else ''
endas MatlSrlNmbrIsDeleted,
case jest.StatusCode
when 'I0076' then 'X'
else ''
endas MatlSrlNmbrIsMrkdForDeltn,
case jest.StatusCode
when 'I0320' then 'X'
else ''
endas MatlSrlNmbrIsInactive,
case jest.StatusCode
when 'I0100' then 'X'
else ''
endas MatlSrlNmbrIsInstalled,
case jest.StatusCode
when 'I0116' then 'X'
else ''
endas MatlSrlNmbrIsAllcToParent,
case jest.StatusCode
when 'I0184' then 'X'
else ''
endas MatlSrlNmbrIsInWarehouse,
case jest.StatusCode
when 'I0186' then 'X'
else ''
endas MatlSrlNmbrIsAssgdToDeliv,
case jest.StatusCode
when 'I0188' then 'X'
else ''
endas MatlSrlNmbrIsAtCustomer,
case jest.StatusCode
when 'I0488' then 'X'
else ''
endas MatlSrlNmbrIsUndrCnstrctn,
case jest.StatusCode
when 'I0039' then 'X'
else ''
endas MatlSrlNmbrIsAssgdToJITCall,
case jest.StatusCode
when 'I8027' then 'X'
else ''
endas MatlSrlNmbrDocIsCreated,
case jest.StatusCode
when 'I0190' then 'X'
else ''
endas MatlSrlNmbrIsLocked,
case jest.StatusCode
when 'I0193' then 'X'
else ''
endas MatlSrlNmbrHndlgUntIsAssgd,
case jest.StatusCode
when 'I0194' then 'X'
else ''
endas MatlSrlNmbrInvtryIsActv,
case jest.StatusCode
when 'I0180' then 'X'
else ''
endas MatlSrlNmbrIsOnHold,
case jest.StatusCode
when 'IUII0' then 'X'
else ''
endas MatlSrlNmbrIsIDUndefined,
case jest.StatusCode
when 'IUII1' then 'X'
else ''
endas MatlSrlNmbrUUIDIsGnrtd,
case jest.StatusCode
when 'IUII2' then 'X'
else ''
endas MatlSrlNmbrUUIDIsAttached,
case jest.StatusCode
when 'IUII3' then 'X'
else ''
endas MatlSrlNmbrUUIDIsSent,
case jest.StatusCode
when 'IUII4' then 'X'
else ''
endas MatlSrlNmbrUUIDIsConfd,
Equipment._Material
}
where
(
jest.StatusCode = 'I0013'
or jest.StatusCode = 'I0076'
or jest.StatusCode = 'I0099'
or jest.StatusCode = 'I0320'
or jest.StatusCode = 'I0100'
or jest.StatusCode = 'I0116'
or jest.StatusCode = 'I0184'
or jest.StatusCode = 'I0186'
or jest.StatusCode = 'I0188'
or jest.StatusCode = 'I0488'
or jest.StatusCode = 'I0039'
or jest.StatusCode = 'I8027'
or jest.StatusCode = 'I0190'
or jest.StatusCode = 'I0193'
or jest.StatusCode = 'I0194'
or jest.StatusCode = 'I0180'
or jest.StatusCode = 'IUII0'
or jest.StatusCode = 'IUII1'
or jest.StatusCode = 'IUII2'
or jest.StatusCode = 'IUII3'
or jest.StatusCode = 'IUII4'
)
and jest.StatusObject like 'IE%'
and Equipment.SerialNumber isnotnulland
Equipment.SerialNumber != ' ' and
Equipment.Material isnotnulland
Equipment.Material != ' '
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EQUIPMENT",
"I_STATUSOBJECTACTIVESTATUS"
],
"ASSOCIATED":
[
"I_MATERIAL"
],
"BASE":
[
"I_EQUIPMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/