P_ProdnOrdStatusAttrbTxt

DDL: P_PRODNORDSTATUSATTRBTXT Type: view CONSUMPTION

Production Order status text

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.

Data Sources (1)

SourceAliasJoin Type
I_ManageOrdersTP ProdOrd from

Associations (1)

CardinalityTargetAliasCondition
[0..*] I_SystemStatusText _SysStatusText _SysStatusText.Language = $session.system_language

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PPRODORDSTSTXT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
VDM.viewType #CONSUMPTION view
VDM.private true view
EndUserText.label Production Order status text view

Fields (8)

KeyFieldSource TableSource FieldDescription
KEY ManufacturingOrder ManufacturingOrder
Material Material
numc2asOrderStatusInternalID
SystemStatusNameendasSystemStatusName
ProductionPlant ProductionPlant
_SysStatusText _SysStatusText
_Material _Material
_Plant _Plant
@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'

define view P_ProdnOrdStatusAttrbTxt as select from 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 in

 

                                                                                     
 cast( case
         when 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'
      end as abap.numc(2))  as OrderStatusInternalID,
                                                                
                                                                                     
 @Semantics.text: true
 
case 
  when 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 
 end   
                                                                                     as SystemStatusName,
                                                                                      
 
 ProductionPlant,

 _SysStatusText,
 
_Material,
_Plant

  
}
where ManufacturingOrderType = 'YBM3' 
or
ManufacturingOrderType = 'YBM4'

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MANAGEORDERSTP",
"I_SYSTEMSTATUSTEXT"
],
"ASSOCIATED":
[
"I_MATERIAL",
"I_PLANT",
"I_SYSTEMSTATUSTEXT"
],
"BASE":
[
"I_MANAGEORDERSTP"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/