P_ProdnOrdStatusAttrbTxt is a Consumption CDS View that provides data about "Production Order status text" in SAP S/4HANA. It reads from 1 data source (I_ManageOrdersTP) and exposes 8 fields with key field ManufacturingOrder. It has 1 association to related views.
@AbapCatalog: {
sqlViewName: 'PPRODORDSTSTXT',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@ObjectModel.usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #XL
}@VDM: {
viewType: #CONSUMPTION,
private: true
}@EndUserText.label: 'Production Order status text'
defineview P_ProdnOrdStatusAttrbTxt asselectfrom I_ManageOrdersTP as ProdOrd
association [0..*] to I_SystemStatusText as _SysStatusText on _SysStatusText.Language = $session.system_language
{
key ManufacturingOrder,
Material,
/*
I0001 -> created
I0042 -> Partially Released
I0002 -> Released
I0076 -> Flagged for Deletion
I0010 -> Partially Confirmed
I0009 -> Confirmed
I0074 -> Partially Confirmed
I0012 -> Delivered
I0043 -> Locked
I0045 -> Technically Completed
I0046 -> Closed
I0013 -> Deleted
*///reduce the actual code value to two digit to maintain GFN compatibility with field UI5NetworkGraphStatus
//Same code will be used incast( casewhen OrderIsDeleted = 'X' then '13'
when OrderIsClosed = 'X' then '46'
when OrderIsTechnicallyCompleted = 'X' then '45'
when OrderIsLocked = 'X' then '43'
when OrderIsDelivered = 'X' then '12'
when OrderIsPartiallyDelivered = 'X' then '74'
when OrderIsConfirmed = 'X' then '09'
when OrderIsPartiallyConfirmed = 'X' then '10'
when MfgOrderIsToBeDeleted = 'X' then '76'
when OrderIsReleased = 'X' then '02'
when OrderIsPartiallyReleased = 'X' then '42'
when OrderIsCreated = 'X' then '01'
endasabap.numc(2)) as OrderStatusInternalID,
@Semantics.text: truecasewhen OrderIsDeleted = 'X' then _SysStatusText[1: SystemStatus = 'I0013' ].SystemStatusName
when OrderIsClosed = 'X' then _SysStatusText[1: SystemStatus = 'I0046' ].SystemStatusName
when OrderIsTechnicallyCompleted = 'X' then _SysStatusText[1: SystemStatus = 'I0045' ].SystemStatusName
when OrderIsLocked = 'X' then _SysStatusText[1: SystemStatus = 'I0043' ].SystemStatusName
when OrderIsDelivered = 'X' then _SysStatusText[1: SystemStatus = 'I0012' ].SystemStatusName
when OrderIsPartiallyDelivered = 'X' then _SysStatusText[1: SystemStatus = 'I0074' ].SystemStatusName
when OrderIsConfirmed = 'X' then _SysStatusText[1: SystemStatus = 'I0009' ].SystemStatusName
when OrderIsPartiallyConfirmed = 'X' then _SysStatusText[1: SystemStatus = 'I0010' ].SystemStatusName
when MfgOrderIsToBeDeleted = 'X' then _SysStatusText[1: SystemStatus = 'I0076' ].SystemStatusName
when OrderIsReleased = 'X' then _SysStatusText[1: SystemStatus = 'I0002' ].SystemStatusName
when OrderIsPartiallyReleased = 'X' then _SysStatusText[1: SystemStatus = 'I0042' ].SystemStatusName
when OrderIsCreated = 'X' then _SysStatusText[1: SystemStatus = 'I0001' ].SystemStatusName
endas SystemStatusName,
ProductionPlant,
_SysStatusText,
_Material,
_Plant
}
where ManufacturingOrderType = 'YBM3'
or
ManufacturingOrderType = 'YBM4'